Round all the things

This commit is contained in:
ByteHamster 2022-08-07 19:52:58 +02:00
parent a524b81060
commit 2740816bb8
5 changed files with 25 additions and 20 deletions

View File

@ -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);

View File

@ -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<NavListAdapter.Holder>
.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);

View File

@ -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())

View File

@ -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">
<LinearLayout

View File

@ -1,22 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
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">
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">
<de.danoeh.antennapod.ui.common.SquareImageView
android:id="@+id/discovery_cover"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="4dp"
android:outlineProvider="bounds"
android:foreground="?android:attr/selectableItemBackground"
squareImageView:direction="width"
tools:src="@android:drawable/sym_def_app_icon"/>
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" />
</LinearLayout>