mirror of
https://github.com/nextcloud/android.git
synced 2024-11-25 22:55:46 +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 onlyOnDevice;
|
||||||
private boolean showShareAvatar = false;
|
private boolean showShareAvatar = false;
|
||||||
private OCFile highlightedItem;
|
private OCFile highlightedItem;
|
||||||
|
private boolean showMetadata = true;
|
||||||
|
|
||||||
public OCFileListAdapter(
|
public OCFileListAdapter(
|
||||||
Activity activity,
|
Activity activity,
|
||||||
|
@ -469,36 +470,38 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||||
|
|
||||||
gridViewHolder.getLocalFileIndicator().setVisibility(View.INVISIBLE); // default first
|
gridViewHolder.getLocalFileIndicator().setVisibility(View.INVISIBLE); // default first
|
||||||
|
|
||||||
OperationsService.OperationsServiceBinder operationsServiceBinder = transferServiceGetter.getOperationsServiceBinder();
|
if (showMetadata) {
|
||||||
FileDownloader.FileDownloaderBinder fileDownloaderBinder = transferServiceGetter.getFileDownloaderBinder();
|
OperationsService.OperationsServiceBinder operationsServiceBinder = transferServiceGetter.getOperationsServiceBinder();
|
||||||
FileUploader.FileUploaderBinder fileUploaderBinder = transferServiceGetter.getFileUploaderBinder();
|
FileDownloader.FileDownloaderBinder fileDownloaderBinder = transferServiceGetter.getFileDownloaderBinder();
|
||||||
if (operationsServiceBinder != null && operationsServiceBinder.isSynchronizing(user, file)) {
|
FileUploader.FileUploaderBinder fileUploaderBinder = transferServiceGetter.getFileUploaderBinder();
|
||||||
//synchronizing
|
if (operationsServiceBinder != null && operationsServiceBinder.isSynchronizing(user, file)) {
|
||||||
gridViewHolder.getLocalFileIndicator().setImageResource(R.drawable.ic_synchronizing);
|
//synchronizing
|
||||||
gridViewHolder.getLocalFileIndicator().setVisibility(View.VISIBLE);
|
gridViewHolder.getLocalFileIndicator().setImageResource(R.drawable.ic_synchronizing);
|
||||||
|
gridViewHolder.getLocalFileIndicator().setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
} else if (fileDownloaderBinder != null && fileDownloaderBinder.isDownloading(user, file)) {
|
} else if (fileDownloaderBinder != null && fileDownloaderBinder.isDownloading(user, file)) {
|
||||||
// downloading
|
// downloading
|
||||||
gridViewHolder.getLocalFileIndicator().setImageResource(R.drawable.ic_synchronizing);
|
gridViewHolder.getLocalFileIndicator().setImageResource(R.drawable.ic_synchronizing);
|
||||||
gridViewHolder.getLocalFileIndicator().setVisibility(View.VISIBLE);
|
gridViewHolder.getLocalFileIndicator().setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
} else if (fileUploaderBinder != null && fileUploaderBinder.isUploading(user, file)) {
|
} else if (fileUploaderBinder != null && fileUploaderBinder.isUploading(user, file)) {
|
||||||
//uploading
|
//uploading
|
||||||
gridViewHolder.getLocalFileIndicator().setImageResource(R.drawable.ic_synchronizing);
|
gridViewHolder.getLocalFileIndicator().setImageResource(R.drawable.ic_synchronizing);
|
||||||
gridViewHolder.getLocalFileIndicator().setVisibility(View.VISIBLE);
|
gridViewHolder.getLocalFileIndicator().setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
} else if (file.getEtagInConflict() != null) {
|
} else if (file.getEtagInConflict() != null) {
|
||||||
// conflict
|
// conflict
|
||||||
gridViewHolder.getLocalFileIndicator().setImageResource(R.drawable.ic_synchronizing_error);
|
gridViewHolder.getLocalFileIndicator().setImageResource(R.drawable.ic_synchronizing_error);
|
||||||
gridViewHolder.getLocalFileIndicator().setVisibility(View.VISIBLE);
|
gridViewHolder.getLocalFileIndicator().setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
} else if (file.isDown()) {
|
} else if (file.isDown()) {
|
||||||
gridViewHolder.getLocalFileIndicator().setImageResource(R.drawable.ic_synced);
|
gridViewHolder.getLocalFileIndicator().setImageResource(R.drawable.ic_synced);
|
||||||
gridViewHolder.getLocalFileIndicator().setVisibility(View.VISIBLE);
|
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) {
|
if (multiSelect) {
|
||||||
gridViewHolder.getCheckbox().setVisibility(View.VISIBLE);
|
gridViewHolder.getCheckbox().setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1202,6 +1205,10 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||||
gridView = bool;
|
gridView = bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setShowMetadata(boolean bool) {
|
||||||
|
showMetadata = bool;
|
||||||
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
public void setShowShareAvatar(boolean bool) {
|
public void setShowShareAvatar(boolean bool) {
|
||||||
showShareAvatar = bool;
|
showShareAvatar = bool;
|
||||||
|
|
|
@ -84,6 +84,7 @@ public class GalleryFragment extends OCFileListFragment {
|
||||||
@Override
|
@Override
|
||||||
public void onActivityCreated(Bundle savedInstanceState) {
|
public void onActivityCreated(Bundle savedInstanceState) {
|
||||||
super.onActivityCreated(savedInstanceState);
|
super.onActivityCreated(savedInstanceState);
|
||||||
|
mAdapter.setShowMetadata(false);
|
||||||
|
|
||||||
currentSearchType = SearchType.GALLERY_SEARCH;
|
currentSearchType = SearchType.GALLERY_SEARCH;
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@
|
||||||
android:layout_gravity="top|end"
|
android:layout_gravity="top|end"
|
||||||
android:layout_margin="@dimen/standard_quarter_margin"
|
android:layout_margin="@dimen/standard_quarter_margin"
|
||||||
android:contentDescription="@string/favorite_icon"
|
android:contentDescription="@string/favorite_icon"
|
||||||
|
android:visibility="gone"
|
||||||
android:src="@drawable/favorite" />
|
android:src="@drawable/favorite" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
|
Loading…
Reference in a new issue