mirror of
https://github.com/nextcloud/android.git
synced 2024-12-21 16:24:32 +03:00
shouldShowRecommendedFiles
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
e605eadae2
commit
e4375eb36f
1 changed files with 7 additions and 3 deletions
|
@ -439,9 +439,9 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
|||
PreviewTextFragment.setText(headerViewHolder.getHeaderText(), text, null, activity, true, true, viewThemeUtils);
|
||||
headerViewHolder.getHeaderView().setOnClickListener(v -> ocFileListFragmentInterface.onHeaderClicked());
|
||||
|
||||
ViewExtensionsKt.setVisibleIf(headerViewHolder.getBinding().recommendedFilesLayout, !recommendedFiles.isEmpty());
|
||||
ViewExtensionsKt.setVisibleIf(headerViewHolder.getBinding().recommendedFilesLayout, shouldShowRecommendedFiles());
|
||||
|
||||
if (!recommendedFiles.isEmpty()) {
|
||||
if (shouldShowRecommendedFiles()) {
|
||||
final var recommendedFilesRecyclerView = headerViewHolder.getBinding().recommendedFilesRecyclerView;
|
||||
|
||||
final LinearLayoutManager layoutManager = new LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false);
|
||||
|
@ -481,6 +481,10 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
|||
}
|
||||
}
|
||||
|
||||
private boolean shouldShowRecommendedFiles() {
|
||||
return !recommendedFiles.isEmpty() && currentDirectory.isRootDirectory();
|
||||
}
|
||||
|
||||
private void checkVisibilityOfFileFeaturesLayout(ListViewHolder holder) {
|
||||
int fileFeaturesVisibility = View.GONE;
|
||||
LinearLayout fileFeaturesLayout = holder.getFileFeaturesLayout();
|
||||
|
@ -781,7 +785,7 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!recommendedFiles.isEmpty() && currentDirectory.isRootDirectory()) {
|
||||
if (shouldShowRecommendedFiles()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue