diff options
author | 2014-01-09 17:21:06 +0900 | |
---|---|---|
committer | 2014-01-09 18:19:17 +0900 | |
commit | 0a75cf51afbdc79ccb2c6eabaf06a0aa26263af5 (patch) | |
tree | 9991295c6f4fc9bda3d224e0fde923830a874e9d /java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java | |
parent | 860c3b8e8cc65e2a2b26b4da0356b5bcff6450e6 (diff) | |
download | latinime-0a75cf51afbdc79ccb2c6eabaf06a0aa26263af5.tar.gz latinime-0a75cf51afbdc79ccb2c6eabaf06a0aa26263af5.tar.xz latinime-0a75cf51afbdc79ccb2c6eabaf06a0aa26263af5.zip |
Passing SpacingAndPunctuations to CapsModeUtils.getCapsMode
Change-Id: I0b06e8cc75a403f7061864c5b7f3f6a2cacd60eb
Diffstat (limited to 'java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java b/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java index c7416727a..057e332e9 100644 --- a/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java @@ -21,7 +21,7 @@ import android.text.TextUtils; import com.android.inputmethod.latin.Constants; import com.android.inputmethod.latin.WordComposer; -import com.android.inputmethod.latin.settings.SettingsValues; +import com.android.inputmethod.latin.settings.SpacingAndPunctuations; import java.util.Locale; @@ -74,7 +74,7 @@ public final class CapsModeUtils { * @param reqModes The modes to be checked: may be any combination of * {@link TextUtils#CAP_MODE_CHARACTERS}, {@link TextUtils#CAP_MODE_WORDS}, and * {@link TextUtils#CAP_MODE_SENTENCES}. - * @param settingsValues The current settings values. + * @param spacingAndPunctuations The current spacing and punctuations settings. * @param hasSpaceBefore Whether we should consider there is a space inserted at the end of cs * * @return Returns the actual capitalization modes that can be in effect @@ -83,7 +83,7 @@ public final class CapsModeUtils { * {@link TextUtils#CAP_MODE_SENTENCES}. */ public static int getCapsMode(final CharSequence cs, final int reqModes, - final SettingsValues settingsValues, final boolean hasSpaceBefore) { + final SpacingAndPunctuations spacingAndPunctuations, final boolean hasSpaceBefore) { // Quick description of what we want to do: // CAP_MODE_CHARACTERS is always on. // CAP_MODE_WORDS is on if there is some whitespace before the cursor. @@ -167,7 +167,7 @@ public final class CapsModeUtils { // No other language has such a rule as far as I know, instead putting inside the quotation // mark as the exact thing quoted and handling the surrounding punctuation independently, // e.g. <<Did he say, "let's go home"?>> - if (settingsValues.mSpacingAndPunctuations.mUsesAmericanTypography) { + if (spacingAndPunctuations.mUsesAmericanTypography) { for (; j > 0; j--) { // Here we look to go over any closing punctuation. This is because in dominant // variants of English, the final period is placed within double quotes and maybe @@ -190,7 +190,7 @@ public final class CapsModeUtils { if (c == Constants.CODE_QUESTION_MARK || c == Constants.CODE_EXCLAMATION_MARK) { return (TextUtils.CAP_MODE_CHARACTERS | TextUtils.CAP_MODE_SENTENCES) & reqModes; } - if (!settingsValues.mSpacingAndPunctuations.isSentenceSeparator(c) || j <= 0) { + if (!spacingAndPunctuations.isSentenceSeparator(c) || j <= 0) { return (TextUtils.CAP_MODE_CHARACTERS | TextUtils.CAP_MODE_WORDS) & reqModes; } @@ -240,7 +240,7 @@ public final class CapsModeUtils { case WORD: if (Character.isLetter(c)) { state = WORD; - } else if (settingsValues.mSpacingAndPunctuations.isSentenceSeparator(c)) { + } else if (spacingAndPunctuations.isSentenceSeparator(c)) { state = PERIOD; } else { return caps; @@ -256,7 +256,7 @@ public final class CapsModeUtils { case LETTER: if (Character.isLetter(c)) { state = LETTER; - } else if (settingsValues.mSpacingAndPunctuations.isSentenceSeparator(c)) { + } else if (spacingAndPunctuations.isSentenceSeparator(c)) { state = PERIOD; } else { return noCaps; |