From ef0b0fe9eecb9ebd2d2644e326bacbed366bb8ac Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Sat, 18 Jan 2020 16:22:54 +0100 Subject: [PATCH] images: slightly rounded corners Signed-off-by: tobiasKaminsky --- .../datamodel/ThumbnailsCacheManager.java | 7 ++++++- .../android/ui/adapter/OCFileListAdapter.java | 9 +++++++- .../owncloud/android/utils/BitmapUtils.java | 21 ++++++++++++++++++- src/main/res/values/dims.xml | 1 + 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java b/src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java index 5db9a29605..ba0fc22b05 100644 --- a/src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java +++ b/src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java @@ -508,7 +508,12 @@ public final class ThumbnailsCacheManager { tagId = String.valueOf(((TrashbinFile) mFile).getRemoteId()); } if (String.valueOf(imageView.getTag()).equals(tagId)) { - imageView.setImageBitmap(bitmap); + Resources resources = MainApp.getAppContext().getResources(); + + BitmapUtils.setRoundedBitmap(resources, + bitmap, + resources.getDimension(R.dimen.file_icon_rounded_corner_radius), + imageView); } } } diff --git a/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java b/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java index 7bf1148cc4..beeca6e63b 100644 --- a/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java +++ b/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java @@ -52,6 +52,7 @@ import com.bumptech.glide.request.target.BitmapImageViewTarget; import com.nextcloud.client.account.User; import com.nextcloud.client.account.UserAccountManager; import com.nextcloud.client.preferences.AppPreferences; +import com.owncloud.android.MainApp; import com.owncloud.android.R; import com.owncloud.android.datamodel.FileDataStorageManager; import com.owncloud.android.datamodel.OCFile; @@ -602,7 +603,13 @@ public class OCFileListAdapter extends RecyclerView.Adapter20dp 40dp 128dp + 20dp 128dp 16dp 32dp