style: tweak dimens
Tweak some dimens so that they line up with the 8dp grid. This doesn't apply to all of them since some of them are fined-tuned [such as the fast-scroller]. The latter would likely be migrated in the later UI overhaul.
This commit is contained in:
parent
267578d606
commit
5788fb8732
18 changed files with 39 additions and 50 deletions
|
@ -23,9 +23,9 @@ import android.content.Context
|
||||||
import android.database.sqlite.SQLiteDatabase
|
import android.database.sqlite.SQLiteDatabase
|
||||||
import android.database.sqlite.SQLiteOpenHelper
|
import android.database.sqlite.SQLiteOpenHelper
|
||||||
import androidx.core.database.sqlite.transaction
|
import androidx.core.database.sqlite.transaction
|
||||||
import org.oxycblt.auxio.ui.queryAll
|
|
||||||
import org.oxycblt.auxio.logD
|
import org.oxycblt.auxio.logD
|
||||||
import org.oxycblt.auxio.ui.assertBackgroundThread
|
import org.oxycblt.auxio.ui.assertBackgroundThread
|
||||||
|
import org.oxycblt.auxio.ui.queryAll
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A SQLite database for managing the persistent playback state and queue.
|
* A SQLite database for managing the persistent playback state and queue.
|
||||||
|
|
|
@ -207,7 +207,6 @@ fun Context.newMainIntent(): PendingIntent {
|
||||||
fun <R> SQLiteDatabase.queryAll(tableName: String, block: (Cursor) -> R) =
|
fun <R> SQLiteDatabase.queryAll(tableName: String, block: (Cursor) -> R) =
|
||||||
query(tableName, null, null, null, null, null, null)?.use(block)
|
query(tableName, null, null, null, null, null, null)?.use(block)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assert that we are on a background thread.
|
* Assert that we are on a background thread.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
android:animateLayoutChanges="true"
|
android:animateLayoutChanges="true"
|
||||||
android:background="?android:attr/colorBackground"
|
android:background="?android:attr/colorBackground"
|
||||||
android:baselineAligned="false"
|
android:baselineAligned="false"
|
||||||
android:elevation="@dimen/elevation_normal"
|
android:elevation="8dp"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
app:layout_constraintBottom_toBottomOf="parent">
|
app:layout_constraintBottom_toBottomOf="parent">
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,8 @@
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/album_cover"
|
android:id="@+id/album_cover"
|
||||||
style="@style/Widget.ImageView.Full"
|
style="@style/Widget.ImageView.Full"
|
||||||
android:layout_width="@dimen/size_cover_detail_land"
|
android:layout_width="@dimen/size_cover_huge_land"
|
||||||
android:layout_height="@dimen/size_cover_detail_land"
|
android:layout_height="@dimen/size_cover_huge_land"
|
||||||
android:layout_marginStart="@dimen/spacing_medium"
|
android:layout_marginStart="@dimen/spacing_medium"
|
||||||
android:layout_marginTop="@dimen/spacing_medium"
|
android:layout_marginTop="@dimen/spacing_medium"
|
||||||
android:contentDescription="@{@string/desc_album_cover(album.name)}"
|
android:contentDescription="@{@string/desc_album_cover(album.name)}"
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/artist_image"
|
android:id="@+id/artist_image"
|
||||||
android:layout_width="@dimen/size_cover_detail_land"
|
android:layout_width="@dimen/size_cover_huge_land"
|
||||||
android:layout_height="@dimen/size_cover_detail_land"
|
android:layout_height="@dimen/size_cover_huge_land"
|
||||||
android:layout_margin="@dimen/spacing_medium"
|
android:layout_margin="@dimen/spacing_medium"
|
||||||
android:contentDescription="@{@string/desc_artist_image(artist.name)}"
|
android:contentDescription="@{@string/desc_artist_image(artist.name)}"
|
||||||
style="@style/Widget.ImageView.Full"
|
style="@style/Widget.ImageView.Full"
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/genre_image"
|
android:id="@+id/genre_image"
|
||||||
android:layout_width="@dimen/size_cover_detail_land"
|
android:layout_width="@dimen/size_cover_huge_land"
|
||||||
android:layout_height="@dimen/size_cover_detail_land"
|
android:layout_height="@dimen/size_cover_huge_land"
|
||||||
android:layout_margin="@dimen/spacing_medium"
|
android:layout_margin="@dimen/spacing_medium"
|
||||||
android:contentDescription="@{@string/desc_genre_image(genre.name)}"
|
android:contentDescription="@{@string/desc_genre_image(genre.name)}"
|
||||||
style="@style/Widget.ImageView.Full"
|
style="@style/Widget.ImageView.Full"
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/album_cover"
|
android:id="@+id/album_cover"
|
||||||
android:layout_width="@dimen/size_cover_detail"
|
android:layout_width="@dimen/size_cover_huge"
|
||||||
android:layout_height="@dimen/size_cover_detail"
|
android:layout_height="@dimen/size_cover_huge"
|
||||||
android:layout_marginStart="@dimen/spacing_medium"
|
android:layout_marginStart="@dimen/spacing_medium"
|
||||||
android:layout_marginTop="@dimen/spacing_medium"
|
android:layout_marginTop="@dimen/spacing_medium"
|
||||||
android:contentDescription="@{@string/desc_album_cover(album.name)}"
|
android:contentDescription="@{@string/desc_album_cover(album.name)}"
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/artist_image"
|
android:id="@+id/artist_image"
|
||||||
android:layout_width="@dimen/size_cover_detail"
|
android:layout_width="@dimen/size_cover_huge"
|
||||||
android:layout_height="@dimen/size_cover_detail"
|
android:layout_height="@dimen/size_cover_huge"
|
||||||
android:layout_margin="@dimen/spacing_medium"
|
android:layout_margin="@dimen/spacing_medium"
|
||||||
android:contentDescription="@{@string/desc_artist_image(artist.name)}"
|
android:contentDescription="@{@string/desc_artist_image(artist.name)}"
|
||||||
style="@style/Widget.ImageView.Full"
|
style="@style/Widget.ImageView.Full"
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/genre_image"
|
android:id="@+id/genre_image"
|
||||||
android:layout_width="@dimen/size_cover_detail"
|
android:layout_width="@dimen/size_cover_huge"
|
||||||
android:layout_height="@dimen/size_cover_detail"
|
android:layout_height="@dimen/size_cover_huge"
|
||||||
android:layout_margin="@dimen/spacing_medium"
|
android:layout_margin="@dimen/spacing_medium"
|
||||||
android:contentDescription="@{@string/desc_genre_image(genre.name)}"
|
android:contentDescription="@{@string/desc_genre_image(genre.name)}"
|
||||||
style="@style/Widget.ImageView.Full"
|
style="@style/Widget.ImageView.Full"
|
||||||
|
|
|
@ -16,21 +16,13 @@
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/loading_splash"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:src="@drawable/ic_launcher_foreground"
|
|
||||||
android:contentDescription="@string/desc_auxio_icon"
|
|
||||||
android:padding="@dimen/spacing_huge" />
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/loading_panel"
|
android:id="@+id/loading_panel"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="@dimen/spacing_large"
|
android:layout_margin="@dimen/spacing_large"
|
||||||
android:animateLayoutChanges="true"
|
android:animateLayoutChanges="true"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="center"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,9 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:animateLayoutChanges="true"
|
android:animateLayoutChanges="true"
|
||||||
android:elevation="@dimen/elevation_normal"
|
android:background="?android:attr/colorBackground"
|
||||||
|
android:baselineAligned="false"
|
||||||
|
android:elevation="8dp"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintBottom_toBottomOf="parent">
|
app:layout_constraintBottom_toBottomOf="parent">
|
||||||
|
|
||||||
|
@ -43,7 +45,6 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
android:background="?attr/colorSurface"
|
android:background="?attr/colorSurface"
|
||||||
android:elevation="0dp"
|
|
||||||
app:elevation="0dp"
|
app:elevation="0dp"
|
||||||
app:menu="@menu/menu_nav" />
|
app:menu="@menu/menu_nav" />
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,8 @@
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/album_cover"
|
android:id="@+id/album_cover"
|
||||||
style="@style/Widget.ImageView.Full"
|
style="@style/Widget.ImageView.Full"
|
||||||
android:layout_width="@dimen/size_cover_detail"
|
android:layout_width="@dimen/size_cover_huge"
|
||||||
android:layout_height="@dimen/size_cover_detail"
|
android:layout_height="@dimen/size_cover_huge"
|
||||||
android:layout_marginTop="@dimen/spacing_medium"
|
android:layout_marginTop="@dimen/spacing_medium"
|
||||||
android:contentDescription="@{@string/desc_album_cover(album.name)}"
|
android:contentDescription="@{@string/desc_album_cover(album.name)}"
|
||||||
app:albumArt="@{album}"
|
app:albumArt="@{album}"
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/artist_image"
|
android:id="@+id/artist_image"
|
||||||
style="@style/Widget.ImageView.Full"
|
style="@style/Widget.ImageView.Full"
|
||||||
android:layout_width="@dimen/size_cover_detail"
|
android:layout_width="@dimen/size_cover_huge"
|
||||||
android:layout_height="@dimen/size_cover_detail"
|
android:layout_height="@dimen/size_cover_huge"
|
||||||
android:layout_marginTop="@dimen/spacing_medium"
|
android:layout_marginTop="@dimen/spacing_medium"
|
||||||
android:contentDescription="@{@string/desc_artist_image(artist.name)}"
|
android:contentDescription="@{@string/desc_artist_image(artist.name)}"
|
||||||
app:artistImage="@{artist}"
|
app:artistImage="@{artist}"
|
||||||
|
|
|
@ -27,8 +27,8 @@
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/genre_image"
|
android:id="@+id/genre_image"
|
||||||
style="@style/Widget.ImageView.Full"
|
style="@style/Widget.ImageView.Full"
|
||||||
android:layout_width="@dimen/size_cover_detail"
|
android:layout_width="@dimen/size_cover_huge"
|
||||||
android:layout_height="@dimen/size_cover_detail"
|
android:layout_height="@dimen/size_cover_huge"
|
||||||
android:layout_marginTop="@dimen/spacing_medium"
|
android:layout_marginTop="@dimen/spacing_medium"
|
||||||
android:contentDescription="@{@string/desc_genre_image(genre.name)}"
|
android:contentDescription="@{@string/desc_genre_image(genre.name)}"
|
||||||
app:genreImage="@{genre}"
|
app:genreImage="@{genre}"
|
||||||
|
@ -94,6 +94,7 @@
|
||||||
android:backgroundTint="?attr/colorAccent"
|
android:backgroundTint="?attr/colorAccent"
|
||||||
android:onClick="@{() -> playbackModel.playGenre(genre, true)}"
|
android:onClick="@{() -> playbackModel.playGenre(genre, true)}"
|
||||||
android:text="@string/lbl_shuffle"
|
android:text="@string/lbl_shuffle"
|
||||||
|
android:layout_marginEnd="@dimen/spacing_medium"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/genre_play_button"
|
app:layout_constraintBottom_toBottomOf="@+id/genre_play_button"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/genre_play_button"
|
app:layout_constraintStart_toEndOf="@+id/genre_play_button"
|
||||||
|
|
|
@ -3,6 +3,4 @@
|
||||||
<style name="Widget.Component.AppWidget.Button" parent="Widget.Component.AppWidget.Button.Base">
|
<style name="Widget.Component.AppWidget.Button" parent="Widget.Component.AppWidget.Button.Base">
|
||||||
<item name="android:background">@drawable/ui_unbounded_ripple</item>
|
<item name="android:background">@drawable/ui_unbounded_ripple</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Widget.Component.AppWidget.Panel" parent="Widget.Component.AppWidget.Panel.Base" />
|
|
||||||
</resources>
|
</resources>
|
|
@ -1,5 +1,9 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
<!--
|
||||||
|
TODO: Rejig these dimens to line up with the 8dp grid. Dimens like the stroke should
|
||||||
|
be increased.-->
|
||||||
|
|
||||||
<!-- Spacing Namespace | Dimens for padding/margin attributes -->
|
<!-- Spacing Namespace | Dimens for padding/margin attributes -->
|
||||||
<dimen name="spacing_micro">2dp</dimen>
|
<dimen name="spacing_micro">2dp</dimen>
|
||||||
<dimen name="spacing_tiny">4dp</dimen>
|
<dimen name="spacing_tiny">4dp</dimen>
|
||||||
|
@ -12,30 +16,29 @@
|
||||||
<dimen name="spacing_insane">128dp</dimen>
|
<dimen name="spacing_insane">128dp</dimen>
|
||||||
|
|
||||||
<!-- Height Namespace | Height for UI elements -->
|
<!-- Height Namespace | Height for UI elements -->
|
||||||
<dimen name="height_compact_progress">2dp</dimen>
|
|
||||||
<dimen name="height_widget_button">32dp</dimen>
|
<dimen name="height_widget_button">32dp</dimen>
|
||||||
|
|
||||||
<!-- Width Namespace | Width for UI elements -->
|
<!-- Width Namespace | Width for UI elements -->
|
||||||
<dimen name="width_track_number">32dp</dimen>
|
<dimen name="width_track_number">32dp</dimen>
|
||||||
<dimen name="width_play_stroke">1dp</dimen>
|
|
||||||
<dimen name="width_fast_scroll">20dp</dimen>
|
<dimen name="width_fast_scroll">20dp</dimen>
|
||||||
|
|
||||||
<!-- Size Namespace | Width & Heights for UI elements -->
|
<!-- Size Namespace | Width & Heights for UI elements -->
|
||||||
<dimen name="size_small_unb_ripple">18dp</dimen>
|
<dimen name="size_small_unb_ripple">18dp</dimen>
|
||||||
<dimen name="size_unb_ripple">24dp</dimen>
|
<dimen name="size_unb_ripple">24dp</dimen>
|
||||||
|
|
||||||
<dimen name="size_cover_compact">46dp</dimen>
|
<dimen name="size_cover_compact">48dp</dimen>
|
||||||
<dimen name="size_cover_normal">56dp</dimen>
|
<dimen name="size_cover_normal">56dp</dimen>
|
||||||
<dimen name="size_cover_large">68dp</dimen>
|
<dimen name="size_cover_large">64dp</dimen>
|
||||||
<dimen name="size_cover_detail">260dp</dimen>
|
<dimen name="size_cover_huge">264dp</dimen>
|
||||||
<dimen name="size_cover_detail_land">130dp</dimen>
|
<dimen name="size_cover_huge_land">136dp</dimen>
|
||||||
|
|
||||||
<dimen name="size_play_pause">70dp</dimen>
|
<dimen name="size_play_pause">72dp</dimen>
|
||||||
<dimen name="size_play_pause_compact">36dp</dimen>
|
<dimen name="size_play_pause_compact">36dp</dimen>
|
||||||
<dimen name="size_scroll_thumb">48dp</dimen>
|
<dimen name="size_scroll_thumb">48dp</dimen>
|
||||||
<dimen name="size_clear">32dp</dimen>
|
<dimen name="size_clear">32dp</dimen>
|
||||||
|
|
||||||
<dimen name="size_app_icon">50dp</dimen>
|
<dimen name="size_app_icon">48dp</dimen>
|
||||||
|
<dimen name="size_stroke">2dp</dimen>
|
||||||
|
|
||||||
<!-- Text Size Namespace | Text Sizes -->
|
<!-- Text Size Namespace | Text Sizes -->
|
||||||
<dimen name="text_size_small">16sp</dimen>
|
<dimen name="text_size_small">16sp</dimen>
|
||||||
|
|
|
@ -64,16 +64,11 @@
|
||||||
<item name="android:background">?android:attr/selectableItemBackgroundBorderless</item>
|
<item name="android:background">?android:attr/selectableItemBackgroundBorderless</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Widget.Component.AppWidget.Panel.Base">
|
<style name="Widget.Component.AppWidget.Panel" parent="">
|
||||||
<item name="android:layout_height">wrap_content</item>
|
<item name="android:layout_height">wrap_content</item>
|
||||||
<item name="android:layout_width">match_parent</item>
|
<item name="android:layout_width">match_parent</item>
|
||||||
<item name="android:padding">@dimen/spacing_medium</item>
|
<item name="android:padding">@dimen/spacing_medium</item>
|
||||||
<item name="android:orientation">vertical</item>
|
<item name="android:orientation">vertical</item>
|
||||||
<item name="android:background">?attr/colorSurface</item>
|
<item name="android:background">?attr/colorSurface</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Widget.Component.AppWidget.Panel" parent="Widget.Component.AppWidget.Panel.Base">
|
|
||||||
<item name="android:elevation">@dimen/elevation_normal</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
<style name="Widget.ProgressBar.Compact" parent="@style/Widget.AppCompat.ProgressBar.Horizontal">
|
<style name="Widget.ProgressBar.Compact" parent="@style/Widget.AppCompat.ProgressBar.Horizontal">
|
||||||
<item name="android:layout_width">match_parent</item>
|
<item name="android:layout_width">match_parent</item>
|
||||||
<item name="android:layout_height">@dimen/height_compact_progress</item>
|
<item name="android:layout_height">@dimen/size_stroke</item>
|
||||||
<item name="android:progressBackgroundTint">?attr/colorControlNormal</item>
|
<item name="android:progressBackgroundTint">?attr/colorControlNormal</item>
|
||||||
<item name="android:progressTint">?attr/colorAccent</item>
|
<item name="android:progressTint">?attr/colorAccent</item>
|
||||||
</style>
|
</style>
|
||||||
|
@ -216,6 +216,6 @@
|
||||||
|
|
||||||
<style name="Widget.Button.Vibrant.Secondary" parent="@style/Widget.Button.Vibrant.Base">
|
<style name="Widget.Button.Vibrant.Secondary" parent="@style/Widget.Button.Vibrant.Base">
|
||||||
<item name="strokeColor">@color/divider</item>
|
<item name="strokeColor">@color/divider</item>
|
||||||
<item name="strokeWidth">@dimen/width_play_stroke</item>
|
<item name="strokeWidth">@dimen/size_stroke</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
Loading…
Reference in a new issue