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:
@@ -47,6 +47,14 @@
|
||||
android:src="@drawable/ic_remote_default_cover_24"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<!--
|
||||
We want to evenly space these buttons, but using a plain layout_weight system would result
|
||||
in more padding being applied to the button icons than desired. Fix this by adding empty
|
||||
views that respond to layout_weight and space out the fixed-size buttons.
|
||||
|
||||
As for why we use ImageViews, it is the only blank view that the AppWidget API will accept.
|
||||
Because of course it is.
|
||||
-->
|
||||
<android.widget.LinearLayout
|
||||
android:id="@+id/widget_controls"
|
||||
android:layout_width="match_parent"
|
||||
@@ -56,32 +64,40 @@
|
||||
android:background="@drawable/ui_widget_panel"
|
||||
android:backgroundTint="?attr/colorSurface"
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/spacing_small">
|
||||
android:padding="@dimen/spacing_mid_small">
|
||||
|
||||
<android.widget.ImageButton
|
||||
android:id="@+id/widget_skip_prev"
|
||||
style="@style/Widget.Auxio.PlaybackButton.AppWidget"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="@dimen/size_btn"
|
||||
android:layout_height="@dimen/size_btn"
|
||||
android:contentDescription="@string/desc_skip_prev"
|
||||
android:src="@drawable/ic_skip_prev_24" />
|
||||
|
||||
<android.widget.ImageButton
|
||||
android:id="@+id/widget_play_pause"
|
||||
style="@style/Widget.Auxio.PlaybackButton.AppWidget"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:contentDescription="@string/desc_play_pause"
|
||||
android:src="@drawable/ic_play_24" />
|
||||
<android.widget.ImageView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<android.widget.ImageButton
|
||||
android:id="@+id/widget_play_pause"
|
||||
style="@style/Widget.Auxio.FloatingActionButton.AppWidget"
|
||||
android:layout_width="@dimen/size_btn"
|
||||
android:layout_height="@dimen/size_btn"
|
||||
android:contentDescription="@string/desc_play_pause"
|
||||
android:src="@drawable/sel_playing_state_24" />
|
||||
|
||||
|
||||
<android.widget.ImageView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<android.widget.ImageButton
|
||||
android:id="@+id/widget_skip_next"
|
||||
style="@style/Widget.Auxio.PlaybackButton.AppWidget"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="@dimen/size_btn"
|
||||
android:layout_height="@dimen/size_btn"
|
||||
android:contentDescription="@string/desc_skip_next"
|
||||
android:src="@drawable/ic_skip_next_24" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user