Refactor margin/padding

Do two things to the margin and padding system:
- Remove the redundant padding/margin dimens and replace it with a unified "spacing" dimen namespace
- Make most margin and padding dimens follow the divisible-by-8 rule in material design
This commit is contained in:
OxygenCobalt
2021-04-25 14:59:21 -06:00
parent 39f26b4feb
commit 029a4b1ff6
30 changed files with 212 additions and 218 deletions
@@ -40,9 +40,9 @@
android:id="@+id/playback_cover"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="@dimen/margin_large"
android:layout_marginTop="@dimen/margin_insane"
android:layout_marginBottom="@dimen/margin_insane"
android:layout_marginStart="@dimen/spacing_large"
android:layout_marginTop="@dimen/spacing_insane"
android:layout_marginBottom="@dimen/spacing_insane"
android:contentDescription="@{@string/description_album_cover(song.name)}"
android:elevation="@dimen/elevation_normal"
android:outlineProvider="bounds"
@@ -59,8 +59,8 @@
android:id="@+id/playback_song_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_mid_large"
android:layout_marginEnd="@dimen/margin_mid_large"
android:layout_marginStart="@dimen/spacing_mid_large"
android:layout_marginEnd="@dimen/spacing_mid_large"
app:layout_constraintBottom_toTopOf="@+id/playback_artist"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0"
@@ -88,8 +88,8 @@
android:id="@+id/playback_artist"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_mid_large"
android:layout_marginEnd="@dimen/margin_mid_large"
android:layout_marginStart="@dimen/spacing_mid_large"
android:layout_marginEnd="@dimen/spacing_mid_large"
android:ellipsize="end"
android:onClick="@{() -> detailModel.navToItem(playbackModel.song.album.artist)}"
android:singleLine="true"
@@ -107,8 +107,8 @@
android:id="@+id/playback_album"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_mid_large"
android:layout_marginEnd="@dimen/margin_mid_large"
android:layout_marginStart="@dimen/spacing_mid_large"
android:layout_marginEnd="@dimen/spacing_mid_large"
android:ellipsize="end"
android:onClick="@{() -> detailModel.navToItem(playbackModel.song.album)}"
android:singleLine="true"
@@ -126,11 +126,11 @@
android:id="@+id/playback_seek_bar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_medium"
android:layout_marginTop="@dimen/spacing_medium"
android:clickable="true"
android:focusable="true"
android:paddingStart="@dimen/margin_mid_large"
android:paddingEnd="@dimen/margin_mid_large"
android:paddingStart="@dimen/spacing_mid_large"
android:paddingEnd="@dimen/spacing_mid_large"
android:progressBackgroundTint="?android:attr/colorControlNormal"
android:progressTint="?attr/colorPrimary"
android:splitTrack="false"
@@ -146,7 +146,7 @@
android:id="@+id/playback_duration_current"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_mid_large"
android:layout_marginStart="@dimen/spacing_mid_large"
android:text="@{playbackModel.formattedPosition}"
app:layout_constraintBottom_toTopOf="@+id/playback_play_pause"
app:layout_constraintStart_toEndOf="@+id/playback_cover"
@@ -157,7 +157,7 @@
android:id="@+id/playback_song_container_duration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/margin_mid_large"
android:layout_marginEnd="@dimen/spacing_mid_large"
android:text="@{song.formattedDuration}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/playback_seek_bar"
@@ -166,7 +166,7 @@
<ImageButton
android:id="@+id/playback_loop"
style="@style/Widget.Button.Unbounded"
android:layout_marginEnd="@dimen/margin_large"
android:layout_marginEnd="@dimen/spacing_large"
android:contentDescription="@string/description_change_loop"
android:onClick="@{() -> playbackModel.incrementLoopStatus()}"
android:src="@drawable/ic_loop"
@@ -178,7 +178,7 @@
<ImageButton
android:id="@+id/playback_skip_prev"
style="@style/Widget.Button.Unbounded"
android:layout_marginEnd="@dimen/margin_large"
android:layout_marginEnd="@dimen/spacing_large"
android:contentDescription="@string/description_skip_prev"
android:onClick="@{() -> playbackModel.skipPrev()}"
android:src="@drawable/ic_skip_prev"
@@ -200,7 +200,7 @@
<ImageButton
android:id="@+id/playback_skip_next"
style="@style/Widget.Button.Unbounded"
android:layout_marginStart="@dimen/margin_large"
android:layout_marginStart="@dimen/spacing_large"
android:contentDescription="@string/description_skip_next"
android:onClick="@{() -> playbackModel.skipNext()}"
android:src="@drawable/ic_skip_next"
@@ -211,7 +211,7 @@
<ImageButton
android:id="@+id/playback_shuffle"
style="@style/Widget.Button.Unbounded"
android:layout_marginStart="@dimen/margin_large"
android:layout_marginStart="@dimen/spacing_large"
android:contentDescription="@{playbackModel.isShuffling() ? @string/description_shuffle_off : @string/description_shuffle_on"
android:onClick="@{() -> playbackModel.invertShuffleStatus()}"
android:src="@drawable/ic_shuffle"