|
|
@@ -12,10 +12,13 @@ import android.content.Intent;
|
|
|
import android.content.ServiceConnection;
|
|
|
import android.content.SharedPreferences;
|
|
|
import android.os.Bundle;
|
|
|
+import android.os.Handler;
|
|
|
import android.os.IBinder;
|
|
|
+import android.os.Message;
|
|
|
import android.text.TextUtils;
|
|
|
import android.util.Log;
|
|
|
import android.util.TypedValue;
|
|
|
+import android.view.MotionEvent;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
import android.widget.ImageView;
|
|
|
@@ -49,6 +52,8 @@ import es.dmoral.toasty.Toasty;
|
|
|
public class WelcomeActivity extends AppCompatActivity {
|
|
|
private static final String TAG = "WelcomeActivity";
|
|
|
|
|
|
+ private static final int HIDE_BAR = 10000;
|
|
|
+
|
|
|
public static void start(Context context, Meeting meeting, EmpInfo empInfo) {
|
|
|
Intent intent = new Intent(context, WelcomeActivity.class);
|
|
|
intent.putExtra("meeting", meeting);
|
|
|
@@ -105,6 +110,18 @@ public class WelcomeActivity extends AppCompatActivity {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ private Handler handler = new Handler(msg -> {
|
|
|
+ switch (msg.what) {
|
|
|
+ case HIDE_BAR:
|
|
|
+ View decorView = getWindow().getDecorView();
|
|
|
+ int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
|
|
+ | View.SYSTEM_UI_FLAG_FULLSCREEN
|
|
|
+ | View.SYSTEM_UI_FLAG_IMMERSIVE;
|
|
|
+ decorView.setSystemUiVisibility(uiOptions);
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ });
|
|
|
+
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
|
@@ -133,6 +150,9 @@ public class WelcomeActivity extends AppCompatActivity {
|
|
|
Toasty.normal(WelcomeActivity.this, "密码错误", ContextCompat.getDrawable(WelcomeActivity.this, R.mipmap.toast_icon_warn_fill))
|
|
|
.show();
|
|
|
}
|
|
|
+ Message msg = new Message();
|
|
|
+ msg.what = HIDE_BAR;
|
|
|
+ handler.sendMessageDelayed(msg, 500);
|
|
|
}
|
|
|
});
|
|
|
passwordDialog.show();
|
|
|
@@ -144,8 +164,8 @@ public class WelcomeActivity extends AppCompatActivity {
|
|
|
rvMeetings.setLayoutManager(new LinearLayoutManager(this));
|
|
|
rvMeetings.setAdapter(adapter);
|
|
|
|
|
|
- if (empInfo.getHeadShot() != null) {
|
|
|
- Picasso.get().load(empInfo.getHeadShot()).placeholder(R.mipmap.portrait).into(ivPortrait);
|
|
|
+ if (empInfo.getHalfBodyPhoto() != null) {
|
|
|
+ Picasso.get().load(empInfo.getHalfBodyPhoto()).placeholder(R.mipmap.portrait).into(ivPortrait);
|
|
|
}
|
|
|
if (TextUtils.isEmpty(meeting.getWelcomeText())) {
|
|
|
tvWelcome.setText("欢迎");
|
|
|
@@ -163,11 +183,16 @@ public class WelcomeActivity extends AppCompatActivity {
|
|
|
}
|
|
|
}
|
|
|
tvAdviserName.setText(empInfo.getUserName());
|
|
|
+ if (empInfo.getDescription() == null) {
|
|
|
+ tvIntro.setVisibility(View.GONE);
|
|
|
+ } else {
|
|
|
+ tvIntro.setText(empInfo.getDescription());
|
|
|
+ }
|
|
|
if (empInfo.getTgStarLevel() != null) {
|
|
|
tvRate.setText(empInfo.getTgStarLevel().toString());
|
|
|
} else {
|
|
|
tvRate.setVisibility(View.GONE);
|
|
|
- tvRateD.setVisibility(View.VISIBLE);
|
|
|
+ tvRateD.setVisibility(View.GONE);
|
|
|
}
|
|
|
if (empInfo.getCertifications() == null || empInfo.getCertifications().isEmpty()) {
|
|
|
tvCertNo.setVisibility(View.GONE);
|
|
|
@@ -184,6 +209,7 @@ public class WelcomeActivity extends AppCompatActivity {
|
|
|
|
|
|
try {
|
|
|
Date endTime = Utils.parseDateTime(meeting.getEndTimeStr());
|
|
|
+ endTime.setTime(endTime.getTime() + 60 * 1000);
|
|
|
Timer timer = new Timer();
|
|
|
timer.schedule(new TimerTask() {
|
|
|
@Override
|
|
|
@@ -228,6 +254,14 @@ public class WelcomeActivity extends AppCompatActivity {
|
|
|
rlMeetings.setVisibility(View.VISIBLE);
|
|
|
}
|
|
|
adapter.notifyDataSetChanged();
|
|
|
+
|
|
|
+ List<Meeting> meetings = new ArrayList<>();
|
|
|
+ for (RoomMeetings todayMeeting : MyApplication.todayMeetings) {
|
|
|
+ meetings.addAll(todayMeeting.getMeetings());
|
|
|
+ }
|
|
|
+ if (meetings.stream().noneMatch(meeting1 -> meeting1.getUuid().equals(meeting.getUuid()))) {
|
|
|
+ finish();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void updateStatus() {
|
|
|
@@ -254,6 +288,22 @@ public class WelcomeActivity extends AppCompatActivity {
|
|
|
updateStatus();
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public boolean dispatchTouchEvent(MotionEvent me) {
|
|
|
+ if (me.getAction() == MotionEvent.ACTION_DOWN) {
|
|
|
+ View decorView = getWindow().getDecorView();
|
|
|
+ int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
|
|
+ | View.SYSTEM_UI_FLAG_FULLSCREEN
|
|
|
+ | View.SYSTEM_UI_FLAG_IMMERSIVE;
|
|
|
+ decorView.setSystemUiVisibility(uiOptions);
|
|
|
+ if (MyApplication.roomInfo != null) {
|
|
|
+ tvRoomName.setText(MyApplication.roomInfo.getRoomName());
|
|
|
+ tvRoomNum.setText(MyApplication.roomInfo.getRoomBizNum());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return super.dispatchTouchEvent(me);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void onStart() {
|
|
|
super.onStart();
|