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

Commit d259782b authored by kaiyiz's avatar kaiyiz Committed by Gerrit - the friendly Code Review server
Browse files

When mInputText isn't on focus, hide the soft keyboard

Flash english keyboard quickly when press selected the
number of the date of each month in data usage

Change-Id: I0d2cbde1a72a575b009a2d84d2e020ad101ce5a3
parent b75ec21b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2008 The Android Open Source Project
 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
 *
 * Not a Contribution. Apache license notifications and license are retained
 * for attribution purposes only.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -680,6 +684,11 @@ public class NumberPicker extends LinearLayout {
                } else {
                    mInputText.setSelection(0, 0);
                    validateInputTextView(v);
                    // When mInputText isn't on focus ,hide the soft input.
                    InputMethodManager inputMethodManager = InputMethodManager.peekInstance();
                    if (inputMethodManager != null && inputMethodManager.isActive(mInputText)) {
                        inputMethodManager.hideSoftInputFromWindow(getWindowToken(), 0);
                    }
                }
            }
        });