Fix title jumping around when refreshing (#5328)

This commit is contained in:
Andreas 2021-06-06 16:29:28 +02:00 committed by GitHub
parent f2e4b2fc99
commit de50f53be4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 5 deletions

View File

@ -288,6 +288,8 @@ class MangaInfoHeaderAdapter(
if (initialLoad && (fromSource || isTablet)) {
toggleMangaInfo()
initialLoad = false
// wrap_content and autoFixTextSize can cause unwanted behaviour this tries to solve it
binding.mangaFullTitle.requestLayout()
}
// Refreshes will change the state and it needs to be set to correct state to display correctly

View File

@ -61,10 +61,9 @@
android:id="@+id/manga_full_title"
style="@style/TextAppearance.Medium.Title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="60sp"
android:layout_marginBottom="4dp"
android:gravity="bottom"
android:maxLines="3"
android:text="@string/manga_info_full_title_label"
android:textIsSelectable="false"
app:autoSizeMaxTextSize="20sp"
@ -85,14 +84,14 @@
style="@style/TextAppearance.Regular.Body1.Secondary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:textIsSelectable="false"
tools:text="Artist" />
<LinearLayout
android:id="@+id/manga_status_row"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_marginTop="4dp">
<TextView
android:id="@+id/manga_status"
@ -172,12 +171,12 @@
android:id="@+id/manga_summary_section"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
app:layoutDescription="@xml/manga_summary_section_scene"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btn_favorite">
<TextView
android:id="@+id/manga_summary_text"
style="@style/TextAppearance.Regular.Body1.Secondary"

View File

@ -33,6 +33,7 @@
android:id="@+id/manga_summary_section"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
motion:layout_constraintEnd_toEndOf="parent"
motion:layout_constraintStart_toStartOf="parent"
motion:layout_constraintTop_toBottomOf="@+id/btn_favorite"
@ -126,6 +127,7 @@
android:id="@+id/manga_summary_section"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
motion:layout_constraintEnd_toEndOf="parent"
motion:layout_constraintStart_toStartOf="parent"
motion:layout_constraintTop_toBottomOf="@+id/btn_favorite"