From a539028ec03f607e76bee11852446a720c13de33 Mon Sep 17 00:00:00 2001 From: "Tran M. Cuong" Date: Tue, 18 Jun 2024 18:54:48 +0700 Subject: [PATCH] Change Recommendation button style & enable default showing it --- app/src/main/java/eu/kanade/domain/ui/UiPreferences.kt | 2 +- .../java/eu/kanade/presentation/manga/MangaScreen.kt | 6 ++++-- .../presentation/manga/components/MangaInfoButtons.kt | 10 +++------- .../manga/components/OutlineButtonWithArrow.kt | 7 +++++-- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/eu/kanade/domain/ui/UiPreferences.kt b/app/src/main/java/eu/kanade/domain/ui/UiPreferences.kt index a416b051d9..cefd852a67 100644 --- a/app/src/main/java/eu/kanade/domain/ui/UiPreferences.kt +++ b/app/src/main/java/eu/kanade/domain/ui/UiPreferences.kt @@ -49,7 +49,7 @@ class UiPreferences( fun expandRelatedTitles() = preferenceStore.getBoolean("expand_related_titles", true) // KMK <-- - fun recommendsInOverflow() = preferenceStore.getBoolean("recommends_in_overflow", true) + fun recommendsInOverflow() = preferenceStore.getBoolean("recommends_in_overflow", false) fun mergeInOverflow() = preferenceStore.getBoolean("merge_in_overflow", true) diff --git a/app/src/main/java/eu/kanade/presentation/manga/MangaScreen.kt b/app/src/main/java/eu/kanade/presentation/manga/MangaScreen.kt index ebccd4be5c..3ac6e33c8e 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/MangaScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/MangaScreen.kt @@ -624,7 +624,8 @@ private fun MangaScreenSmallImpl( contentType = MangaScreenItem.RELATED_TITLES, ) { OutlinedButtonWithArrow( - text = stringResource(KMR.strings.pref_source_related_mangas), + text = stringResource(KMR.strings.pref_source_related_mangas) + .uppercase(), onClick = onRelatedMangasScreenClick, ) } @@ -994,7 +995,8 @@ private fun MangaScreenLargeImpl( ) { Column { RelatedMangaTitle( - title = stringResource(KMR.strings.pref_source_related_mangas), + title = stringResource(KMR.strings.pref_source_related_mangas) + .uppercase(), subtitle = null, onClick = onRelatedMangasScreenClick, onLongClick = null, diff --git a/app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoButtons.kt b/app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoButtons.kt index 66f75c5535..0f69d2f3de 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoButtons.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoButtons.kt @@ -31,14 +31,10 @@ fun MangaInfoButtons( } } if (showRecommendsButton) { - Button( + OutlinedButtonWithArrow( + text = stringResource(SYMR.strings.az_recommends), onClick = onRecommendClicked, - Modifier - .fillMaxWidth() - .padding(horizontal = 16.dp, vertical = 4.dp), - ) { - Text(stringResource(SYMR.strings.az_recommends)) - } + ) } } } diff --git a/app/src/main/java/eu/kanade/presentation/manga/components/OutlineButtonWithArrow.kt b/app/src/main/java/eu/kanade/presentation/manga/components/OutlineButtonWithArrow.kt index cedd670f78..82da4a9a3e 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/components/OutlineButtonWithArrow.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/components/OutlineButtonWithArrow.kt @@ -33,7 +33,10 @@ fun OutlinedButtonWithArrow( onClick = onClick, modifier = modifier .fillMaxWidth() - .padding(MaterialTheme.padding.small), + .padding( + horizontal = MaterialTheme.padding.medium, + vertical = MaterialTheme.padding.small, + ), colors = ButtonDefaults.outlinedButtonColors(), shape = RoundedCornerShape(8.dp) ) { @@ -43,7 +46,7 @@ fun OutlinedButtonWithArrow( verticalAlignment = Alignment.CenterVertically ) { Text( - text = text.uppercase(), + text = text, ) Spacer(modifier = Modifier.width(4.dp)) Icon(