mirror of
https://github.com/nextcloud/android.git
synced 2024-12-22 08:44:34 +03:00
shouldShowRecommendedFiles
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
b611e8761e
commit
adec18f337
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);
|
PreviewTextFragment.setText(headerViewHolder.getHeaderText(), text, null, activity, true, true, viewThemeUtils);
|
||||||
headerViewHolder.getHeaderView().setOnClickListener(v -> ocFileListFragmentInterface.onHeaderClicked());
|
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 var recommendedFilesRecyclerView = headerViewHolder.getBinding().recommendedFilesRecyclerView;
|
||||||
|
|
||||||
final LinearLayoutManager layoutManager = new LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false);
|
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) {
|
private void checkVisibilityOfFileFeaturesLayout(ListViewHolder holder) {
|
||||||
int fileFeaturesVisibility = View.GONE;
|
int fileFeaturesVisibility = View.GONE;
|
||||||
LinearLayout fileFeaturesLayout = holder.getFileFeaturesLayout();
|
LinearLayout fileFeaturesLayout = holder.getFileFeaturesLayout();
|
||||||
|
@ -781,7 +785,7 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!recommendedFiles.isEmpty() && currentDirectory.isRootDirectory()) {
|
if (shouldShowRecommendedFiles()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue