一键登录 loading hide,fix bug
This commit is contained in:
@@ -26,6 +26,7 @@ import androidx.multidex.MultiDex;
|
||||
import androidx.multidex.MultiDexApplication;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.ActivityUtils;
|
||||
import com.blankj.utilcode.util.AppUtils;
|
||||
import com.blankj.utilcode.util.FileUtils;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
@@ -107,6 +108,8 @@ public class CommonAppContext extends MultiDexApplication implements Application
|
||||
|
||||
public boolean isMai = false;
|
||||
|
||||
public boolean isLogout = false;
|
||||
|
||||
public void onAppBackground() {
|
||||
wasInBackground = true;
|
||||
}
|
||||
@@ -767,10 +770,13 @@ public class CommonAppContext extends MultiDexApplication implements Application
|
||||
mqttConnect.close();
|
||||
}
|
||||
|
||||
|
||||
isLogout = true;
|
||||
// 发送广播通知所有Activity刷新状态
|
||||
Intent refreshIntent = new Intent("com.xscm.moduleutil.ACTION_USER_LOGOUT");
|
||||
sendBroadcast(refreshIntent);
|
||||
// Intent refreshIntent = new Intent("com.xscm.moduleutil.ACTION_USER_LOGOUT");
|
||||
// sendBroadcast(refreshIntent);
|
||||
|
||||
ActivityUtils.finishAllActivities();
|
||||
|
||||
Intent intent = new Intent("com.qxcm.qxlive.LAUNCH_PAGE");
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
getApplicationContext().startActivity(intent);
|
||||
|
||||
@@ -58,21 +58,11 @@ public abstract class BasePresenter<V extends IView> implements IPresenter {
|
||||
@Override
|
||||
public void detachView() {
|
||||
cancelRequest();
|
||||
if (MvpRef != null) {
|
||||
MvpRef.clear();
|
||||
MvpRef = null;
|
||||
}
|
||||
if (api != null) {
|
||||
api = null;
|
||||
}
|
||||
unBindView();
|
||||
}
|
||||
|
||||
|
||||
public void unBindView() {
|
||||
if (MvpRef != null) {
|
||||
MvpRef.clear();
|
||||
}
|
||||
mContext=null;
|
||||
}
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ public class ImageUtils {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Glide.with(mImageView).load(path).error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).centerCrop().diskCacheStrategy(DiskCacheStrategy.ALL).into(mImageView);
|
||||
Glide.with(mImageView).asBitmap().load(path).error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).centerCrop().diskCacheStrategy(DiskCacheStrategy.ALL).into(mImageView);
|
||||
}
|
||||
|
||||
public static void loadHead(String path, ImageView mImageView) {
|
||||
|
||||
@@ -130,6 +130,11 @@ public class ForgetPasswordActivity extends BaseMvpActivity<LoginPresenter, Acti
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void authorError() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected LoginPresenter bindPresenter() {
|
||||
return new LoginPresenter(this, this);
|
||||
|
||||
@@ -200,6 +200,11 @@ public class LoginActivity extends BaseMvpActivity<LoginPresenter, ActivityLogin
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void authorError() {
|
||||
|
||||
}
|
||||
|
||||
boolean isPasswordVisible = false;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -96,4 +96,9 @@ public class SwitchAccountsActivity extends BaseMvpActivity<LoginPresenter, Acti
|
||||
public void getThemeData(ThemeBean themeBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void authorError() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,8 @@ public final class LoginContacter {
|
||||
void ysxlSuccess(String s);
|
||||
|
||||
void getThemeData(ThemeBean themeBean);
|
||||
|
||||
void authorError();
|
||||
}
|
||||
|
||||
public interface ILoginPre extends IPresenter {
|
||||
|
||||
@@ -1824,10 +1824,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
}
|
||||
}
|
||||
LogUtils.e("handleMsgType1004", "mRoomInfoResp = ${mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1]}")
|
||||
mRoomInfoResp?.room_info?.pit_list?.forEach { it ->
|
||||
LogUtils.e("PitBean:${it.toString()}")
|
||||
}
|
||||
|
||||
roomFragment!!.upRoomInfoData(mRoomInfoResp)
|
||||
roomFragment?.handleRoomMessage(messageEvent)
|
||||
roomBtnShowIsHide(fromUserInfo.user_id)
|
||||
|
||||
@@ -75,9 +75,20 @@ public class LaunchPageActivity extends BaseMvpActivity<IPresenter, ActivityLaun
|
||||
private VideoView videoView;
|
||||
private boolean isCheck = true;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
if (CommonAppContext.getInstance().isLogout){
|
||||
startActivity(new Intent(this, PasswordLoginActivity.class));
|
||||
finish();
|
||||
}
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
|
||||
super.onCreate(savedInstanceState, persistentState);
|
||||
|
||||
|
||||
LogUtils.e("4444", "LaunchPageActivity onCreate");
|
||||
// 获取Application实例并设置监听器
|
||||
CommonAppContext app = (CommonAppContext) getApplication();
|
||||
@@ -197,7 +208,6 @@ public class LaunchPageActivity extends BaseMvpActivity<IPresenter, ActivityLaun
|
||||
// 设置gravity来填充整个布局
|
||||
params.gravity = Gravity.FILL;
|
||||
mBinding.container.addView(videoView, params);
|
||||
|
||||
// 设置视频缩放模式为拉伸填充
|
||||
videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
|
||||
@Override
|
||||
@@ -231,7 +241,7 @@ public class LaunchPageActivity extends BaseMvpActivity<IPresenter, ActivityLaun
|
||||
|
||||
// 显示跳过按钮
|
||||
mBinding.btnSkipImg.setVisibility(android.view.View.VISIBLE);
|
||||
|
||||
mp.setVolume(0.1f,0.1f); // 设置音量
|
||||
// 启动进度更新
|
||||
startProgressUpdate(mp, duration);
|
||||
}
|
||||
@@ -240,6 +250,7 @@ public class LaunchPageActivity extends BaseMvpActivity<IPresenter, ActivityLaun
|
||||
// 设置视频路径,从raw资源中
|
||||
String videoPath = "android.resource://" + getPackageName() + "/" + R.raw.app_start;
|
||||
|
||||
|
||||
// 设置播放完成监听器
|
||||
videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
|
||||
@Override
|
||||
@@ -336,7 +347,14 @@ public class LaunchPageActivity extends BaseMvpActivity<IPresenter, ActivityLaun
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
setEnter();
|
||||
if (videoView != null) {
|
||||
if (videoView.isPlaying()){
|
||||
videoView.stopPlayback();
|
||||
videoView = null;
|
||||
}
|
||||
}
|
||||
startActivity(new Intent(this, PasswordLoginActivity.class));
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,6 +17,7 @@ import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alipay.sdk.app.AuthTask;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
@@ -40,6 +41,7 @@ import com.xscm.modulemain.activity.main.activity.MainActivity;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.ThemeBean;
|
||||
import com.xscm.moduleutil.bean.UserBean;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.BarUtils;
|
||||
import com.xscm.moduleutil.utils.PreferencesUtils;
|
||||
import com.xscm.moduleutil.utils.logger.Logger;
|
||||
@@ -51,7 +53,6 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, ActivityPasswordLoginBinding> implements LoginContacter.View, View.OnClickListener {
|
||||
|
||||
private CountDownTimer mTimer;
|
||||
@@ -624,6 +625,13 @@ public class PasswordLoginActivity extends BaseMvpActivity<LoginPresenter, Activ
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void authorError() {
|
||||
if (phoneNumberAuthHelper != null){
|
||||
phoneNumberAuthHelper.hideLoginLoading();
|
||||
}
|
||||
}
|
||||
|
||||
private void zfbLogin(String s) {
|
||||
LogUtils.e("@@@",s);
|
||||
CommonAppContext.getInstance();
|
||||
|
||||
Reference in New Issue
Block a user