Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2cb36637 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Back button to dismiss the more suggestions

Bug: 5275063
Change-Id: If31e9a25d827f44c8d4ff455a780ec2a6d2d9bef
parent a08a7e99
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.text.InputType;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.PrintWriterPrinter;
import android.util.Printer;
@@ -1011,8 +1010,12 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        switch (keyCode) {
        case KeyEvent.KEYCODE_BACK:
            if (event.getRepeatCount() == 0 && mKeyboardSwitcher.getKeyboardView() != null) {
                if (mKeyboardSwitcher.getKeyboardView().handleBack()) {
            if (event.getRepeatCount() == 0) {
                if (mSuggestionsView != null && mSuggestionsView.handleBack()) {
                    return true;
                }
                final LatinKeyboardView keyboardView = mKeyboardSwitcher.getKeyboardView();
                if (keyboardView != null && keyboardView.handleBack()) {
                    return true;
                }
            }
+4 −0
Original line number Diff line number Diff line
@@ -728,6 +728,10 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener,
        return false;
    }

    public boolean handleBack() {
        return dismissMoreSuggestions();
    }

    @Override
    public boolean onLongClick(View view) {
        final SuggestionsViewParams params = mParams;