Skip to content
Snippets Groups Projects
Commit 61c726f5 authored by Ken Wakasa's avatar Ken Wakasa Committed by Android (Google) Code Review
Browse files

Merge "Dismiss more keys keyboard before statring more suggestionsview to show"

parents 8df48944 56e0373b
No related branches found
No related tags found
No related merge requests found
...@@ -31,12 +31,14 @@ public interface MoreKeysPanel { ...@@ -31,12 +31,14 @@ public interface MoreKeysPanel {
* Remove the current {@link MoreKeysPanel} from the target view. * Remove the current {@link MoreKeysPanel} from the target view.
* @param panel the panel to be dismissed. * @param panel the panel to be dismissed.
*/ */
// TODO: Remove unused {@link MoreKeysPanel} argument.
public void onDismissMoreKeysPanel(final MoreKeysPanel panel); public void onDismissMoreKeysPanel(final MoreKeysPanel panel);
/** /**
* Instructs the parent to cancel the panel (e.g., when entering a different input mode). * Instructs the parent to cancel the panel (e.g., when entering a different input mode).
* @param panel the panel to be canceled. * @param panel the panel to be canceled.
*/ */
// TODO: Remove unused {@link MoreKeysPanel} argument.
public void onCancelMoreKeysPanel(final MoreKeysPanel panel); public void onCancelMoreKeysPanel(final MoreKeysPanel panel);
} }
......
...@@ -35,7 +35,6 @@ import android.widget.RelativeLayout; ...@@ -35,7 +35,6 @@ import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.Keyboard;
import com.android.inputmethod.keyboard.KeyboardSwitcher;
import com.android.inputmethod.keyboard.MainKeyboardView; import com.android.inputmethod.keyboard.MainKeyboardView;
import com.android.inputmethod.keyboard.MoreKeysPanel; import com.android.inputmethod.keyboard.MoreKeysPanel;
import com.android.inputmethod.latin.AudioAndHapticFeedbackManager; import com.android.inputmethod.latin.AudioAndHapticFeedbackManager;
...@@ -312,7 +311,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick ...@@ -312,7 +311,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
} }
boolean showMoreSuggestions() { boolean showMoreSuggestions() {
final Keyboard parentKeyboard = KeyboardSwitcher.getInstance().getKeyboard(); final Keyboard parentKeyboard = mMainKeyboardView.getKeyboard();
if (parentKeyboard == null) { if (parentKeyboard == null) {
return false; return false;
} }
...@@ -320,6 +319,10 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick ...@@ -320,6 +319,10 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
if (!layoutHelper.mMoreSuggestionsAvailable) { if (!layoutHelper.mMoreSuggestionsAvailable) {
return false; return false;
} }
// Dismiss another {@link MoreKeysPanel} that may be being showed, for example
// {@link MoreKeysKeyboardView}.
// TODO: Remove unused null argument.
mMainKeyboardView.onDismissMoreKeysPanel(null /* unused */);
final int stripWidth = getWidth(); final int stripWidth = getWidth();
final View container = mMoreSuggestionsContainer; final View container = mMoreSuggestionsContainer;
final int maxWidth = stripWidth - container.getPaddingLeft() - container.getPaddingRight(); final int maxWidth = stripWidth - container.getPaddingLeft() - container.getPaddingRight();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment