mirror of
https://github.com/nextcloud/android.git
synced 2024-11-21 20:55:31 +03:00
Do not show meta info (favorite, download status) in media view
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
256656af5d
commit
e17beb00ad
3 changed files with 33 additions and 24 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue