Add placeholder for large screenshot previews

This commit is contained in:
Rahul Kumar Patel
2021-02-21 21:08:50 +05:30
parent 20d8763239
commit 722ed330a1
2 changed files with 2 additions and 3 deletions

View File

@@ -75,6 +75,7 @@ class LargeScreenshotView : RelativeLayout {
val displayMetrics = Resources.getSystem().displayMetrics
GlideApp.with(context)
.load("${artwork.url}=rw-w${displayMetrics.widthPixels}-v1-e15")
.placeholder(R.drawable.bg_placeholder)
.diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
.addListener(object : RequestListener<Drawable> {
override fun onLoadFailed(
@@ -98,7 +99,6 @@ class LargeScreenshotView : RelativeLayout {
B.img.layoutParams.height = artwork.height.px.toInt()
B.img.layoutParams.width = artwork.width.px.toInt()
} else {
val displayMetrics = Resources.getSystem().displayMetrics
val height = displayMetrics.heightPixels
val width = displayMetrics.widthPixels
B.img.layoutParams.width = width

View File

@@ -25,6 +25,5 @@
android:id="@+id/img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:cropToPadding="false" />
android:layout_centerInParent="true" />
</RelativeLayout>