|
|
@@ -60,6 +60,7 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
|
|
getSupportActionBar().hide();
|
|
|
StatusBarUtil.immersive(this, 0x00000000, 0.0f);
|
|
|
initView();
|
|
|
+ initPhonePass();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -74,22 +75,8 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
|
|
protected void onResume() {
|
|
|
super.onResume();
|
|
|
|
|
|
- requestPermission(Manifest.permission.READ_PHONE_STATE, null, null);
|
|
|
- if (!UasLocationHelper.getInstance().isLocationUpdate()) {
|
|
|
- UasLocationHelper.getInstance().requestLocation();
|
|
|
- }
|
|
|
- if (ViewUtil.mdProcessDialog != null) {
|
|
|
- ViewUtil.mdProcessDialog.cancel();
|
|
|
- }
|
|
|
- if (CommonUtil.getSharedPreferences(this, "user_phone") != null && CommonUtil.getSharedPreferences(this, "user_phone").length() > 0) {
|
|
|
- mPhoneNumberEdit.setText(CommonUtil.getSharedPreferences(this, "user_phone"));
|
|
|
- }
|
|
|
- if (PreferenceUtils.getString(this, PASS_WORDS) != null && PreferenceUtils.getString(this, PASS_WORDS).length() > 0) {
|
|
|
- mPasswordEdit.setText(PreferenceUtils.getString(this, PASS_WORDS));
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
-
|
|
|
private void initView() {
|
|
|
mToastHead = findViewById(R.id.login_toast_head);
|
|
|
mToastLayout = findViewById(R.id.login_toast_fl);
|
|
|
@@ -122,6 +109,23 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
|
|
mPasswordEdit.addTextChangedListener(new MyTextWatcher());
|
|
|
}
|
|
|
|
|
|
+ private void initPhonePass() {
|
|
|
+ requestPermission(Manifest.permission.READ_PHONE_STATE, null, null);
|
|
|
+ if (!UasLocationHelper.getInstance().isLocationUpdate()) {
|
|
|
+ UasLocationHelper.getInstance().requestLocation();
|
|
|
+ }
|
|
|
+ if (ViewUtil.mdProcessDialog != null) {
|
|
|
+ ViewUtil.mdProcessDialog.cancel();
|
|
|
+ }
|
|
|
+ if (CommonUtil.getSharedPreferences(this, "user_phone") != null && CommonUtil.getSharedPreferences(this, "user_phone").length() > 0) {
|
|
|
+ mPhoneNumberEdit.setText(CommonUtil.getSharedPreferences(this, "user_phone"));
|
|
|
+ }
|
|
|
+ if (PreferenceUtils.getString(this, PASS_WORDS) != null && PreferenceUtils.getString(this, PASS_WORDS).length() > 0) {
|
|
|
+ mPasswordEdit.setText(PreferenceUtils.getString(this, PASS_WORDS));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
class MyTextWatcher implements TextWatcher {
|
|
|
|
|
|
@Override
|