aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/WordComposer.java
diff options
context:
space:
mode:
authorKen Wakasa <kwakasa@google.com>2010-09-27 09:30:28 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-09-27 09:30:28 -0700
commit0517bffc065096ce3b0eceada94696735fcbafd7 (patch)
treec9fde2d142c1a75364b076eff3f1bffd887f2a32 /java/src/com/android/inputmethod/latin/WordComposer.java
parentdc7097b4e74fa2290cc70106e49e84e0c812feda (diff)
parent7f2a6a056b67efa2a1fb623ca4cf73f7fb6c7d8c (diff)
downloadlatinime-0517bffc065096ce3b0eceada94696735fcbafd7.tar.gz
latinime-0517bffc065096ce3b0eceada94696735fcbafd7.tar.xz
latinime-0517bffc065096ce3b0eceada94696735fcbafd7.zip
am 7f2a6a05: am 0b4ae1f5: Capitalize the displayed text in the suggestion bar when all of the user typed chars are upper case
Merge commit '7f2a6a056b67efa2a1fb623ca4cf73f7fb6c7d8c' * commit '7f2a6a056b67efa2a1fb623ca4cf73f7fb6c7d8c': Capitalize the displayed text in the suggestion bar when all of the user typed chars are upper case
Diffstat (limited to 'java/src/com/android/inputmethod/latin/WordComposer.java')
-rw-r--r--java/src/com/android/inputmethod/latin/WordComposer.java26
1 files changed, 17 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java
index fe4c68576..2e415b771 100644
--- a/java/src/com/android/inputmethod/latin/WordComposer.java
+++ b/java/src/com/android/inputmethod/latin/WordComposer.java
@@ -39,9 +39,9 @@ public class WordComposer {
private boolean mAutoCapitalized;
/**
- * Whether the user chose to capitalize the word.
+ * Whether the user chose to capitalize the first char of the word.
*/
- private boolean mIsCapitalized;
+ private boolean mIsFirstCharCapitalized;
public WordComposer() {
mCodes = new ArrayList<int[]>(12);
@@ -54,7 +54,7 @@ public class WordComposer {
mTypedWord = new StringBuilder(copy.mTypedWord);
mCapsCount = copy.mCapsCount;
mAutoCapitalized = copy.mAutoCapitalized;
- mIsCapitalized = copy.mIsCapitalized;
+ mIsFirstCharCapitalized = copy.mIsFirstCharCapitalized;
}
/**
@@ -62,7 +62,7 @@ public class WordComposer {
*/
public void reset() {
mCodes.clear();
- mIsCapitalized = false;
+ mIsFirstCharCapitalized = false;
mPreferredWord = null;
mTypedWord.setLength(0);
mCapsCount = 0;
@@ -138,18 +138,26 @@ public class WordComposer {
return mTypedWord;
}
- public void setCapitalized(boolean capitalized) {
- mIsCapitalized = capitalized;
+ public void setFirstCharCapitalized(boolean capitalized) {
+ mIsFirstCharCapitalized = capitalized;
}
/**
* Whether or not the user typed a capital letter as the first letter in the word
* @return capitalization preference
*/
- public boolean isCapitalized() {
- return mIsCapitalized;
+ public boolean isFirstCharCapitalized() {
+ return mIsFirstCharCapitalized;
}
-
+
+ /**
+ * Whether or not all of the user typed chars are upper case
+ * @return true if all user typed chars are upper case, false otherwise
+ */
+ public boolean isAllUpperCase() {
+ return (mCapsCount > 0) && (mCapsCount == size());
+ }
+
/**
* Stores the user's selected word, before it is actually committed to the text field.
* @param preferred