diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/MangaChaptersHeaderAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/MangaChaptersHeaderAdapter.kt index 067b1e953..db09d9597 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/MangaChaptersHeaderAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/MangaChaptersHeaderAdapter.kt @@ -66,7 +66,7 @@ class MangaChaptersHeaderAdapter( } else { view.context.getResourceColor(R.attr.colorOnPrimary) } - DrawableCompat.setTint(binding.btnChaptersFilter.icon, filterColor) + DrawableCompat.setTint(binding.btnChaptersFilter.drawable, filterColor) merge(view.clicks(), binding.btnChaptersFilter.clicks()) .onEach { controller.showSettingsSheet() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt index 972c951f1..88b1eeca2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt @@ -105,13 +105,27 @@ class MangaInfoHeaderAdapter( isVisible = true if (trackCount > 0) { - setIconResource(R.drawable.ic_done_24dp) - text = view.context.resources.getQuantityString(R.plurals.num_trackers, trackCount, trackCount) - isChecked = true + setCompoundDrawablesWithIntrinsicBounds( + null, + ContextCompat.getDrawable(context, R.drawable.ic_done_24dp), + null, + null + ) + text = view.context.resources.getQuantityString( + R.plurals.num_trackers, + trackCount, + trackCount + ) + isSelected = true } else { - setIconResource(R.drawable.ic_sync_24dp) + setCompoundDrawablesWithIntrinsicBounds( + null, + ContextCompat.getDrawable(context, R.drawable.ic_sync_24dp), + null, + null + ) text = view.context.getString(R.string.manga_tracking_tab) - isChecked = false + isSelected = false } clicks() @@ -279,14 +293,24 @@ class MangaInfoHeaderAdapter( // Update genres list if (!manga.genre.isNullOrBlank()) { - binding.mangaGenresTagsCompactChips.setChips(manga.getGenres(), controller::performSearch) - binding.mangaGenresTagsFullChips.setChips(manga.getGenres(), controller::performSearch) + binding.mangaGenresTagsCompactChips.setChips( + manga.getGenres(), + controller::performSearch + ) + binding.mangaGenresTagsFullChips.setChips( + manga.getGenres(), + controller::performSearch + ) } else { binding.mangaGenresTagsWrapper.isVisible = false } // Handle showing more or less info - merge(binding.mangaSummarySection.clicks(), binding.mangaSummaryText.clicks(), binding.mangaInfoToggle.clicks()) + merge( + binding.mangaSummarySection.clicks(), + binding.mangaSummaryText.clicks(), + binding.mangaInfoToggle.clicks() + ) .onEach { toggleMangaInfo(view.context) } .launchIn(scope) @@ -304,20 +328,22 @@ class MangaInfoHeaderAdapter( private fun toggleMangaInfo(context: Context) { val isExpanded = - binding.mangaInfoToggle.text == context.getString(R.string.manga_info_collapse) + binding.mangaInfoToggle.contentDescription == context.getString(R.string.manga_info_collapse) with(binding.mangaInfoToggle) { - text = if (isExpanded) { + contentDescription = if (isExpanded) { context.getString(R.string.manga_info_expand) } else { context.getString(R.string.manga_info_collapse) } - icon = if (isExpanded) { - context.getDrawable(R.drawable.ic_baseline_expand_more_24dp) - } else { - context.getDrawable(R.drawable.ic_baseline_expand_less_24dp) - } + setImageDrawable( + if (isExpanded) { + context.getDrawable(R.drawable.ic_baseline_expand_more_24dp) + } else { + context.getDrawable(R.drawable.ic_baseline_expand_less_24dp) + } + ) } with(binding.mangaSummaryText) { @@ -349,13 +375,18 @@ class MangaInfoHeaderAdapter( // Set the Favorite drawable to the correct one. // Border drawable if false, filled drawable if true. binding.btnFavorite.apply { - icon = ContextCompat.getDrawable( - context, - if (isFavorite) R.drawable.ic_favorite_24dp else R.drawable.ic_favorite_border_24dp + setCompoundDrawablesWithIntrinsicBounds( + null, + ContextCompat.getDrawable( + context, + if (isFavorite) R.drawable.ic_favorite_24dp else R.drawable.ic_favorite_border_24dp + ), + null, + null ) text = context.getString(if (isFavorite) R.string.in_library else R.string.add_to_library) - isChecked = isFavorite + isSelected = isFavorite } } } diff --git a/app/src/main/res/color/outlined_button_stroke.xml b/app/src/main/res/color/outlined_button_stroke.xml deleted file mode 100644 index 0702ae4c0..000000000 --- a/app/src/main/res/color/outlined_button_stroke.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/app/src/main/res/layout/manga_chapters_header.xml b/app/src/main/res/layout/manga_chapters_header.xml index 8da2f17dd..5f580b13c 100644 --- a/app/src/main/res/layout/manga_chapters_header.xml +++ b/app/src/main/res/layout/manga_chapters_header.xml @@ -23,16 +23,16 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - + app:layout_constraintTop_toTopOf="parent" + app:srcCompat="@drawable/ic_filter_list_24dp" + app:tint="?attr/colorOnPrimary" /> diff --git a/app/src/main/res/layout/manga_info_header.xml b/app/src/main/res/layout/manga_info_header.xml index 7f7319a16..80ceb2b4e 100644 --- a/app/src/main/res/layout/manga_info_header.xml +++ b/app/src/main/res/layout/manga_info_header.xml @@ -15,6 +15,7 @@ android:id="@+id/backdrop" android:layout_width="0dp" android:layout_height="0dp" + android:layout_marginBottom="?attr/actionBarSize" android:alpha="0.2" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" @@ -25,6 +26,7 @@ @@ -33,7 +35,10 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" - android:padding="16dp" + android:paddingStart="16dp" + android:paddingTop="64dp" + android:paddingEnd="16dp" + android:paddingBottom="16dp" app:layout_constraintTop_toTopOf="parent"> + android:layout_marginBottom="16dp" + android:orientation="vertical"> @@ -84,80 +88,93 @@ android:textIsSelectable="false" tools:text="Artist" /> - + android:layout_marginTop="4dp"> - + + + + + + + - + + + + + android:checkable="true" + android:text="@string/add_to_library" + app:drawableTopCompat="@drawable/ic_favorite_border_24dp" + app:layout_constraintEnd_toStartOf="@+id/btn_tracking" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - + - - - - - - - - - + @@ -165,6 +182,7 @@ android:id="@+id/manga_summary_section" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_marginTop="8dp" android:background="?attr/selectableItemBackground" android:orientation="vertical"> @@ -174,31 +192,18 @@ android:paddingStart="16dp" android:paddingEnd="16dp"> - - - + app:layout_constraintTop_toTopOf="parent" + app:srcCompat="@drawable/ic_baseline_expand_more_24dp" + app:tint="?attr/colorOnPrimary" /> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7e1bfd788..310852085 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -83,6 +83,7 @@ Move Open in browser Open in WebView + WebView Open in Settings Migrate Display mode @@ -485,7 +486,6 @@ Title Added to library Removed from library - About More Less diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 9a3845cba..51874a7af 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -96,15 +96,7 @@ - - - - - - -