mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-19 21:39:18 +00:00
Hide keyboard on scroll when search field is focused
This commit is contained in:
parent
2864f9b30c
commit
c1ffe4a23e
1 changed files with 12 additions and 0 deletions
|
@ -23,6 +23,7 @@ import android.view.Menu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
@ -34,6 +35,8 @@ import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.appcompat.view.ActionMode;
|
import androidx.appcompat.view.ActionMode;
|
||||||
import androidx.appcompat.widget.SearchView;
|
import androidx.appcompat.widget.SearchView;
|
||||||
|
import androidx.core.view.ViewCompat;
|
||||||
|
import androidx.core.view.WindowInsetsCompat;
|
||||||
|
|
||||||
import com.beemdevelopment.aegis.AccountNamePosition;
|
import com.beemdevelopment.aegis.AccountNamePosition;
|
||||||
import com.beemdevelopment.aegis.CopyBehavior;
|
import com.beemdevelopment.aegis.CopyBehavior;
|
||||||
|
@ -285,6 +288,15 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
||||||
@Override
|
@Override
|
||||||
public void onEntryListTouch() {
|
public void onEntryListTouch() {
|
||||||
_isDPadPressed = false;
|
_isDPadPressed = false;
|
||||||
|
|
||||||
|
if (_searchView != null && !_searchView.isIconified()) {
|
||||||
|
if (ViewCompat.getRootWindowInsets(findViewById(android.R.id.content).getRootView()).isVisible(WindowInsetsCompat.Type.ime())) {
|
||||||
|
InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
|
if (inputMethodManager != null && getCurrentFocus() != null) {
|
||||||
|
inputMethodManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onPreferencesResult(Intent data) {
|
private void onPreferencesResult(Intent data) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue