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:
OxygenCobalt 2021-08-16 19:31:00 -06:00
parent 267578d606
commit 5788fb8732
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
18 changed files with 39 additions and 50 deletions

View file

@ -23,9 +23,9 @@ import android.content.Context
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper
import androidx.core.database.sqlite.transaction
import org.oxycblt.auxio.ui.queryAll
import org.oxycblt.auxio.logD
import org.oxycblt.auxio.ui.assertBackgroundThread
import org.oxycblt.auxio.ui.queryAll
/**
* A SQLite database for managing the persistent playback state and queue.

View file

@ -207,7 +207,6 @@ fun Context.newMainIntent(): PendingIntent {
fun <R> SQLiteDatabase.queryAll(tableName: String, block: (Cursor) -> R) =
query(tableName, null, null, null, null, null, null)?.use(block)
/**
* Assert that we are on a background thread.
*/

View file

@ -30,7 +30,7 @@
android:animateLayoutChanges="true"
android:background="?android:attr/colorBackground"
android:baselineAligned="false"
android:elevation="@dimen/elevation_normal"
android:elevation="8dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent">

View file

@ -26,8 +26,8 @@
<ImageView
android:id="@+id/album_cover"
style="@style/Widget.ImageView.Full"
android:layout_width="@dimen/size_cover_detail_land"
android:layout_height="@dimen/size_cover_detail_land"
android:layout_width="@dimen/size_cover_huge_land"
android:layout_height="@dimen/size_cover_huge_land"
android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginTop="@dimen/spacing_medium"
android:contentDescription="@{@string/desc_album_cover(album.name)}"

View file

@ -21,8 +21,8 @@
<ImageView
android:id="@+id/artist_image"
android:layout_width="@dimen/size_cover_detail_land"
android:layout_height="@dimen/size_cover_detail_land"
android:layout_width="@dimen/size_cover_huge_land"
android:layout_height="@dimen/size_cover_huge_land"
android:layout_margin="@dimen/spacing_medium"
android:contentDescription="@{@string/desc_artist_image(artist.name)}"
style="@style/Widget.ImageView.Full"

View file

@ -25,8 +25,8 @@
<ImageView
android:id="@+id/genre_image"
android:layout_width="@dimen/size_cover_detail_land"
android:layout_height="@dimen/size_cover_detail_land"
android:layout_width="@dimen/size_cover_huge_land"
android:layout_height="@dimen/size_cover_huge_land"
android:layout_margin="@dimen/spacing_medium"
android:contentDescription="@{@string/desc_genre_image(genre.name)}"
style="@style/Widget.ImageView.Full"

View file

@ -25,8 +25,8 @@
<ImageView
android:id="@+id/album_cover"
android:layout_width="@dimen/size_cover_detail"
android:layout_height="@dimen/size_cover_detail"
android:layout_width="@dimen/size_cover_huge"
android:layout_height="@dimen/size_cover_huge"
android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginTop="@dimen/spacing_medium"
android:contentDescription="@{@string/desc_album_cover(album.name)}"

View file

@ -21,8 +21,8 @@
<ImageView
android:id="@+id/artist_image"
android:layout_width="@dimen/size_cover_detail"
android:layout_height="@dimen/size_cover_detail"
android:layout_width="@dimen/size_cover_huge"
android:layout_height="@dimen/size_cover_huge"
android:layout_margin="@dimen/spacing_medium"
android:contentDescription="@{@string/desc_artist_image(artist.name)}"
style="@style/Widget.ImageView.Full"

View file

@ -25,8 +25,8 @@
<ImageView
android:id="@+id/genre_image"
android:layout_width="@dimen/size_cover_detail"
android:layout_height="@dimen/size_cover_detail"
android:layout_width="@dimen/size_cover_huge"
android:layout_height="@dimen/size_cover_huge"
android:layout_margin="@dimen/spacing_medium"
android:contentDescription="@{@string/desc_genre_image(genre.name)}"
style="@style/Widget.ImageView.Full"

View file

@ -16,21 +16,13 @@
android:gravity="center"
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
android:id="@+id/loading_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_large"
android:animateLayoutChanges="true"
android:layout_gravity="bottom"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">

View file

@ -26,7 +26,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
android:elevation="@dimen/elevation_normal"
android:background="?android:attr/colorBackground"
android:baselineAligned="false"
android:elevation="8dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent">
@ -43,7 +45,6 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="?attr/colorSurface"
android:elevation="0dp"
app:elevation="0dp"
app:menu="@menu/menu_nav" />

View file

@ -26,8 +26,8 @@
<ImageView
android:id="@+id/album_cover"
style="@style/Widget.ImageView.Full"
android:layout_width="@dimen/size_cover_detail"
android:layout_height="@dimen/size_cover_detail"
android:layout_width="@dimen/size_cover_huge"
android:layout_height="@dimen/size_cover_huge"
android:layout_marginTop="@dimen/spacing_medium"
android:contentDescription="@{@string/desc_album_cover(album.name)}"
app:albumArt="@{album}"

View file

@ -22,8 +22,8 @@
<ImageView
android:id="@+id/artist_image"
style="@style/Widget.ImageView.Full"
android:layout_width="@dimen/size_cover_detail"
android:layout_height="@dimen/size_cover_detail"
android:layout_width="@dimen/size_cover_huge"
android:layout_height="@dimen/size_cover_huge"
android:layout_marginTop="@dimen/spacing_medium"
android:contentDescription="@{@string/desc_artist_image(artist.name)}"
app:artistImage="@{artist}"

View file

@ -27,8 +27,8 @@
<ImageView
android:id="@+id/genre_image"
style="@style/Widget.ImageView.Full"
android:layout_width="@dimen/size_cover_detail"
android:layout_height="@dimen/size_cover_detail"
android:layout_width="@dimen/size_cover_huge"
android:layout_height="@dimen/size_cover_huge"
android:layout_marginTop="@dimen/spacing_medium"
android:contentDescription="@{@string/desc_genre_image(genre.name)}"
app:genreImage="@{genre}"
@ -94,6 +94,7 @@
android:backgroundTint="?attr/colorAccent"
android:onClick="@{() -> playbackModel.playGenre(genre, true)}"
android:text="@string/lbl_shuffle"
android:layout_marginEnd="@dimen/spacing_medium"
app:layout_constraintBottom_toBottomOf="@+id/genre_play_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/genre_play_button"

View file

@ -3,6 +3,4 @@
<style name="Widget.Component.AppWidget.Button" parent="Widget.Component.AppWidget.Button.Base">
<item name="android:background">@drawable/ui_unbounded_ripple</item>
</style>
<style name="Widget.Component.AppWidget.Panel" parent="Widget.Component.AppWidget.Panel.Base" />
</resources>

View file

@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<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 -->
<dimen name="spacing_micro">2dp</dimen>
<dimen name="spacing_tiny">4dp</dimen>
@ -12,30 +16,29 @@
<dimen name="spacing_insane">128dp</dimen>
<!-- Height Namespace | Height for UI elements -->
<dimen name="height_compact_progress">2dp</dimen>
<dimen name="height_widget_button">32dp</dimen>
<!-- Width Namespace | Width for UI elements -->
<dimen name="width_track_number">32dp</dimen>
<dimen name="width_play_stroke">1dp</dimen>
<dimen name="width_fast_scroll">20dp</dimen>
<!-- Size Namespace | Width & Heights for UI elements -->
<dimen name="size_small_unb_ripple">18dp</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_large">68dp</dimen>
<dimen name="size_cover_detail">260dp</dimen>
<dimen name="size_cover_detail_land">130dp</dimen>
<dimen name="size_cover_large">64dp</dimen>
<dimen name="size_cover_huge">264dp</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_scroll_thumb">48dp</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 -->
<dimen name="text_size_small">16sp</dimen>

View file

@ -64,16 +64,11 @@
<item name="android:background">?android:attr/selectableItemBackgroundBorderless</item>
</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_width">match_parent</item>
<item name="android:padding">@dimen/spacing_medium</item>
<item name="android:orientation">vertical</item>
<item name="android:background">?attr/colorSurface</item>
</style>
<style name="Widget.Component.AppWidget.Panel" parent="Widget.Component.AppWidget.Panel.Base">
<item name="android:elevation">@dimen/elevation_normal</item>
</style>
</resources>

View file

@ -27,7 +27,7 @@
<style name="Widget.ProgressBar.Compact" parent="@style/Widget.AppCompat.ProgressBar.Horizontal">
<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:progressTint">?attr/colorAccent</item>
</style>
@ -216,6 +216,6 @@
<style name="Widget.Button.Vibrant.Secondary" parent="@style/Widget.Button.Vibrant.Base">
<item name="strokeColor">@color/divider</item>
<item name="strokeWidth">@dimen/width_play_stroke</item>
<item name="strokeWidth">@dimen/size_stroke</item>
</style>
</resources>