From 2740816bb85041d4d67fe242bcf0dddb5ad06116 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sun, 7 Aug 2022 19:52:58 +0200 Subject: [PATCH] Round all the things --- .../adapter/FeedDiscoverAdapter.java | 5 ++- .../antennapod/adapter/NavListAdapter.java | 5 ++- .../antennapod/fragment/ItemFragment.java | 2 +- app/src/main/res/layout/addfeed.xml | 2 +- .../res/layout/quick_feed_discovery_item.xml | 31 +++++++++---------- 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/FeedDiscoverAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/FeedDiscoverAdapter.java index 3628b4bee..5e2c091e9 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/FeedDiscoverAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/FeedDiscoverAdapter.java @@ -5,6 +5,8 @@ import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import com.bumptech.glide.Glide; +import com.bumptech.glide.load.resource.bitmap.FitCenter; +import com.bumptech.glide.load.resource.bitmap.RoundedCorners; import com.bumptech.glide.request.RequestOptions; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.MainActivity; @@ -65,7 +67,8 @@ public class FeedDiscoverAdapter extends BaseAdapter { .load(podcast.imageUrl) .apply(new RequestOptions() .placeholder(R.color.light_gray) - .fitCenter() + .transform(new FitCenter(), new RoundedCorners((int) + (8 * mainActivityRef.get().getResources().getDisplayMetrics().density))) .dontAnimate()) .into(holder.imageView); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java index 286da1e20..29f9d3e44 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java @@ -16,6 +16,8 @@ import android.view.ViewGroup; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; +import com.bumptech.glide.load.resource.bitmap.FitCenter; +import com.bumptech.glide.load.resource.bitmap.RoundedCorners; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import androidx.recyclerview.widget.RecyclerView; import com.bumptech.glide.Glide; @@ -325,7 +327,8 @@ public class NavListAdapter extends RecyclerView.Adapter .placeholder(R.color.light_gray) .error(R.color.light_gray) .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) - .fitCenter() + .transform(new FitCenter(), + new RoundedCorners((int) (4 * context.getResources().getDisplayMetrics().density))) .dontAnimate()) .into(holder.image); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java index 375356c2c..a6f1a96f7 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java @@ -296,7 +296,7 @@ public class ItemFragment extends Fragment { .error(R.color.light_gray) .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) .transform(new FitCenter(), - new RoundedCorners((int) (4 * getResources().getDisplayMetrics().density))) + new RoundedCorners((int) (8 * getResources().getDisplayMetrics().density))) .dontAnimate(); Glide.with(getActivity()) diff --git a/app/src/main/res/layout/addfeed.xml b/app/src/main/res/layout/addfeed.xml index 30c1a463d..0b6ede087 100644 --- a/app/src/main/res/layout/addfeed.xml +++ b/app/src/main/res/layout/addfeed.xml @@ -21,7 +21,7 @@ android:layout_height="wrap_content" android:layout_marginLeft="16dp" android:layout_marginRight="16dp" - app:cardCornerRadius="4dp" + app:cardCornerRadius="8dp" app:cardElevation="4dp"> + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:squareImageView="http://schemas.android.com/apk/de.danoeh.antennapod" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:padding="4dp" + android:clipToPadding="false"> + android:id="@+id/discovery_cover" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:elevation="4dp" + android:outlineProvider="background" + android:foreground="?android:attr/selectableItemBackground" + squareImageView:direction="width" + tools:src="@tools:sample/avatars" /> -