use of com.owncloud.android.ui.adapter.LocalFileListAdapter in project android by nextcloud.
the class LocalFileListFragment method onActivityCreated.
/**
* {@inheritDoc}
*/
@Override
public void onActivityCreated(Bundle savedInstanceState) {
Log_OC.i(TAG, "onActivityCreated() start");
super.onActivityCreated(savedInstanceState);
mAdapter = new LocalFileListAdapter(mContainerActivity.isFolderPickerMode(), mContainerActivity.getInitialDirectory(), this, preferences, getActivity());
setRecyclerViewAdapter(mAdapter);
listDirectory(mContainerActivity.getInitialDirectory());
mSortButton.setOnClickListener(v -> {
FileSortOrder sortOrder = preferences.getSortOrderByType(FileSortOrder.Type.localFileListView);
openSortingOrderDialogFragment(requireFragmentManager(), sortOrder);
});
FileSortOrder sortOrder = preferences.getSortOrderByType(FileSortOrder.Type.localFileListView);
mSortButton.setText(DisplayUtils.getSortOrderStringId(sortOrder));
setGridSwitchButton();
mSwitchGridViewButton.setOnClickListener(v -> {
if (isGridEnabled()) {
switchToListView();
} else {
switchToGridView();
}
setGridSwitchButton();
});
Log_OC.i(TAG, "onActivityCreated() stop");
}
use of com.owncloud.android.ui.adapter.LocalFileListAdapter in project android by nextcloud.
the class ExtendedListFragment method performSearch.
public void performSearch(final String query, boolean isBackPressed) {
handler.removeCallbacksAndMessages(null);
RecyclerView.Adapter adapter = getRecyclerView().getAdapter();
Activity activity = getActivity();
if (activity != null) {
if (activity instanceof FileDisplayActivity) {
if (isBackPressed && TextUtils.isEmpty(query)) {
FileDisplayActivity fileDisplayActivity = (FileDisplayActivity) activity;
fileDisplayActivity.resetSearchView();
fileDisplayActivity.updateListOfFilesFragment(true);
} else {
handler.post(() -> {
if (adapter instanceof OCFileListAdapter) {
if (accountManager.getUser().getServer().getVersion().isNewerOrEqual(OwnCloudVersion.nextcloud_20)) {
((FileDisplayActivity) activity).performUnifiedSearch(query);
} else {
EventBus.getDefault().post(new SearchEvent(query, SearchRemoteOperation.SearchType.FILE_SEARCH));
}
} else if (adapter instanceof LocalFileListAdapter) {
LocalFileListAdapter localFileListAdapter = (LocalFileListAdapter) adapter;
localFileListAdapter.filter(query);
}
});
if (searchView != null) {
searchView.clearFocus();
}
}
} else if (activity instanceof UploadFilesActivity) {
LocalFileListAdapter localFileListAdapter = (LocalFileListAdapter) adapter;
localFileListAdapter.filter(query);
((UploadFilesActivity) activity).showToolbarSpinner();
} else if (activity instanceof FolderPickerActivity) {
((FolderPickerActivity) activity).refreshListOfFilesFragment(true);
}
}
}
use of com.owncloud.android.ui.adapter.LocalFileListAdapter in project android by owncloud.
the class LocalFileListFragment method onActivityCreated.
/**
* {@inheritDoc}
*/
@Override
public void onActivityCreated(Bundle savedInstanceState) {
Log_OC.i(TAG, "onActivityCreated() start");
super.onActivityCreated(savedInstanceState);
mDirectory = mContainerActivity.getCurrentFolder();
mAdapter = new LocalFileListAdapter(mDirectory, isShowingJustFolders(), getActivity());
setListAdapter(mAdapter);
Log_OC.i(TAG, "onActivityCreated() stop");
}
Aggregations