Do not show meta info (favorite, download status) in media view

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2022-02-10 15:42:27 +01:00
parent 256656af5d
commit e17beb00ad
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7
3 changed files with 33 additions and 24 deletions

View file

@ -137,6 +137,7 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
private boolean onlyOnDevice;
private boolean showShareAvatar = false;
private OCFile highlightedItem;
private boolean showMetadata = true;
public OCFileListAdapter(
Activity activity,
@ -469,36 +470,38 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
gridViewHolder.getLocalFileIndicator().setVisibility(View.INVISIBLE); // default first
OperationsService.OperationsServiceBinder operationsServiceBinder = transferServiceGetter.getOperationsServiceBinder();
FileDownloader.FileDownloaderBinder fileDownloaderBinder = transferServiceGetter.getFileDownloaderBinder();
FileUploader.FileUploaderBinder fileUploaderBinder = transferServiceGetter.getFileUploaderBinder();
if (operationsServiceBinder != null && operationsServiceBinder.isSynchronizing(user, file)) {
//synchronizing
gridViewHolder.getLocalFileIndicator().setImageResource(R.drawable.ic_synchronizing);
gridViewHolder.getLocalFileIndicator().setVisibility(View.VISIBLE);
if (showMetadata) {
OperationsService.OperationsServiceBinder operationsServiceBinder = transferServiceGetter.getOperationsServiceBinder();
FileDownloader.FileDownloaderBinder fileDownloaderBinder = transferServiceGetter.getFileDownloaderBinder();
FileUploader.FileUploaderBinder fileUploaderBinder = transferServiceGetter.getFileUploaderBinder();
if (operationsServiceBinder != null && operationsServiceBinder.isSynchronizing(user, file)) {
//synchronizing
gridViewHolder.getLocalFileIndicator().setImageResource(R.drawable.ic_synchronizing);
gridViewHolder.getLocalFileIndicator().setVisibility(View.VISIBLE);
} else if (fileDownloaderBinder != null && fileDownloaderBinder.isDownloading(user, file)) {
// downloading
gridViewHolder.getLocalFileIndicator().setImageResource(R.drawable.ic_synchronizing);
gridViewHolder.getLocalFileIndicator().setVisibility(View.VISIBLE);
} else if (fileDownloaderBinder != null && fileDownloaderBinder.isDownloading(user, file)) {
// downloading
gridViewHolder.getLocalFileIndicator().setImageResource(R.drawable.ic_synchronizing);
gridViewHolder.getLocalFileIndicator().setVisibility(View.VISIBLE);
} else if (fileUploaderBinder != null && fileUploaderBinder.isUploading(user, file)) {
//uploading
gridViewHolder.getLocalFileIndicator().setImageResource(R.drawable.ic_synchronizing);
gridViewHolder.getLocalFileIndicator().setVisibility(View.VISIBLE);
} else if (fileUploaderBinder != null && fileUploaderBinder.isUploading(user, file)) {
//uploading
gridViewHolder.getLocalFileIndicator().setImageResource(R.drawable.ic_synchronizing);
gridViewHolder.getLocalFileIndicator().setVisibility(View.VISIBLE);
} else if (file.getEtagInConflict() != null) {
// conflict
gridViewHolder.getLocalFileIndicator().setImageResource(R.drawable.ic_synchronizing_error);
gridViewHolder.getLocalFileIndicator().setVisibility(View.VISIBLE);
} else if (file.getEtagInConflict() != null) {
// conflict
gridViewHolder.getLocalFileIndicator().setImageResource(R.drawable.ic_synchronizing_error);
gridViewHolder.getLocalFileIndicator().setVisibility(View.VISIBLE);
} else if (file.isDown()) {
gridViewHolder.getLocalFileIndicator().setImageResource(R.drawable.ic_synced);
gridViewHolder.getLocalFileIndicator().setVisibility(View.VISIBLE);
} else if (file.isDown()) {
gridViewHolder.getLocalFileIndicator().setImageResource(R.drawable.ic_synced);
gridViewHolder.getLocalFileIndicator().setVisibility(View.VISIBLE);
}
gridViewHolder.getFavorite().setVisibility(file.isFavorite() ? View.VISIBLE : View.GONE);
}
gridViewHolder.getFavorite().setVisibility(file.isFavorite() ? View.VISIBLE : View.GONE);
if (multiSelect) {
gridViewHolder.getCheckbox().setVisibility(View.VISIBLE);
} else {
@ -1202,6 +1205,10 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
gridView = bool;
}
public void setShowMetadata(boolean bool) {
showMetadata = bool;
}
@VisibleForTesting
public void setShowShareAvatar(boolean bool) {
showShareAvatar = bool;

View file

@ -84,6 +84,7 @@ public class GalleryFragment extends OCFileListFragment {
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
mAdapter.setShowMetadata(false);
currentSearchType = SearchType.GALLERY_SEARCH;

View file

@ -52,6 +52,7 @@
android:layout_gravity="top|end"
android:layout_margin="@dimen/standard_quarter_margin"
android:contentDescription="@string/favorite_icon"
android:visibility="gone"
android:src="@drawable/favorite" />
<ImageView