widgets: rework button appearance

Further rework the button layout to be alike to other modern widgets.

This changeset transforms the play button into a FAB-ish thing,
makes spacing coherent between the uses of each layout, and adds
spacers to make the buttons layout in a more appealing way.
This commit is contained in:
OxygenCobalt
2022-07-01 12:25:59 -06:00
parent e883336b04
commit e41645ee28
73 changed files with 407 additions and 341 deletions
@@ -161,7 +161,7 @@ private class IndexerNotification(private val context: Context) :
}
setSmallIcon(R.drawable.ic_indexer_32)
setCategory(NotificationCompat.CATEGORY_SERVICE)
setCategory(NotificationCompat.CATEGORY_PROGRESS)
setShowWhen(false)
setSilent(true)
setContentIntent(context.newMainPendingIntent())
@@ -65,7 +65,7 @@ class NotificationComponent(
}
setSmallIcon(R.drawable.ic_auxio_24)
setCategory(NotificationCompat.CATEGORY_SERVICE)
setCategory(NotificationCompat.CATEGORY_TRANSPORT)
setShowWhen(false)
setSilent(true)
setContentIntent(context.newMainPendingIntent())
@@ -110,6 +110,7 @@ class NotificationComponent(
object : BitmapProvider.Target {
override fun onCompleted(bitmap: Bitmap?) {
setLargeIcon(bitmap)
build()
callback.onNotificationChanged(this@NotificationComponent)
}
})
@@ -118,7 +119,6 @@ class NotificationComponent(
/** Set the playing icon on the notification */
fun updatePlaying(isPlaying: Boolean) {
mActions[2] = buildPlayPauseAction(context, isPlaying)
if (!provider.isBusy) {
callback.onNotificationChanged(this)
}
@@ -127,7 +127,6 @@ class NotificationComponent(
/** Update the first action to reflect the [repeatMode] given. */
fun updateRepeatMode(repeatMode: RepeatMode) {
mActions[0] = buildRepeatAction(context, repeatMode)
if (!provider.isBusy) {
callback.onNotificationChanged(this)
}
@@ -136,7 +135,6 @@ class NotificationComponent(
/** Update the first action to reflect whether the queue is shuffled or not */
fun updateShuffled(isShuffled: Boolean) {
mActions[0] = buildShuffleAction(context, isShuffled)
if (!provider.isBusy) {
callback.onNotificationChanged(this)
}
@@ -60,7 +60,6 @@ class WidgetComponent(private val context: Context) :
* Force-update the widget.
*/
fun update() {
// TODO: Rework margins/button layout to do the magic that other button bars do
// TODO: Respond to rounded covers
// Updating Auxio's widget is unlike the rest of Auxio for a few reasons: