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
@@ -27,8 +27,8 @@
android:id="@+id/album_cover"
android:layout_width="@dimen/size_cover_detail"
android:layout_height="@dimen/size_cover_detail"
android:layout_marginStart="@dimen/margin_medium"
android:layout_marginTop="@dimen/margin_medium"
android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginTop="@dimen/spacing_medium"
android:contentDescription="@{@string/description_album_cover(album.name)}"
android:elevation="@dimen/elevation_normal"
android:outlineProvider="bounds"
@@ -42,8 +42,8 @@
style="@style/DetailTitleText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_medium"
android:layout_marginEnd="@dimen/margin_medium"
android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginEnd="@dimen/spacing_medium"
android:text="@{album.name}"
app:layout_constraintBottom_toTopOf="@+id/album_artist"
app:layout_constraintEnd_toEndOf="parent"
@@ -57,7 +57,7 @@
android:id="@+id/album_artist"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_medium"
android:layout_marginStart="@dimen/spacing_medium"
android:clickable="true"
android:focusable="true"
android:onClick="@{() -> detailModel.navToItem(album.artist)}"
@@ -73,7 +73,7 @@
android:id="@+id/album_details"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_medium"
android:layout_marginStart="@dimen/spacing_medium"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="?android:attr/textColorSecondary"
app:albumDetails="@{album}"
@@ -27,7 +27,7 @@
android:id="@+id/artist_image"
android:layout_width="@dimen/size_cover_detail"
android:layout_height="@dimen/size_cover_detail"
android:layout_margin="@dimen/margin_medium"
android:layout_margin="@dimen/spacing_medium"
android:contentDescription="@{@string/description_artist_image(artist.name)}"
android:elevation="@dimen/elevation_normal"
android:outlineProvider="bounds"
@@ -41,8 +41,8 @@
style="@style/DetailTitleText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_medium"
android:layout_marginEnd="@dimen/margin_medium"
android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginEnd="@dimen/spacing_medium"
android:text="@{artist.name}"
app:layout_constraintBottom_toTopOf="@+id/artist_genre"
app:layout_constraintEnd_toEndOf="parent"
@@ -56,7 +56,7 @@
android:id="@+id/artist_genre"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_medium"
android:layout_marginStart="@dimen/spacing_medium"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="?android:attr/textColorSecondary"
app:artistGenre="@{artist}"
@@ -69,7 +69,7 @@
android:id="@+id/artist_counts"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_medium"
android:layout_marginStart="@dimen/spacing_medium"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="?android:attr/textColorSecondary"
app:artistCounts="@{artist}"
@@ -102,7 +102,7 @@
<TextView
android:id="@+id/artist_album_header"
style="@style/HeaderText"
android:layout_marginTop="@dimen/margin_small"
android:layout_marginTop="@dimen/spacing_small"
android:text="@string/label_albums"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/artist_play_button" />
@@ -27,7 +27,7 @@
android:id="@+id/genre_image"
android:layout_width="@dimen/size_cover_detail"
android:layout_height="@dimen/size_cover_detail"
android:layout_margin="@dimen/margin_medium"
android:layout_margin="@dimen/spacing_medium"
android:contentDescription="@{@string/description_genre_image(genre.name)}"
android:elevation="@dimen/elevation_normal"
android:outlineProvider="bounds"
@@ -41,8 +41,8 @@
style="@style/DetailTitleText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_medium"
android:layout_marginEnd="@dimen/margin_medium"
android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginEnd="@dimen/spacing_medium"
android:text="@{genre.resolvedName}"
app:layout_constraintBottom_toTopOf="@+id/genre_song_count"
app:layout_constraintEnd_toEndOf="parent"
@@ -56,7 +56,7 @@
android:id="@+id/genre_song_count"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_medium"
android:layout_marginStart="@dimen/spacing_medium"
android:text="@{@plurals/format_song_count(genre.songs.size(), genre.songs.size())}"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="?android:attr/textColorSecondary"
@@ -90,7 +90,7 @@
android:id="@+id/genre_duration"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_medium"
android:layout_marginStart="@dimen/spacing_medium"
android:text="@{genre.totalDuration}"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="?android:attr/textColorSecondary"
@@ -102,7 +102,7 @@
<TextView
android:id="@+id/genre_song_header"
style="@style/HeaderText"
android:layout_marginTop="@dimen/margin_small"
android:layout_marginTop="@dimen/spacing_small"
android:text="@string/label_songs"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/genre_play_button" />