am 4423f3da: Merge "Remove useless args and processing."
* commit '4423f3da00d19433c7a316e8865a0762351c13d1': Remove useless args and processing.main
commit
139d42f704
|
@ -340,10 +340,6 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
||||||
mState.onCodeInput(code, mLatinIME.getCurrentAutoCapsState());
|
mState.onCodeInput(code, mLatinIME.getCurrentAutoCapsState());
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isShowingMainKeyboard() {
|
|
||||||
return null != mKeyboardView && mKeyboardView.isShown();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShowingEmojiPalettes() {
|
public boolean isShowingEmojiPalettes() {
|
||||||
return mEmojiPalettesView != null && mEmojiPalettesView.isShown();
|
return mEmojiPalettesView != null && mEmojiPalettesView.isShown();
|
||||||
}
|
}
|
||||||
|
@ -376,10 +372,6 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isShowingMainKeyboardOrEmojiPalettes() {
|
|
||||||
return isShowingMainKeyboard() || isShowingEmojiPalettes();
|
|
||||||
}
|
|
||||||
|
|
||||||
public View onCreateInputView(final boolean isHardwareAcceleratedDrawingEnabled) {
|
public View onCreateInputView(final boolean isHardwareAcceleratedDrawingEnabled) {
|
||||||
if (mKeyboardView != null) {
|
if (mKeyboardView != null) {
|
||||||
mKeyboardView.closing();
|
mKeyboardView.closing();
|
||||||
|
|
|
@ -853,7 +853,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
}
|
}
|
||||||
// This will set the punctuation suggestions if next word suggestion is off;
|
// This will set the punctuation suggestions if next word suggestion is off;
|
||||||
// otherwise it will clear the suggestion strip.
|
// otherwise it will clear the suggestion strip.
|
||||||
setNeutralSuggestionStripInternal(false /* needsInputViewShown */);
|
setNeutralSuggestionStripInternal();
|
||||||
|
|
||||||
mHandler.cancelUpdateSuggestionStrip();
|
mHandler.cancelUpdateSuggestionStrip();
|
||||||
mHandler.cancelDoubleSpacePeriodTimer();
|
mHandler.cancelDoubleSpacePeriodTimer();
|
||||||
|
@ -1018,23 +1018,18 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
null /* rawSuggestions */, false /* typedWordValid */, false /* willAutoCorrect */,
|
null /* rawSuggestions */, false /* typedWordValid */, false /* willAutoCorrect */,
|
||||||
false /* isObsoleteSuggestions */, false /* isPrediction */);
|
false /* isObsoleteSuggestions */, false /* isPrediction */);
|
||||||
// When in fullscreen mode, show completions generated by the application forcibly
|
// When in fullscreen mode, show completions generated by the application forcibly
|
||||||
setSuggestedWords(suggestedWords, true /* isSuggestionStripVisible */,
|
setSuggestedWords(suggestedWords, true /* isSuggestionStripVisible */);
|
||||||
true /* needsInputViewShown */);
|
|
||||||
if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
|
if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
|
||||||
ResearchLogger.latinIME_onDisplayCompletions(applicationSpecifiedCompletions);
|
ResearchLogger.latinIME_onDisplayCompletions(applicationSpecifiedCompletions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setSuggestionStripShownInternal(final boolean isSuggestionStripVisible,
|
private void setSuggestionStripShownInternal(final boolean isSuggestionStripVisible) {
|
||||||
final boolean needsInputViewShown) {
|
|
||||||
// TODO: Modify this if we support suggestions with hard keyboard
|
// TODO: Modify this if we support suggestions with hard keyboard
|
||||||
if (!onEvaluateInputViewShown() || !hasSuggestionStripView()) {
|
if (!onEvaluateInputViewShown() || !hasSuggestionStripView()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final boolean inputViewShown = mKeyboardSwitcher.isShowingMainKeyboardOrEmojiPalettes();
|
if (isSuggestionStripVisible) {
|
||||||
final boolean shouldShowSuggestions = isSuggestionStripVisible
|
|
||||||
&& (needsInputViewShown ? inputViewShown : true);
|
|
||||||
if (shouldShowSuggestions) {
|
|
||||||
mSuggestionStripView.setVisibility(View.VISIBLE);
|
mSuggestionStripView.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
mSuggestionStripView.setVisibility(isFullscreenMode() ? View.GONE : View.INVISIBLE);
|
mSuggestionStripView.setVisibility(isFullscreenMode() ? View.GONE : View.INVISIBLE);
|
||||||
|
@ -1366,7 +1361,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
|
|
||||||
// TODO[IL]: Define a clear interface for this
|
// TODO[IL]: Define a clear interface for this
|
||||||
public void setSuggestedWords(final SuggestedWords suggestedWords,
|
public void setSuggestedWords(final SuggestedWords suggestedWords,
|
||||||
final boolean isSuggestionStripVisible, final boolean needsInputViewShown) {
|
final boolean isSuggestionStripVisible) {
|
||||||
mInputLogic.setSuggestedWords(suggestedWords);
|
mInputLogic.setSuggestedWords(suggestedWords);
|
||||||
if (!hasSuggestionStripView()) {
|
if (!hasSuggestionStripView()) {
|
||||||
return;
|
return;
|
||||||
|
@ -1386,7 +1381,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
SubtypeLocaleUtils.isRtlLanguage(mSubtypeSwitcher.getCurrentSubtype()));
|
SubtypeLocaleUtils.isRtlLanguage(mSubtypeSwitcher.getCurrentSubtype()));
|
||||||
}
|
}
|
||||||
mKeyboardSwitcher.onAutoCorrectionStateChanged(suggestedWords.mWillAutoCorrect);
|
mKeyboardSwitcher.onAutoCorrectionStateChanged(suggestedWords.mWillAutoCorrect);
|
||||||
setSuggestionStripShownInternal(isSuggestionStripVisible, needsInputViewShown);
|
setSuggestionStripShownInternal(isSuggestionStripVisible);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO[IL]: Move this out of LatinIME.
|
// TODO[IL]: Move this out of LatinIME.
|
||||||
|
@ -1472,8 +1467,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
setNeutralSuggestionStrip();
|
setNeutralSuggestionStrip();
|
||||||
} else {
|
} else {
|
||||||
mInputLogic.mWordComposer.setAutoCorrection(autoCorrection);
|
mInputLogic.mWordComposer.setAutoCorrection(autoCorrection);
|
||||||
setSuggestedWords(
|
setSuggestedWords(suggestedWords, isSuggestionStripVisible());
|
||||||
suggestedWords, isSuggestionStripVisible(), true /* needsInputViewShown */);
|
|
||||||
}
|
}
|
||||||
// Cache the auto-correction in accessibility code so we can speak it if the user
|
// Cache the auto-correction in accessibility code so we can speak it if the user
|
||||||
// touches a key that will insert it.
|
// touches a key that will insert it.
|
||||||
|
@ -1502,14 +1496,14 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
// punctuation suggestions (if it's disabled).
|
// punctuation suggestions (if it's disabled).
|
||||||
@Override
|
@Override
|
||||||
public void setNeutralSuggestionStrip() {
|
public void setNeutralSuggestionStrip() {
|
||||||
setNeutralSuggestionStripInternal(true /* needsInputViewShown */);
|
setNeutralSuggestionStripInternal();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setNeutralSuggestionStripInternal(final boolean needsInputViewShown) {
|
private void setNeutralSuggestionStripInternal() {
|
||||||
final SettingsValues currentSettings = mSettings.getCurrent();
|
final SettingsValues currentSettings = mSettings.getCurrent();
|
||||||
final SuggestedWords neutralSuggestions = currentSettings.mBigramPredictionEnabled
|
final SuggestedWords neutralSuggestions = currentSettings.mBigramPredictionEnabled
|
||||||
? SuggestedWords.EMPTY : currentSettings.mSpacingAndPunctuations.mSuggestPuncList;
|
? SuggestedWords.EMPTY : currentSettings.mSpacingAndPunctuations.mSuggestPuncList;
|
||||||
setSuggestedWords(neutralSuggestions, isSuggestionStripVisible(), needsInputViewShown);
|
setSuggestedWords(neutralSuggestions, isSuggestionStripVisible());
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Make this private
|
// TODO: Make this private
|
||||||
|
|
Loading…
Reference in New Issue