widget: change default size
Make the default widget size 3x2 again. This is because the UX is generally nicer if the smaller widget is used as the default and because the small widget is now no longer text-only and ugly.
This commit is contained in:
parent
0e3ffb973b
commit
58c2681f72
5 changed files with 9 additions and 12 deletions
|
@ -30,7 +30,7 @@ import android.os.Bundle
|
|||
import android.util.SizeF
|
||||
import android.widget.RemoteViews
|
||||
import androidx.core.graphics.drawable.toBitmap
|
||||
import coil.Coil
|
||||
import coil.imageLoader
|
||||
import coil.request.ImageRequest
|
||||
import coil.transform.RoundedCornersTransformation
|
||||
import org.oxycblt.auxio.BuildConfig
|
||||
|
@ -98,6 +98,10 @@ class WidgetProvider : AppWidgetProvider() {
|
|||
val coverRequest = ImageRequest.Builder(context)
|
||||
.data(song.album)
|
||||
.size(imageSize)
|
||||
.target(
|
||||
onError = { onDone(null) },
|
||||
onSuccess = { onDone(it.toBitmap()) }
|
||||
)
|
||||
|
||||
// If we are on Android 12 or higher, round out the album cover so that the widget is
|
||||
// cohesive. I really don't like this, but whatever.
|
||||
|
@ -111,12 +115,7 @@ class WidgetProvider : AppWidgetProvider() {
|
|||
coverRequest.transformations(transform)
|
||||
}
|
||||
|
||||
coverRequest.target(
|
||||
onError = { onDone(null) },
|
||||
onSuccess = { onDone(it.toBitmap()) }
|
||||
)
|
||||
|
||||
Coil.imageLoader(context).enqueue(coverRequest.build())
|
||||
context.imageLoader.enqueue(coverRequest.build())
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -57,7 +57,6 @@
|
|||
android:paddingBottom="@dimen/spacing_small"
|
||||
android:paddingStart="@dimen/spacing_small"
|
||||
android:paddingEnd="@dimen/spacing_small"
|
||||
android:elevation="@dimen/elevation_normal"
|
||||
android:orientation="horizontal"
|
||||
android:background="@drawable/ui_widget_panel"
|
||||
android:layout_gravity="center">
|
||||
|
|
|
@ -55,7 +55,6 @@
|
|||
android:layout_alignParentBottom="true"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/ui_widget_panel"
|
||||
android:elevation="@dimen/elevation_normal"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="@dimen/spacing_small"
|
||||
android:paddingBottom="@dimen/spacing_small"
|
||||
|
|
|
@ -36,5 +36,5 @@
|
|||
<dimen name="widget_width_min">176dp</dimen>
|
||||
<dimen name="widget_height_min">110dp</dimen>
|
||||
<dimen name="widget_width_def">@dimen/widget_width_min</dimen>
|
||||
<dimen name="widget_height_def">110dp</dimen>
|
||||
<dimen name="widget_height_def">@dimen/widget_height_min</dimen>
|
||||
</resources>
|
|
@ -7,9 +7,9 @@
|
|||
android:minResizeWidth="@dimen/widget_width_min"
|
||||
android:minResizeHeight="@dimen/widget_height_min"
|
||||
android:previewImage="@drawable/ui_widget_preview"
|
||||
android:previewLayout="@layout/widget_medium"
|
||||
android:previewLayout="@layout/widget_small"
|
||||
android:resizeMode="horizontal|vertical"
|
||||
android:targetCellWidth="3"
|
||||
android:targetCellHeight="3"
|
||||
android:targetCellHeight="2"
|
||||
android:updatePeriodMillis="0"
|
||||
android:widgetCategory="home_screen" />
|
Loading…
Reference in a new issue