mirror of
https://github.com/nextcloud/android.git
synced 2024-12-18 15:01:57 +03:00
prevent restoring latest fragment when rotating
This commit is contained in:
parent
9211578a55
commit
3735cec70c
2 changed files with 13 additions and 4 deletions
|
@ -93,7 +93,7 @@ public class ExtendedListFragment extends Fragment
|
|||
private static final String KEY_IS_GRID_VISIBLE = "IS_GRID_VISIBLE";
|
||||
|
||||
protected SwipeRefreshLayout mRefreshListLayout;
|
||||
private SwipeRefreshLayout mRefreshGridLayout;
|
||||
protected SwipeRefreshLayout mRefreshGridLayout;
|
||||
protected SwipeRefreshLayout mRefreshEmptyLayout;
|
||||
protected LinearLayout mEmptyListContainer;
|
||||
protected TextView mEmptyListMessage;
|
||||
|
|
|
@ -666,7 +666,9 @@ public class OCFileListFragment extends ExtendedListFragment implements OCFileLi
|
|||
public void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
outState.putParcelable(KEY_FILE, mFile);
|
||||
outState.putParcelable(KEY_CURRENT_SEARCH_TYPE, Parcels.wrap(currentSearchType));
|
||||
if (searchFragment) {
|
||||
outState.putParcelable(KEY_CURRENT_SEARCH_TYPE, Parcels.wrap(currentSearchType));
|
||||
}
|
||||
mMultiChoiceModeListener.storeStateIn(outState);
|
||||
}
|
||||
|
||||
|
@ -1242,6 +1244,9 @@ public class OCFileListFragment extends ExtendedListFragment implements OCFileLi
|
|||
setTitle(R.string.default_display_name_for_root_folder);
|
||||
}
|
||||
|
||||
getActivity().getIntent().removeExtra(OCFileListFragment.SEARCH_EVENT);
|
||||
getArguments().putParcelable(OCFileListFragment.SEARCH_EVENT, null);
|
||||
|
||||
setFabEnabled(true);
|
||||
}
|
||||
|
||||
|
@ -1468,10 +1473,14 @@ public class OCFileListFragment extends ExtendedListFragment implements OCFileLi
|
|||
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
super.onRefresh();
|
||||
|
||||
if (searchEvent != null && searchFragment) {
|
||||
onMessageEvent(searchEvent);
|
||||
|
||||
mRefreshListLayout.setRefreshing(false);
|
||||
mRefreshGridLayout.setRefreshing(false);
|
||||
mRefreshEmptyLayout.setRefreshing(false);
|
||||
} else {
|
||||
super.onRefresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue