Revert full image

pull/183/head
FongMi 2 years ago
parent 849158ef23
commit 3017af91a4
  1. 30
      app/src/mobile/java/com/fongmi/android/tv/ui/holder/VodFullHolder.java
  2. 3
      app/src/mobile/res/layout/adapter_vod_full.xml

@ -1,18 +1,9 @@
package com.fongmi.android.tv.ui.holder;
import android.graphics.drawable.Drawable;
import android.widget.ImageView;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.engine.GlideException;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.target.Target;
import com.fongmi.android.tv.App;
import com.fongmi.android.tv.R;
import com.fongmi.android.tv.bean.Vod;
import com.fongmi.android.tv.databinding.AdapterVodFullBinding;
import com.fongmi.android.tv.ui.base.BaseVodHolder;
@ -29,22 +20,7 @@ public class VodFullHolder extends BaseVodHolder {
@Override
public void initView(Vod item) {
Glide.with(App.get()).load(ImgUtil.getUrl(item.getVodPic())).dontAnimate().listener(getListener(binding.image)).into(binding.image);
}
private RequestListener<Drawable> getListener(ImageView view) {
return new RequestListener<>() {
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
view.setScaleType(ImageView.ScaleType.CENTER);
view.setImageResource(R.drawable.ic_img_error);
return true;
}
@Override
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
return false;
}
};
ImgUtil.load(item.getVodPic(), binding.image);
binding.image.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
}

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="-8dp"
@ -11,6 +10,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitCenter" />
android:scaleType="center" />
</FrameLayout>
Loading…
Cancel
Save