Index: chrome/android/java/src/org/chromium/chrome/browser/sync/ui/PassphraseDialogFragment.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/ui/PassphraseDialogFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/ui/PassphraseDialogFragment.java |
index 018f58b440862180761fe05a3fd5dc08b191e78b..de182514f5cecf5c7b634ee736aa306abb8fb322 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/sync/ui/PassphraseDialogFragment.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/ui/PassphraseDialogFragment.java |
@@ -12,6 +12,7 @@ import android.content.Context; |
import android.content.DialogInterface; |
import android.content.DialogInterface.OnClickListener; |
import android.content.Intent; |
+import android.graphics.Color; |
import android.net.Uri; |
import android.os.Bundle; |
import android.provider.Browser; |
@@ -51,6 +52,7 @@ public class PassphraseDialogFragment extends DialogFragment implements OnClickL |
* @return whether passphrase was valid. |
*/ |
boolean onPassphraseEntered(String passphrase); |
+ |
void onPassphraseCanceled(); |
} |
@@ -98,25 +100,27 @@ public class PassphraseDialogFragment extends DialogFragment implements OnClickL |
@Override |
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { |
if (actionId == EditorInfo.IME_ACTION_NEXT) { |
- handleOk(); |
+ handleSubmit(); |
} |
return false; |
} |
}); |
- final AlertDialog d = new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme) |
- .setView(v) |
- .setPositiveButton(R.string.ok, new Dialog.OnClickListener() { |
- @Override |
- public void onClick(DialogInterface d, int which) { |
- // We override the onclick. This is a hack to not dismiss the dialog after |
- // click of OK and instead dismiss it after confirming the passphrase |
- // is correct. |
- } |
- }) |
- .setNegativeButton(R.string.cancel, this) |
- .setTitle(R.string.sign_in_google_account) |
- .create(); |
+ final AlertDialog d = |
newt (away)
2016/02/12 22:03:51
Revert the wrapping to how it was. In general, try
May
2016/02/16 17:32:07
Another auto-formatting...
newt (away)
2016/02/16 23:05:01
By the way, "git difftool --tool=meld" is super ha
|
+ new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme) |
+ .setView(v) |
+ .setPositiveButton(R.string.submit, |
+ new Dialog.OnClickListener() { |
+ @Override |
+ public void onClick(DialogInterface d, int which) { |
+ // We override the onclick. This is a hack to not dismiss |
+ // the dialog after click of OK and instead dismiss it after |
+ // confirming the passphrase is correct. |
+ } |
+ }) |
+ .setNegativeButton(R.string.cancel, this) |
+ .setTitle(R.string.sign_in_google_account) |
+ .create(); |
d.getDelegate().setHandleNativeActionModesEnabled(false); |
d.setOnShowListener(new DialogInterface.OnShowListener() { |
@Override |
@@ -125,7 +129,7 @@ public class PassphraseDialogFragment extends DialogFragment implements OnClickL |
b.setOnClickListener(new View.OnClickListener() { |
@Override |
public void onClick(View view) { |
- handleOk(); |
+ handleSubmit(); |
} |
}); |
} |
@@ -183,8 +187,8 @@ public class PassphraseDialogFragment extends DialogFragment implements OnClickL |
} |
/** |
- * @return whether the incorrect passphrase text is currently visible. |
- */ |
+ * @return whether the incorrect passphrase text is currently visible. |
+ */ |
private boolean isIncorrectPassphraseVisible() { |
// Check if the verifying TextView is currently showing the incorrect |
// passphrase text. |
@@ -203,9 +207,10 @@ public class PassphraseDialogFragment extends DialogFragment implements OnClickL |
getListener().onPassphraseCanceled(); |
} |
- private void handleOk() { |
+ private void handleSubmit() { |
TextView verifying = (TextView) getDialog().findViewById(R.id.verifying); |
verifying.setText(R.string.sync_verifying); |
+ verifying.setTextColor(Color.LTGRAY); |
newt (away)
2016/02/12 22:03:51
Use color resources from colors.xml instead of con
May
2016/02/16 17:32:08
Actually, I can't find anymore where the spec said
|
EditText passphraseEditText = (EditText) getDialog().findViewById(R.id.passphrase); |
String passphrase = passphraseEditText.getText().toString(); |
@@ -232,5 +237,6 @@ public class PassphraseDialogFragment extends DialogFragment implements OnClickL |
private void invalidPassphrase() { |
TextView verifying = (TextView) getDialog().findViewById(R.id.verifying); |
newt (away)
2016/02/12 22:03:51
Do you need to set the error state on the text vie
May
2016/02/16 17:32:07
I'm not sure I understand. What underline?
|
verifying.setText(R.string.sync_passphrase_incorrect); |
+ verifying.setTextColor(Color.RED); |
newt (away)
2016/02/12 22:03:51
likewise
May
2016/02/16 17:32:08
Changed to colors.xml. Also changed the error colo
|
} |
} |