use of com.owncloud.android.ui.adapter.FileListListAdapter in project android by owncloud.
the class OCFileListFragment method updateListOfFiles.
private void updateListOfFiles(FileListOption fileListOption) {
boolean justFolders = isShowingJustFolders();
setFooterEnabled(!justFolders);
boolean folderPicker = isPickingAFolder();
mFileListAdapter = new FileListListAdapter(justFolders, fileListOption.isAvailableOffline(), fileListOption.isSharedByLink(), folderPicker, getActivity(), mContainerActivity);
setListAdapter(mFileListAdapter);
mHideFab = !fileListOption.isAllFiles() || folderPicker;
if (mHideFab) {
setFabEnabled(false);
} else {
setFabEnabled(true);
registerFabListeners();
// detect if a mini FAB has ever been clicked
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
if (prefs.getLong(KEY_FAB_EVER_CLICKED, 0) > 0) {
miniFabClicked = true;
}
// add labels to the min FABs when none of them has ever been clicked on
if (!miniFabClicked) {
setFabLabels();
} else {
removeFabLabels();
}
}
// Allow or disallow touches with other visible windows
CoordinatorLayout coordinatorLayout = requireActivity().findViewById(R.id.coordinator_layout);
coordinatorLayout.setFilterTouchesWhenObscured(PreferenceUtils.shouldDisallowTouchesWithOtherVisibleWindows(getContext()));
}
use of com.owncloud.android.ui.adapter.FileListListAdapter in project android by owncloud.
the class OCFileListFragment method onActivityCreated.
/**
* {@inheritDoc}
*/
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
Log_OC.e(TAG, "onActivityCreated() start");
if (savedInstanceState != null) {
mFile = savedInstanceState.getParcelable(KEY_FILE);
}
boolean justFolders = isShowingJustFolders();
setFooterEnabled(!justFolders);
mAdapter = new FileListListAdapter(justFolders, getActivity(), mContainerActivity);
setListAdapter(mAdapter);
Bundle args = getArguments();
mHideFab = (args != null) && args.getBoolean(ARG_HIDE_FAB, false);
if (mHideFab) {
setFabEnabled(false);
} else {
setFabEnabled(true);
registerFabListeners();
// detect if a mini FAB has ever been clicked
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
if (prefs.getLong(KEY_FAB_EVER_CLICKED, 0) > 0) {
miniFabClicked = true;
}
// add labels to the min FABs when none of them has ever been clicked on
if (!miniFabClicked) {
setFabLabels();
} else {
removeFabLabels();
}
}
}
Aggregations