2025-05-15 11:08:23 +08:00
|
|
|
package com.qxcm.qxlive;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import android.content.Intent;
|
2025-05-22 19:03:01 +08:00
|
|
|
import android.os.Bundle;
|
2025-05-15 11:08:23 +08:00
|
|
|
import android.os.Handler;
|
2025-07-04 16:38:21 +08:00
|
|
|
|
2025-08-08 10:31:50 +08:00
|
|
|
import androidx.annotation.Nullable;
|
2025-05-15 11:08:23 +08:00
|
|
|
|
2025-08-12 15:43:36 +08:00
|
|
|
import com.qxcm.moduleutil.activity.BaseAppCompatActivity;
|
2025-05-15 11:08:23 +08:00
|
|
|
import com.qxcm.moduleutil.activity.BaseMvpActivity;
|
2025-08-12 15:43:36 +08:00
|
|
|
import com.qxcm.moduleutil.base.CommonAppContext;
|
2025-05-15 11:08:23 +08:00
|
|
|
import com.qxcm.moduleutil.dialog.PolicyDialog;
|
|
|
|
|
import com.qxcm.moduleutil.utils.SpUtil;
|
|
|
|
|
import com.qxcm.qxlive.databinding.ActivityLaunchPageBinding;
|
|
|
|
|
|
2025-08-12 15:43:36 +08:00
|
|
|
public class LaunchPageActivity extends BaseAppCompatActivity<ActivityLaunchPageBinding> {
|
2025-05-15 11:08:23 +08:00
|
|
|
private Handler handler;
|
2025-08-08 10:31:50 +08:00
|
|
|
// public PhoneNumberAuthHelper phoneNumberAuthHelper;
|
|
|
|
|
// private TokenResultListener tokenResultListener;
|
2025-05-15 11:08:23 +08:00
|
|
|
private boolean canOnePass;
|
2025-05-22 19:03:01 +08:00
|
|
|
private boolean isCanOnePass = true;
|
2025-07-04 16:38:21 +08:00
|
|
|
private String city1="";
|
2025-05-15 11:08:23 +08:00
|
|
|
@Override
|
|
|
|
|
protected void initData() {
|
|
|
|
|
handler = new Handler();
|
|
|
|
|
// 定义一个Runnable
|
|
|
|
|
Runnable runnable = new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
initLogin();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
if (SpUtil.isAgreePolicy()) {
|
|
|
|
|
// //延迟1.5秒执行
|
2025-08-04 17:15:03 +08:00
|
|
|
handler.postDelayed(runnable, 2500);
|
2025-05-15 11:08:23 +08:00
|
|
|
} else {
|
|
|
|
|
PolicyDialog policyDialog = new PolicyDialog(this);
|
|
|
|
|
policyDialog.setCancelable(false);
|
|
|
|
|
policyDialog.setCanceledOnTouchOutside(false);
|
|
|
|
|
policyDialog.setPolicyClickListener(new PolicyDialog.PolicyClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void policyAgree() {
|
|
|
|
|
SpUtil.completeAgreePolicy();
|
2025-08-12 15:43:36 +08:00
|
|
|
CommonAppContext.getInstance().initialization();
|
2025-05-15 11:08:23 +08:00
|
|
|
initLogin();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void policyExit() {
|
|
|
|
|
finish();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
policyDialog.show();
|
|
|
|
|
}
|
2025-07-04 16:38:21 +08:00
|
|
|
|
|
|
|
|
|
2025-05-15 11:08:23 +08:00
|
|
|
}
|
|
|
|
|
|
2025-08-12 15:43:36 +08:00
|
|
|
@Override
|
|
|
|
|
protected void initView() {
|
2025-07-04 16:38:21 +08:00
|
|
|
|
2025-05-15 11:08:23 +08:00
|
|
|
}
|
|
|
|
|
|
2025-08-12 15:43:36 +08:00
|
|
|
private void initLogin() {
|
2025-05-22 19:03:01 +08:00
|
|
|
|
2025-05-15 11:08:23 +08:00
|
|
|
startActivity(new Intent(this, PasswordLoginActivity.class));
|
|
|
|
|
finish();
|
|
|
|
|
}
|
2025-05-22 19:03:01 +08:00
|
|
|
|
2025-08-12 15:43:36 +08:00
|
|
|
|
|
|
|
|
|
2025-05-15 11:08:23 +08:00
|
|
|
@Override
|
|
|
|
|
protected int getLayoutId() {
|
|
|
|
|
return R.layout.activity_launch_page;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2025-08-08 10:31:50 +08:00
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
|
if (!this.isTaskRoot()) {
|
|
|
|
|
Intent intent = getIntent();
|
|
|
|
|
if (intent != null) {
|
|
|
|
|
String action = intent.getAction();
|
|
|
|
|
if (intent.hasCategory(Intent.CATEGORY_LAUNCHER) && Intent.ACTION_MAIN.equals(action)) {
|
|
|
|
|
finish();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2025-05-15 11:08:23 +08:00
|
|
|
}
|