mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 05:35:39 +03:00
ExtendedListFragment: Remove ViewTreeObserver on search frame
This was incorrectly setting empty message when switching search types. And it makes no sense: search is only executed when submitted. Signed-off-by: Álvaro Brey Vilas <alvaro.brey@nextcloud.com>
This commit is contained in:
parent
e8e18609e5
commit
0af297735c
1 changed files with 0 additions and 32 deletions
|
@ -235,38 +235,6 @@ public class ExtendedListFragment extends Fragment implements
|
|||
}
|
||||
});
|
||||
|
||||
final View mSearchEditFrame = searchView
|
||||
.findViewById(androidx.appcompat.R.id.search_edit_frame);
|
||||
|
||||
ViewTreeObserver vto = mSearchEditFrame.getViewTreeObserver();
|
||||
vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
int oldVisibility = -1;
|
||||
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
|
||||
int currentVisibility = mSearchEditFrame.getVisibility();
|
||||
|
||||
if (currentVisibility != oldVisibility) {
|
||||
if (currentVisibility == View.VISIBLE) {
|
||||
setEmptyListMessage(SearchType.REGULAR_FILTER);
|
||||
} else {
|
||||
if (MainApp.isOnlyOnDevice()) {
|
||||
setMessageForEmptyList(R.string.file_list_empty_headline,
|
||||
R.string.file_list_empty_on_device,
|
||||
R.drawable.ic_list_empty_folder,
|
||||
true);
|
||||
} else {
|
||||
setEmptyListMessage(SearchType.NO_SEARCH);
|
||||
}
|
||||
}
|
||||
|
||||
oldVisibility = currentVisibility;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
LinearLayout searchBar = searchView.findViewById(R.id.search_bar);
|
||||
searchBar.setLayoutTransition(new LayoutTransition());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue