Skip to content

Commit

Permalink
Merge pull request #330 from ourfor/develop
Browse files Browse the repository at this point in the history
💄 fix image corner radius (Android 11)
  • Loading branch information
ourfor authored Dec 10, 2024
2 parents 13ed800 + 11a50d0 commit fb426d7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat;

import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.bumptech.glide.request.RequestOptions;

import lombok.val;
import top.ourfor.app.iplayx.R;
Expand All @@ -26,6 +28,7 @@
import top.ourfor.app.iplayx.view.infra.TextView;

public class MediaViewCell extends ConstraintLayout implements UpdateModelAction {
private static final RequestOptions options = new RequestOptions().transform(new RoundedCorners(DeviceUtil.dpToPx(8)));
private MediaModel model;
private MediaCellBinding binding;
private TextView nameLabel;
Expand Down Expand Up @@ -64,6 +67,7 @@ public <T> void updateModel(T object) {
.load(imageUrl)
.placeholder(isAlbum ? R.drawable.hand_drawn_3 : R.drawable.abstract_3)
.transition(DrawableTransitionOptions.withCrossFade())
.apply(options)
.into(coverImage);
if (model instanceof EmbyMediaModel media) {
if (media.getUserData() != null && media.getUserData().getUnplayedItemCount() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;

import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;

import lombok.extern.slf4j.Slf4j;
import lombok.val;
import top.ourfor.app.iplayx.R;
Expand All @@ -24,6 +27,7 @@

@Slf4j
public class SiteViewCell extends ConstraintLayout implements UpdateModelAction {
private static final RequestOptions options = new RequestOptions().transform(new RoundedCorners(DeviceUtil.dpToPx(24)));
private SiteModel model;
SiteCellBinding binding = null;

Expand Down Expand Up @@ -60,6 +64,7 @@ public <T> void updateModel(T object) {
GlideApp.with(this)
.load(model.avatarUrl())
.placeholder(R.drawable.avatar)
.apply(options)
.into(binding.siteImage);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import top.ourfor.app.iplayx.model.EmbyMediaModel;

public class EpisodeCellView extends ConstraintLayout implements UpdateModelAction {
private static RequestOptions options = new RequestOptions().transform(new RoundedCorners(DeviceUtil.dpToPx(5)));
private static final RequestOptions options = new RequestOptions().transform(new RoundedCorners(DeviceUtil.dpToPx(5)));
EpisodeCellBinding binding = null;

public EpisodeCellView(@NonNull Context context) {
Expand Down

0 comments on commit fb426d7

Please sign in to comment.