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:
parent
272f7e4047
commit
186c5547ba
2 changed files with 3 additions and 3 deletions
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue