widget: drastically shrink cover size

In a desparate attempt to accomodate OEMs that STILL don't have the
extra widget form bug.
This commit is contained in:
Alexander Capehart 2024-07-24 21:31:28 -06:00
parent 272f7e4047
commit 186c5547ba
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
2 changed files with 3 additions and 3 deletions

View file

@ -99,7 +99,7 @@ constructor(
return if (cornerRadius > 0) {
// If rounded, reduce the bitmap size further to obtain more pronounced
// rounded corners.
builder.size(getSafeRemoteViewsImageSize(context, 11f))
builder.size(getSafeRemoteViewsImageSize(context, 80f))
val cornersTransformation =
RoundedRectTransformation(cornerRadius.toFloat())
if (imageSettings.forceSquareCovers) {

View file

@ -51,11 +51,11 @@ fun newRemoteViews(context: Context, @LayoutRes layoutRes: Int): RemoteViews {
* there is only one image.
*
* @param context [Context] required to perform calculation.
* @param reduce Optional multiplier to reduce the image size. Recommended value is 3 to avoid
* @param reduce Optional multiplier to reduce the image size. Recommended value is 16f to avoid
* device-specific variations in memory limit.
* @return The dimension of a bitmap that can be safely used in [RemoteViews].
*/
fun getSafeRemoteViewsImageSize(context: Context, reduce: Float = 3f): Int {
fun getSafeRemoteViewsImageSize(context: Context, reduce: Float = 16f): Int {
val metrics = context.resources.displayMetrics
val sw = metrics.widthPixels
val sh = metrics.heightPixels