Commit 175d75af authored by bsazonov's avatar bsazonov Committed by Commit bot

Fix UI style of signin AlertDialogs on Android

This CL adds SigninAlertDialogTheme style that uses Google Blue 500 color
for button text and forces message text to use Chrome default text color.

BUG=650121,669787

Review-Url: https://codereview.chromium.org/2801213003
Cr-Commit-Position: refs/heads/master@{#462853}
parent 376d3697
...@@ -419,6 +419,15 @@ ...@@ -419,6 +419,15 @@
<item name="windowActionBar">false</item> <item name="windowActionBar">false</item>
</style> </style>
<style name="SigninAlertDialogTheme" parent="AlertDialogTheme">
<item name="buttonBarButtonStyle">@style/SigninDialogButtonStyle</item>
<item name="android:textColorPrimary">@color/default_text_color</item>
</style>
<style name="SigninDialogButtonStyle" parent="Widget.AppCompat.Button.ButtonBar.AlertDialog">
<item name="android:textColor">@color/light_active_color</item>
</style>
<!-- Bookmarks --> <!-- Bookmarks -->
<style name="BookmarkTitleBarButton"> <style name="BookmarkTitleBarButton">
<item name="android:layout_width">wrap_content</item> <item name="android:layout_width">wrap_content</item>
......
...@@ -53,7 +53,8 @@ public class AccountAdder { ...@@ -53,7 +53,8 @@ public class AccountAdder {
} }
private void onOpenAddGoogleAccountPageFailed(final Activity activity, final int result) { private void onOpenAddGoogleAccountPageFailed(final Activity activity, final int result) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity, R.style.AlertDialogTheme); AlertDialog.Builder builder =
new AlertDialog.Builder(activity, R.style.SigninAlertDialogTheme);
builder.setMessage(R.string.signin_open_add_google_account_page_failed); builder.setMessage(R.string.signin_open_add_google_account_page_failed);
builder.setPositiveButton( builder.setPositiveButton(
R.string.signin_open_settings_accounts, new DialogInterface.OnClickListener() { R.string.signin_open_settings_accounts, new DialogInterface.OnClickListener() {
......
...@@ -171,7 +171,7 @@ public class ConfirmImportSyncDataDialog extends DialogFragment ...@@ -171,7 +171,7 @@ public class ConfirmImportSyncDataDialog extends DialogFragment
layout.addView(mConfirmImportOption); layout.addView(mConfirmImportOption);
} }
return new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme) return new AlertDialog.Builder(getActivity(), R.style.SigninAlertDialogTheme)
.setPositiveButton(R.string.continue_button, this) .setPositiveButton(R.string.continue_button, this)
.setNegativeButton(R.string.cancel, this) .setNegativeButton(R.string.cancel, this)
.setView(v) .setView(v)
......
...@@ -133,7 +133,7 @@ public class ConfirmManagedSyncDataDialog extends DialogFragment ...@@ -133,7 +133,7 @@ public class ConfirmManagedSyncDataDialog extends DialogFragment
String positiveButton = getArguments().getString(KEY_POSITIVE_BUTTON); String positiveButton = getArguments().getString(KEY_POSITIVE_BUTTON);
String negativeButton = getArguments().getString(KEY_NEGATIVE_BUTTON); String negativeButton = getArguments().getString(KEY_NEGATIVE_BUTTON);
return new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme) return new AlertDialog.Builder(getActivity(), R.style.SigninAlertDialogTheme)
.setTitle(title) .setTitle(title)
.setMessage(description) .setMessage(description)
.setPositiveButton(positiveButton, this) .setPositiveButton(positiveButton, this)
......
...@@ -60,7 +60,7 @@ public class ConfirmSyncDataStateMachineDelegate { ...@@ -60,7 +60,7 @@ public class ConfirmSyncDataStateMachineDelegate {
*/ */
public void showFetchManagementPolicyProgressDialog(final ProgressDialogListener listener) { public void showFetchManagementPolicyProgressDialog(final ProgressDialogListener listener) {
dismissAllDialogs(); dismissAllDialogs();
mProgressDialog = new AlertDialog.Builder(mContext, R.style.AlertDialogTheme) mProgressDialog = new AlertDialog.Builder(mContext, R.style.SigninAlertDialogTheme)
.setView(R.layout.signin_progress_bar_dialog) .setView(R.layout.signin_progress_bar_dialog)
.setNegativeButton(R.string.cancel, .setNegativeButton(R.string.cancel,
new DialogInterface.OnClickListener() { new DialogInterface.OnClickListener() {
...@@ -87,7 +87,7 @@ public class ConfirmSyncDataStateMachineDelegate { ...@@ -87,7 +87,7 @@ public class ConfirmSyncDataStateMachineDelegate {
public void showFetchManagementPolicyTimeoutDialog(final TimeoutDialogListener listener) { public void showFetchManagementPolicyTimeoutDialog(final TimeoutDialogListener listener) {
dismissAllDialogs(); dismissAllDialogs();
mTimeoutAlertDialog = mTimeoutAlertDialog =
new AlertDialog.Builder(mContext, R.style.AlertDialogTheme) new AlertDialog.Builder(mContext, R.style.SigninAlertDialogTheme)
.setTitle(R.string.sign_in_timeout_title) .setTitle(R.string.sign_in_timeout_title)
.setMessage(R.string.sign_in_timeout_message) .setMessage(R.string.sign_in_timeout_message)
.setNegativeButton(R.string.cancel, .setNegativeButton(R.string.cancel,
......
...@@ -67,7 +67,7 @@ public class SignOutDialogFragment extends DialogFragment implements ...@@ -67,7 +67,7 @@ public class SignOutDialogFragment extends DialogFragment implements
R.string.signout_managed_account_message, managementDomain); R.string.signout_managed_account_message, managementDomain);
} }
return new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme) return new AlertDialog.Builder(getActivity(), R.style.SigninAlertDialogTheme)
.setTitle(R.string.signout_title) .setTitle(R.string.signout_title)
.setPositiveButton(R.string.signout_dialog_positive_button, this) .setPositiveButton(R.string.signout_dialog_positive_button, this)
.setNegativeButton(R.string.cancel, this) .setNegativeButton(R.string.cancel, this)
......
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