mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 11:22:12 +00:00
Fix: Screenshot's palceholder size size
This commit is contained in:
parent
011cf6a41f
commit
a2f5a725a5
@ -3,6 +3,8 @@ package com.looker.droidify.screen
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.graphics.drawable.toBitmap
|
||||
import androidx.core.graphics.drawable.toDrawable
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import coil.load
|
||||
import com.google.android.material.card.MaterialCardView
|
||||
@ -105,7 +107,13 @@ class ScreenshotsAdapter(private val onClick: (Product.Screenshot) -> Unit) :
|
||||
item.screenshot
|
||||
)
|
||||
) {
|
||||
placeholder(holder.placeholder)
|
||||
placeholder(
|
||||
PaddingDrawable(
|
||||
holder.placeholder.mutate()
|
||||
.toBitmap(height = cellSize.toInt(), width = cellSize.toInt() / 4)
|
||||
.toDrawable(context.resources), 1f
|
||||
)
|
||||
)
|
||||
error(holder.placeholder)
|
||||
size(cellSize.toInt())
|
||||
}
|
||||
|
13
src/main/res/drawable/ic_screenshot_placeholder.xml
Normal file
13
src/main/res/drawable/ic_screenshot_placeholder.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="32dp"
|
||||
android:height="128dp"
|
||||
android:tint="?attr/colorOnPrimary"
|
||||
android:viewportWidth="32"
|
||||
android:viewportHeight="128">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,12m-3,0a3,3 0,1 1,6 0a3,3 0,1 1,-6 0" />
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,4h-3.17l-1.24,-1.35c-0.37,-0.41 -0.91,-0.65 -1.47,-0.65L9.88,2c-0.56,0 -1.1,0.24 -1.48,0.65L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z" />
|
||||
</vector>
|
Loading…
x
Reference in New Issue
Block a user