Commit 77894f98 by onuma

#46276 ログインボタンは常に活性化状態とした

parent bf9c1677
...@@ -113,17 +113,6 @@ ...@@ -113,17 +113,6 @@
android:text="@string/login" android:text="@string/login"
android:textColor="@color/text_color" android:textColor="@color/text_color"
android:visibility="visible"/> android:visibility="visible"/>
<Button
android:id="@+id/btn_login_on"
android:layout_width="match_parent"
android:layout_height="46dp"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:background="@drawable/btn_login_on"
android:contentDescription="@string/login"
android:text="@string/login"
android:textColor="@color/text_color"
android:visibility="gone"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
......
...@@ -98,7 +98,6 @@ public class LoginActivity extends ABVLoginActivity { ...@@ -98,7 +98,6 @@ public class LoginActivity extends ABVLoginActivity {
private InputMethodManager imm; private InputMethodManager imm;
private Button btnLoginOff; private Button btnLoginOff;
private Button btnLoginOn;
private Button btnDetail; private Button btnDetail;
private CheckBox chexBoxAgree; private CheckBox chexBoxAgree;
private static String termsOfUseUrl = ABVEnvironment.getInstance().agree_to_terms_of_use_url; private static String termsOfUseUrl = ABVEnvironment.getInstance().agree_to_terms_of_use_url;
...@@ -157,15 +156,8 @@ public class LoginActivity extends ABVLoginActivity { ...@@ -157,15 +156,8 @@ public class LoginActivity extends ABVLoginActivity {
} }
}); });
// 活性化したログインボタン。
btnLoginOn = findViewById(R.id.btn_login_on); // ログインボタン
btnLoginOn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
tryLogin();
}
});
// 非活性化したログインボタン
btnLoginOff = findViewById(R.id.btn_login_off); btnLoginOff = findViewById(R.id.btn_login_off);
btnLoginOff.setVisibility(View.VISIBLE); btnLoginOff.setVisibility(View.VISIBLE);
btnLoginOff.setOnClickListener(new View.OnClickListener() { btnLoginOff.setOnClickListener(new View.OnClickListener() {
...@@ -180,20 +172,14 @@ public class LoginActivity extends ABVLoginActivity { ...@@ -180,20 +172,14 @@ public class LoginActivity extends ABVLoginActivity {
// 初期化(状態は保存しておく。ログアウトした後に使う) // 初期化(状態は保存しておく。ログアウトした後に使う)
boolean agree = PreferenceUtil.getUserPref(LoginActivity.this, AppDefType.PrefName.AGREE_STATUS, false); boolean agree = PreferenceUtil.getUserPref(LoginActivity.this, AppDefType.PrefName.AGREE_STATUS, false);
if (agree) { if (agree) {
btnLoginOn.setVisibility(View.VISIBLE);
btnLoginOff.setVisibility(View.GONE);
chexBoxAgree.setChecked(true); chexBoxAgree.setChecked(true);
} }
chexBoxAgree.setOnClickListener(new View.OnClickListener() { chexBoxAgree.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
if (chexBoxAgree.isChecked()) { if (chexBoxAgree.isChecked()) {
btnLoginOn.setVisibility(View.VISIBLE);
btnLoginOff.setVisibility(View.GONE);
PreferenceUtil.putUserPref(LoginActivity.this, AppDefType.PrefName.AGREE_STATUS, true); PreferenceUtil.putUserPref(LoginActivity.this, AppDefType.PrefName.AGREE_STATUS, true);
} else { } else {
btnLoginOn.setVisibility(View.GONE);
btnLoginOff.setVisibility(View.VISIBLE);
PreferenceUtil.putUserPref(LoginActivity.this, AppDefType.PrefName.AGREE_STATUS, false); PreferenceUtil.putUserPref(LoginActivity.this, AppDefType.PrefName.AGREE_STATUS, false);
} }
} }
...@@ -204,9 +190,6 @@ public class LoginActivity extends ABVLoginActivity { ...@@ -204,9 +190,6 @@ public class LoginActivity extends ABVLoginActivity {
chexBoxAgree.setVisibility(View.GONE); chexBoxAgree.setVisibility(View.GONE);
findViewById(R.id.terms_of_use_text).setVisibility(View.GONE); findViewById(R.id.terms_of_use_text).setVisibility(View.GONE);
findViewById(R.id.detail).setVisibility(View.GONE); findViewById(R.id.detail).setVisibility(View.GONE);
// ログインボタン
btnLoginOff.setVisibility(View.GONE);
btnLoginOn.setVisibility(View.VISIBLE);
} }
//androidバジョン6以上からMAC idではなくandroid固有numberを取得ため、ダイアログで表示 //androidバジョン6以上からMAC idではなくandroid固有numberを取得ため、ダイアログで表示
...@@ -461,6 +444,17 @@ public class LoginActivity extends ABVLoginActivity { ...@@ -461,6 +444,17 @@ public class LoginActivity extends ABVLoginActivity {
return false; return false;
} }
} }
if (StringUtil.isNullOrWhiteSpace(mLoginId)) {
handleErrorMessageToast(ErrorCode.E001);
mEdtLoginId.requestFocus();
return false;
}
if (StringUtil.isNullOrWhiteSpace(mPassword)) {
handleErrorMessageToast(ErrorCode.E002);
mEdtPassword.requestFocus();
return false;
}
if (!StringUtil.isNullOrEmpty(termsOfUseUrl)) { if (!StringUtil.isNullOrEmpty(termsOfUseUrl)) {
if (!chexBoxAgree.isChecked()) { if (!chexBoxAgree.isChecked()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment