Update track number sizing

Use AppCompatTextView on the track number so that track numbers over 100 are not cut off. Sort of, track numbers over 100000 will be cut off, but I bet that will be rare in normal use.
This commit is contained in:
OxygenCobalt
2020-09-19 16:44:00 -06:00
parent 4d47dcd464
commit 309ed2dcff
6 changed files with 20 additions and 15 deletions
@@ -56,9 +56,10 @@
android:layout_marginEnd="@dimen/margin_medium"
android:layout_marginStart="@dimen/margin_medium"
android:text="@{album.name}"
android:maxLines="1"
app:autoSizeMaxTextSize="@dimen/detail_header_size_max"
app:autoSizeMinTextSize="@dimen/detail_header_size_min"
app:autoSizeStepGranularity="@dimen/detail_header_size_increment"
app:autoSizeMinTextSize="@dimen/generic_size_min"
app:autoSizeStepGranularity="@dimen/generic_size_increment"
app:autoSizeTextType="uniform"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
@@ -57,8 +57,8 @@
android:layout_marginStart="@dimen/margin_medium"
android:text="@{artist.name}"
app:autoSizeMaxTextSize="@dimen/detail_header_size_max"
app:autoSizeMinTextSize="@dimen/detail_header_size_min"
app:autoSizeStepGranularity="@dimen/detail_header_size_increment"
app:autoSizeMinTextSize="@dimen/generic_size_min"
app:autoSizeStepGranularity="@dimen/generic_size_increment"
app:autoSizeTextType="uniform"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
+8 -3
View File
@@ -18,17 +18,22 @@
android:focusable="true"
android:padding="@dimen/padding_medium">
<TextView
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/track_number"
android:layout_width="@dimen/track_number_size"
android:layout_width="@dimen/track_number_width"
android:layout_height="wrap_content"
android:text="@{String.valueOf(song.track)}"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="?android:attr/textColorTertiary"
android:textSize="@dimen/track_number_text_size"
android:textSize="@dimen/track_number_text_size_max"
android:maxLines="1"
android:contentDescription="@{@string/description_track_number(song.track)}"
app:autoSizeMaxTextSize="@dimen/detail_header_size_max"
app:autoSizeMinTextSize="@dimen/generic_size_min"
app:autoSizeStepGranularity="@dimen/generic_size_increment"
android:gravity="center"
app:autoSizeTextType="uniform"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
+5 -4
View File
@@ -16,12 +16,13 @@
<dimen name="cover_size_large">80dp</dimen>
<dimen name="cover_size_huge">230dp</dimen>
<dimen name="track_number_size">32dp</dimen>
<dimen name="track_number_text_size">20sp</dimen>
<dimen name="track_number_width">32dp</dimen>
<dimen name="track_number_text_size_max">20sp</dimen>
<dimen name="detail_header_size_max">26sp</dimen>
<dimen name="detail_header_size_min">10sp</dimen>'
<dimen name="detail_header_size_increment">2sp</dimen>
<dimen name="generic_size_min">10sp</dimen>'
<dimen name="generic_size_increment">2sp</dimen>
<dimen name="elevation_normal">4dp</dimen>
</resources>