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.BaseAdapter;
import android.widget.ImageView; import android.widget.ImageView;
import com.bumptech.glide.Glide; 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 com.bumptech.glide.request.RequestOptions;
import de.danoeh.antennapod.R; import de.danoeh.antennapod.R;
import de.danoeh.antennapod.activity.MainActivity; import de.danoeh.antennapod.activity.MainActivity;
@ -65,7 +67,8 @@ public class FeedDiscoverAdapter extends BaseAdapter {
.load(podcast.imageUrl) .load(podcast.imageUrl)
.apply(new RequestOptions() .apply(new RequestOptions()
.placeholder(R.color.light_gray) .placeholder(R.color.light_gray)
.fitCenter() .transform(new FitCenter(), new RoundedCorners((int)
(8 * mainActivityRef.get().getResources().getDisplayMetrics().density)))
.dontAnimate()) .dontAnimate())
.into(holder.imageView); .into(holder.imageView);

View File

@ -16,6 +16,8 @@ import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; 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 com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
@ -325,7 +327,8 @@ public class NavListAdapter extends RecyclerView.Adapter<NavListAdapter.Holder>
.placeholder(R.color.light_gray) .placeholder(R.color.light_gray)
.error(R.color.light_gray) .error(R.color.light_gray)
.diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY)
.fitCenter() .transform(new FitCenter(),
new RoundedCorners((int) (4 * context.getResources().getDisplayMetrics().density)))
.dontAnimate()) .dontAnimate())
.into(holder.image); .into(holder.image);

View File

@ -296,7 +296,7 @@ public class ItemFragment extends Fragment {
.error(R.color.light_gray) .error(R.color.light_gray)
.diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY)
.transform(new FitCenter(), .transform(new FitCenter(),
new RoundedCorners((int) (4 * getResources().getDisplayMetrics().density))) new RoundedCorners((int) (8 * getResources().getDisplayMetrics().density)))
.dontAnimate(); .dontAnimate();
Glide.with(getActivity()) Glide.with(getActivity())

View File

@ -21,7 +21,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="16dp" android:layout_marginLeft="16dp"
android:layout_marginRight="16dp" android:layout_marginRight="16dp"
app:cardCornerRadius="4dp" app:cardCornerRadius="8dp"
app:cardElevation="4dp"> app:cardElevation="4dp">
<LinearLayout <LinearLayout

View File

@ -1,22 +1,21 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:squareImageView="http://schemas.android.com/apk/de.danoeh.antennapod" xmlns:squareImageView="http://schemas.android.com/apk/de.danoeh.antennapod"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:padding="4dp" android:padding="4dp"
android:clipToPadding="false"> android:clipToPadding="false">
<de.danoeh.antennapod.ui.common.SquareImageView <de.danoeh.antennapod.ui.common.SquareImageView
android:id="@+id/discovery_cover" android:id="@+id/discovery_cover"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:elevation="4dp" android:elevation="4dp"
android:outlineProvider="bounds" android:outlineProvider="background"
android:foreground="?android:attr/selectableItemBackground" android:foreground="?android:attr/selectableItemBackground"
squareImageView:direction="width" squareImageView:direction="width"
tools:src="@android:drawable/sym_def_app_icon"/> tools:src="@tools:sample/avatars" />
</LinearLayout> </LinearLayout>