Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(746)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/widget/EmptyAlertEditText.java

Issue 1278963004: Revert of [Android] Make enhanced bookmark editing UI more straightforward. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkEditActivity.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/widget/EmptyAlertEditText.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/EmptyAlertEditText.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/EmptyAlertEditText.java
index 0f37b3f98fd54cb3906c2fbca1af75a3570ceafc..9fe5e1a2494e2550a78b3c4e092dc09208ed478f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/widget/EmptyAlertEditText.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/EmptyAlertEditText.java
@@ -43,11 +43,7 @@
@Override
public void afterTextChanged(Editable s) {
- if (isEmpty()) {
- if (getError() != null) setError(null);
- } else {
- setError(mAlertMessage);
- }
+ if (s.toString().trim().length() != 0 && getError() != null) setError(null);
}
});
}
@@ -67,9 +63,14 @@
}
/**
+ * Checks whether the content is empty. If empty, an alert message will be shown.
* @return Whether the content is empty.
*/
- public boolean isEmpty() {
- return getTrimmedText().length() > 0;
+ public boolean validate() {
+ if (getTrimmedText().length() == 0) {
+ setError(mAlertMessage);
+ return false;
+ }
+ return true;
}
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkEditActivity.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698