Skip to content

Commit

Permalink
fix(ui): disabled setting items should not be clickable (#543)
Browse files Browse the repository at this point in the history
  • Loading branch information
JunkFood02 authored Jan 18, 2024
1 parent b730a4f commit 3792916
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import me.ash.reader.ui.theme.palette.onDark
@Composable
fun SettingItem(
modifier: Modifier = Modifier,
enable: Boolean = true,
enabled: Boolean = true,
title: String,
desc: String? = null,
icon: ImageVector? = null,
Expand All @@ -39,8 +39,8 @@ fun SettingItem(

Surface(
modifier = modifier
.clickable { onClick() }
.alpha(if (enable) 1f else 0.5f),
.clickable(enabled = enabled) { onClick() }
.alpha(if (enabled) 1f else 0.5f),
color = Color.Unspecified
) {
Row(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ fun AddAccountsPage(
text = stringResource(R.string.services),
)
SettingItem(
enable = false,
enabled = false,
title = stringResource(R.string.feedly),
desc = stringResource(R.string.feedly_desc),
iconPainter = painterResource(id = R.drawable.ic_feedly),
onClick = {},
) {}
SettingItem(
enable = false,
enabled = false,
title = stringResource(R.string.inoreader),
desc = stringResource(R.string.inoreader_desc),
iconPainter = painterResource(id = R.drawable.ic_inoreader),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ fun FlowPageStylePage(
SettingItem(
title = stringResource(R.string.mark_as_read_button_position),
desc = stringResource(R.string.top),
enable = false,
enabled = false,
onClick = {},
) {}
SettingItem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ fun ReadingStylePage(
SettingItem(
title = stringResource(R.string.bionic_reading),
separatedActions = true,
enable = false,
enabled = false,
onClick = {
// (!articleListDesc).put(context, scope)
},
Expand All @@ -166,7 +166,7 @@ fun ReadingStylePage(
}
SettingItem(
title = stringResource(R.string.rearrange_buttons),
enable = false,
enabled = false,
onClick = {},
) {}
SettingItem(
Expand Down Expand Up @@ -219,7 +219,7 @@ fun ReadingStylePage(
title = stringResource(R.string.videos),
desc = stringResource(R.string.videos_desc),
icon = Icons.Outlined.Movie,
enable = false,
enabled = false,
onClick = {
// navController.navigate(RouteName.READING_PAGE_VIDEO) {
// launchSingleTop = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ fun ReadingTitlePage(
SettingItem(
title = stringResource(R.string.alignment),
desc = subtitleAlign.toDesc(context),
enable = false,
enabled = false,
onClick = {
// subtitleAlignDialogVisible = true
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fun InteractionPage(
SettingItem(
title = stringResource(R.string.open_link_specific_browser),
desc = openLinkSpecificBrowser.toDesc(context),
enable = isOpenLinkSpecificBrowserItemEnabled,
enabled = isOpenLinkSpecificBrowserItemEnabled,
onClick = {

if (isOpenLinkSpecificBrowserItemEnabled) {
Expand Down

0 comments on commit 3792916

Please sign in to comment.