Able to move 'Merge' button to overflow menu (#655)
This commit is contained in:
parent
9051178701
commit
ad6ffe4fec
@ -302,6 +302,7 @@ private fun MangaScreenSmallImpl(
|
|||||||
onRecommendClicked = onRecommendClicked,
|
onRecommendClicked = onRecommendClicked,
|
||||||
showMergeSettings = state.manga.source == MERGED_SOURCE_ID,
|
showMergeSettings = state.manga.source == MERGED_SOURCE_ID,
|
||||||
onMergedSettingsClicked = onMergedSettingsClicked,
|
onMergedSettingsClicked = onMergedSettingsClicked,
|
||||||
|
onMergeClicked = onMergeClicked.takeIf { state.showMergeInOverflow },
|
||||||
// SY <--
|
// SY <--
|
||||||
actionModeCounter = chapters.count { it.selected },
|
actionModeCounter = chapters.count { it.selected },
|
||||||
onSelectAll = { onAllChapterSelected(true) },
|
onSelectAll = { onAllChapterSelected(true) },
|
||||||
@ -404,7 +405,7 @@ private fun MangaScreenSmallImpl(
|
|||||||
onTrackingClicked = onTrackingClicked,
|
onTrackingClicked = onTrackingClicked,
|
||||||
onEditCategory = onEditCategoryClicked,
|
onEditCategory = onEditCategoryClicked,
|
||||||
// SY -->
|
// SY -->
|
||||||
onMergeClicked = onMergeClicked,
|
onMergeClicked = onMergeClicked.takeUnless { state.showMergeInOverflow },
|
||||||
// SY <--
|
// SY <--
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -597,6 +598,7 @@ fun MangaScreenLargeImpl(
|
|||||||
onRecommendClicked = onRecommendClicked,
|
onRecommendClicked = onRecommendClicked,
|
||||||
showMergeSettings = state.manga.source == MERGED_SOURCE_ID,
|
showMergeSettings = state.manga.source == MERGED_SOURCE_ID,
|
||||||
onMergedSettingsClicked = onMergedSettingsClicked,
|
onMergedSettingsClicked = onMergedSettingsClicked,
|
||||||
|
onMergeClicked = onMergeClicked.takeIf { state.showMergeInOverflow },
|
||||||
// SY <--
|
// SY <--
|
||||||
actionModeCounter = chapters.count { it.selected },
|
actionModeCounter = chapters.count { it.selected },
|
||||||
onSelectAll = { onAllChapterSelected(true) },
|
onSelectAll = { onAllChapterSelected(true) },
|
||||||
@ -678,7 +680,7 @@ fun MangaScreenLargeImpl(
|
|||||||
onTrackingClicked = onTrackingClicked,
|
onTrackingClicked = onTrackingClicked,
|
||||||
onEditCategory = onEditCategoryClicked,
|
onEditCategory = onEditCategoryClicked,
|
||||||
// SY -->
|
// SY -->
|
||||||
onMergeClicked = onMergeClicked,
|
onMergeClicked = onMergeClicked.takeUnless { state.showMergeInOverflow },
|
||||||
// SY <--
|
// SY <--
|
||||||
)
|
)
|
||||||
// SY -->
|
// SY -->
|
||||||
|
@ -55,6 +55,7 @@ fun MangaAppBar(
|
|||||||
onEditInfoClicked: () -> Unit,
|
onEditInfoClicked: () -> Unit,
|
||||||
showRecommends: Boolean,
|
showRecommends: Boolean,
|
||||||
onRecommendClicked: () -> Unit,
|
onRecommendClicked: () -> Unit,
|
||||||
|
onMergeClicked: (() -> Unit)?,
|
||||||
showMergeSettings: Boolean,
|
showMergeSettings: Boolean,
|
||||||
onMergedSettingsClicked: () -> Unit,
|
onMergedSettingsClicked: () -> Unit,
|
||||||
// SY <--
|
// SY <--
|
||||||
@ -205,6 +206,15 @@ fun MangaAppBar(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (onMergeClicked != null) {
|
||||||
|
DropdownMenuItem(
|
||||||
|
text = { Text(text = stringResource(R.string.merge)) },
|
||||||
|
onClick = {
|
||||||
|
onMergeClicked()
|
||||||
|
onDismissRequest()
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
if (showEditInfo) {
|
if (showEditInfo) {
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
text = { Text(text = stringResource(R.string.action_edit_info)) },
|
text = { Text(text = stringResource(R.string.action_edit_info)) },
|
||||||
|
@ -163,7 +163,7 @@ fun MangaActionRow(
|
|||||||
onTrackingClicked: (() -> Unit)?,
|
onTrackingClicked: (() -> Unit)?,
|
||||||
onEditCategory: (() -> Unit)?,
|
onEditCategory: (() -> Unit)?,
|
||||||
// SY -->
|
// SY -->
|
||||||
onMergeClicked: () -> Unit,
|
onMergeClicked: (() -> Unit)?,
|
||||||
// SY <--
|
// SY <--
|
||||||
) {
|
) {
|
||||||
Row(modifier = modifier.padding(start = 16.dp, top = 8.dp, end = 16.dp)) {
|
Row(modifier = modifier.padding(start = 16.dp, top = 8.dp, end = 16.dp)) {
|
||||||
@ -200,12 +200,14 @@ fun MangaActionRow(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
// SY -->
|
// SY -->
|
||||||
|
if (onMergeClicked != null) {
|
||||||
MangaActionButton(
|
MangaActionButton(
|
||||||
title = stringResource(R.string.merge),
|
title = stringResource(R.string.merge),
|
||||||
icon = Icons.Outlined.CallMerge,
|
icon = Icons.Outlined.CallMerge,
|
||||||
color = defaultActionButtonColor,
|
color = defaultActionButtonColor,
|
||||||
onClick = onMergeClicked,
|
onClick = onMergeClicked,
|
||||||
)
|
)
|
||||||
|
}
|
||||||
// SY <--
|
// SY <--
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -453,6 +453,8 @@ class PreferencesHelper(val context: Context) {
|
|||||||
|
|
||||||
fun recommendsInOverflow() = flowPrefs.getBoolean("recommends_in_overflow", false)
|
fun recommendsInOverflow() = flowPrefs.getBoolean("recommends_in_overflow", false)
|
||||||
|
|
||||||
|
fun mergeInOverflow() = flowPrefs.getBoolean("merge_in_overflow", false)
|
||||||
|
|
||||||
fun enhancedEHentaiView() = flowPrefs.getBoolean("enhanced_e_hentai_view", true)
|
fun enhancedEHentaiView() = flowPrefs.getBoolean("enhanced_e_hentai_view", true)
|
||||||
|
|
||||||
fun webtoonEnableZoomOut() = flowPrefs.getBoolean("webtoon_enable_zoom_out", false)
|
fun webtoonEnableZoomOut() = flowPrefs.getBoolean("webtoon_enable_zoom_out", false)
|
||||||
|
@ -271,6 +271,7 @@ class MangaPresenter(
|
|||||||
isDownloadedOnlyMode = downloadedOnlyMode,
|
isDownloadedOnlyMode = downloadedOnlyMode,
|
||||||
// SY -->
|
// SY -->
|
||||||
showRecommendationsInOverflow = preferences.recommendsInOverflow().get(),
|
showRecommendationsInOverflow = preferences.recommendsInOverflow().get(),
|
||||||
|
showMergeInOverflow = preferences.mergeInOverflow().get(),
|
||||||
showMergeWithAnother = smartSearched,
|
showMergeWithAnother = smartSearched,
|
||||||
mergedData = null,
|
mergedData = null,
|
||||||
meta = null,
|
meta = null,
|
||||||
@ -1539,6 +1540,7 @@ sealed class MangaScreenState {
|
|||||||
val meta: RaisedSearchMetadata?,
|
val meta: RaisedSearchMetadata?,
|
||||||
val mergedData: MergedMangaData?,
|
val mergedData: MergedMangaData?,
|
||||||
val showRecommendationsInOverflow: Boolean,
|
val showRecommendationsInOverflow: Boolean,
|
||||||
|
val showMergeInOverflow: Boolean,
|
||||||
val showMergeWithAnother: Boolean,
|
val showMergeWithAnother: Boolean,
|
||||||
val pagePreviewsState: PagePreviewState,
|
val pagePreviewsState: PagePreviewState,
|
||||||
// SY <--
|
// SY <--
|
||||||
|
@ -106,6 +106,12 @@ class SettingsGeneralController : SettingsController() {
|
|||||||
titleRes = R.string.put_recommends_in_overflow
|
titleRes = R.string.put_recommends_in_overflow
|
||||||
summaryRes = R.string.put_recommends_in_overflow_summary
|
summaryRes = R.string.put_recommends_in_overflow_summary
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switchPreference {
|
||||||
|
bindTo(preferences.mergeInOverflow())
|
||||||
|
titleRes = R.string.put_merge_in_overflow
|
||||||
|
summaryRes = R.string.put_merge_in_overflow_summary
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// <-- EXH
|
// <-- EXH
|
||||||
}
|
}
|
||||||
|
@ -174,6 +174,8 @@
|
|||||||
<string name="auto_solve_captchas_summary">Use HIGHLY EXPERIMENTAL automatic ReCAPTCHA solver. Will be grayed out if unsupported by your device.</string>
|
<string name="auto_solve_captchas_summary">Use HIGHLY EXPERIMENTAL automatic ReCAPTCHA solver. Will be grayed out if unsupported by your device.</string>
|
||||||
<string name="put_recommends_in_overflow">Recommendations in overflow</string>
|
<string name="put_recommends_in_overflow">Recommendations in overflow</string>
|
||||||
<string name="put_recommends_in_overflow_summary">Put the recommendations button in the overflow menu instead of on the manga page</string>
|
<string name="put_recommends_in_overflow_summary">Put the recommendations button in the overflow menu instead of on the manga page</string>
|
||||||
|
<string name="put_merge_in_overflow">Merge in overflow</string>
|
||||||
|
<string name="put_merge_in_overflow_summary">Put the merge button in the overflow menu instead of on the manga page</string>
|
||||||
|
|
||||||
<!-- Appearance Settings -->
|
<!-- Appearance Settings -->
|
||||||
<string name="pref_category_navbar">Navbar</string>
|
<string name="pref_category_navbar">Navbar</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user