use of com.owncloud.android.ui.activity.FileDisplayActivity in project android by nextcloud.
the class OCFileListFragment method onActivityCreated.
/**
* {@inheritDoc}
*/
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
Log_OC.i(TAG, "onActivityCreated() start");
if (savedInstanceState != null) {
mFile = savedInstanceState.getParcelable(KEY_FILE);
}
Bundle args = getArguments();
mOnlyFoldersClickable = args != null && args.getBoolean(ARG_ONLY_FOLDERS_CLICKABLE, false);
mFileSelectable = args != null && args.getBoolean(ARG_FILE_SELECTABLE, false);
mLimitToMimeType = args != null ? args.getString(ARG_MIMETYPE, "") : "";
boolean hideItemOptions = args != null && args.getBoolean(ARG_HIDE_ITEM_OPTIONS, false);
mAdapter = new OCFileListAdapter(getActivity(), accountManager.getUser(), preferences, mContainerActivity, this, hideItemOptions, isGridViewPreferred(mFile));
setRecyclerViewAdapter(mAdapter);
mHideFab = args != null && args.getBoolean(ARG_HIDE_FAB, false);
if (mHideFab) {
setFabVisible(false);
} else {
setFabVisible(true);
registerFabListener();
}
if (!searchFragment) {
// do not touch search event if previously searched
if (getArguments() == null) {
searchEvent = null;
} else {
searchEvent = getArguments().getParcelable(OCFileListFragment.SEARCH_EVENT);
}
}
prepareCurrentSearch(searchEvent);
if (mSortButton != null) {
mSortButton.setOnClickListener(v -> openSortingOrderDialogFragment(requireFragmentManager(), preferences.getSortOrderByFolder(mFile)));
}
if (mSwitchGridViewButton != null) {
mSwitchGridViewButton.setOnClickListener(v -> {
if (isGridEnabled()) {
setListAsPreferred();
} else {
setGridAsPreferred();
}
setGridSwitchButton();
});
}
setTitle();
FragmentActivity fragmentActivity;
if ((fragmentActivity = getActivity()) != null && fragmentActivity instanceof FileDisplayActivity) {
FileDisplayActivity fileDisplayActivity = (FileDisplayActivity) fragmentActivity;
fileDisplayActivity.updateActionBarTitleAndHomeButton(fileDisplayActivity.getCurrentDir());
}
listDirectory(false, false);
}
Aggregations