Commit 7eb4d96d by Kazuyuki Hida

動作するようになったので、いったんコミット

parent 89703410
...@@ -41,5 +41,26 @@ ...@@ -41,5 +41,26 @@
/> />
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="#ff999999"
android:padding="8dp"
>
<Button
android:id="@+id/agreeButton"
style="@style/ButtonABookDark"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/agree"/>
<Button
android:id="@+id/disagreeButton"
style="@style/ButtonABookDark"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/disagree" />
</LinearLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -91,7 +91,7 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity { ...@@ -91,7 +91,7 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
* @param loginId * @param loginId
*/ */
protected void showMainActivity(String loginId) { protected void showMainActivity(String loginId) {
AgreementToTermsActivity.PreAgreementListener listener = new AgreementToTermsHelper.AgreementListener() { AgreementToTermsHelper.AgreementListener listener = new AgreementToTermsHelper.AgreementListener() {
@Override @Override
public void onDisabled() { public void onDisabled() {
onAgreed(); onAgreed();
...@@ -109,9 +109,29 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity { ...@@ -109,9 +109,29 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
} }
@Override @Override
public void onConfirmed(boolean isAgreed) {
if (isAgreed) {
// 同意したら初期化
doShowMainActivity();
} else {
// 規約に同意しなかったので、ログアウト
LogoutHelper.logout(ABVNoAuthenticatedActivity.this);
}
}
@Override
public void onError(Exception e) {
logoutAlert(R.string.C_E_SYSTEM_0001);
}
@Override
public void onFailed(Exception e) { public void onFailed(Exception e) {
// 読み込みに失敗したらログアウト // 読み込みに失敗したらログアウト
AlertDialogUtil.showAlertDialog(ABVNoAuthenticatedActivity.this, R.string.app_name, R.string.failed_to_get_terms_of_service, true, new DialogInterface.OnClickListener() { logoutAlert(R.string.failed_to_get_terms_of_service);
}
private void logoutAlert(int messageRes) {
AlertDialogUtil.showAlertDialog(ABVNoAuthenticatedActivity.this, R.string.app_name, messageRes, true, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
LogoutHelper.logout(ABVNoAuthenticatedActivity.this); LogoutHelper.logout(ABVNoAuthenticatedActivity.this);
...@@ -119,7 +139,7 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity { ...@@ -119,7 +139,7 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
}); });
} }
}; };
AgreementToTermsActivity.confirmAgreement(this, REQUEST_AGREEMENT_FROM_LOGIN, isNormalSize(), listener); AgreementToTermsHelper.confirmAgreement(this, isNormalSize(), listener);
} }
protected void doShowMainActivity() { protected void doShowMainActivity() {
...@@ -414,7 +434,7 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity { ...@@ -414,7 +434,7 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
return; return;
} }
// 必要に応じて、規約同意画面を表示 // 必要に応じて、規約同意画面を表示
AgreementToTermsActivity.PreAgreementListener listener = new AgreementToTermsActivity.PreAgreementListener() { AgreementToTermsHelper.AgreementListener listener = new AgreementToTermsHelper.AgreementListener() {
@Override @Override
public void onDisabled() { public void onDisabled() {
onAgreed(); onAgreed();
...@@ -432,13 +452,32 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity { ...@@ -432,13 +452,32 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
} }
@Override @Override
public void onConfirmed(boolean isAgreed) {
if (isAgreed) {
// 同意したら初期化
doMoveToHome();
} else {
// 規約に同意しなかったので、ログアウト
LogoutHelper.logout(ABVNoAuthenticatedActivity.this);
}
}
@Override
public void onError(Exception e) {
// 失敗しても、次に進む
Logger.e(TAG, e);
doMoveToHome();
}
@Override
public void onFailed(Exception e) { public void onFailed(Exception e) {
// 読み込みに失敗しても、次に進む // 読み込みに失敗しても、次に進む
Logger.e(TAG, e); Logger.e(TAG, e);
doMoveToHome(); doMoveToHome();
} }
}; };
AgreementToTermsActivity.confirmAgreement(this, REQUEST_AGREEMENT, isNormalSize(), listener); AgreementToTermsHelper.clearVersion(this);
AgreementToTermsHelper.confirmAgreement(this, isNormalSize(), listener);
} }
@Override @Override
......
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