mirror of
https://github.com/nextcloud/android.git
synced 2024-11-22 21:25:35 +03:00
Cleaned a bit the code + Fixed cross display bug
This commit is contained in:
parent
938e4a6f44
commit
579140b7c4
2 changed files with 13 additions and 20 deletions
|
@ -790,13 +790,10 @@ public class FileDisplayActivity extends FileActivity
|
|||
|
||||
//focus the SearchView
|
||||
if (!TextUtils.isEmpty(searchQuery)) {
|
||||
searchView.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
searchView.setIconified(false);
|
||||
searchView.setQuery(searchQuery, true);
|
||||
searchView.clearFocus();
|
||||
}
|
||||
searchView.post(() -> {
|
||||
searchView.setIconified(false);
|
||||
searchView.setQuery(searchQuery, true);
|
||||
searchView.clearFocus();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -815,12 +812,7 @@ public class FileDisplayActivity extends FileActivity
|
|||
getListOfFilesFragment().refreshDirectory();
|
||||
}
|
||||
} else {
|
||||
searchView.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
searchView.setQuery("", true);
|
||||
}
|
||||
});
|
||||
searchView.post(() -> searchView.setQuery("", true));
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
|
|
@ -219,23 +219,26 @@ public class ExtendedListFragment extends Fragment implements
|
|||
}
|
||||
}
|
||||
|
||||
searchView.setOnQueryTextFocusChangeListener((v, hasFocus) -> handler.postDelayed(() -> {
|
||||
searchView.setOnQueryTextFocusChangeListener((v, hasFocus) -> handler.post(() -> {
|
||||
if (getActivity() != null && !(getActivity() instanceof FolderPickerActivity)
|
||||
&& !(getActivity() instanceof UploadFilesActivity)) {
|
||||
setFabVisible(!hasFocus);
|
||||
if (TextUtils.isEmpty(searchView.getQuery())) {
|
||||
closeButton.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
}, 100));
|
||||
}));
|
||||
|
||||
closeButton.setOnClickListener(view -> {
|
||||
searchView.setQuery("", true);
|
||||
searchView.requestFocus();
|
||||
searchView.onActionViewExpanded();
|
||||
theTextArea.requestFocus();
|
||||
|
||||
InputMethodManager inputMethodManager =
|
||||
(InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
|
||||
if (inputMethodManager != null) {
|
||||
inputMethodManager.showSoftInput(searchView, InputMethodManager.SHOW_FORCED);
|
||||
inputMethodManager.showSoftInput(searchView, InputMethodManager.SHOW_IMPLICIT);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -282,11 +285,9 @@ public class ExtendedListFragment extends Fragment implements
|
|||
public boolean onQueryTextChange(final String query) {
|
||||
// After 300 ms, set the query
|
||||
|
||||
|
||||
closeButton.setVisibility(View.VISIBLE);
|
||||
if (query.isEmpty()) {
|
||||
closeButton.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
closeButton.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (getFragmentManager() != null && getFragmentManager().
|
||||
|
|
Loading…
Reference in a new issue