Skip to content

Commit

Permalink
Make list items in Settings clickable (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmedalijaK authored Feb 21, 2025
1 parent 5c328f6 commit 6e5d401
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ fun AppearanceSettingsScreen(
},
)
},
onClick = {
eventPublisher(
UiEvent.ToggleAutoAdjustDarkTheme(
enabled = !state.selectedThemeName.isNullOrEmpty(),
isSystemInDarkTheme = isSystemInDarkTheme,
),
)
},
)

PrimalDivider(modifier = Modifier.padding(horizontal = 8.dp))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ private fun ContentDisplaySettingsScreen(
},
)
},
onClick = {
eventPublisher(
UiEvent.UpdateAutoPlayVideos(
code = if (state.autoPlayVideos != ContentDisplaySettings.AUTO_PLAY_VIDEO_ALWAYS) {
ContentDisplaySettings.AUTO_PLAY_VIDEO_ALWAYS
} else {
ContentDisplaySettings.AUTO_PLAY_VIDEO_NEVER
},
),
)
},
)

Spacer(modifier = Modifier.height(8.dp))
Expand All @@ -103,6 +114,9 @@ private fun ContentDisplaySettingsScreen(
},
)
},
onClick = {
eventPublisher(UiEvent.UpdateShowAnimatedAvatars(enabled = !state.showAnimatedAvatars))
},
)

Spacer(modifier = Modifier.height(8.dp))
Expand All @@ -118,6 +132,9 @@ private fun ContentDisplaySettingsScreen(
},
)
},
onClick = {
eventPublisher(UiEvent.UpdateShowFocusMode(enabled = !state.focusMode))
},
)

Spacer(modifier = Modifier.height(8.dp))
Expand All @@ -136,6 +153,9 @@ private fun ContentDisplaySettingsScreen(
},
)
},
onClick = {
eventPublisher(UiEvent.UpdateEnableTweetMode(enabled = !state.tweetMode))
},
)
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ private fun LazyListScope.enhancedPrivacyItem(checked: Boolean, onCheckedChanged
trailingContent = {
PrimalSwitch(checked = checked, onCheckedChange = onCheckedChanged)
},
onClick = {
onCheckedChanged(!checked)
},
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package net.primal.android.settings.notifications
import android.widget.Toast
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
Expand Down Expand Up @@ -141,6 +142,14 @@ fun NotificationsSettingsBlock(
Row(
modifier = Modifier
.fillMaxWidth()
.clickable {
eventPublisher(
NotificationsSettingsContract.UiEvent.NotificationSettingChanged(
type = notificationSwitchUi.notificationType,
value = !notificationSwitchUi.enabled,
),
)
}
.padding(horizontal = 16.dp),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically,
Expand Down

0 comments on commit 6e5d401

Please sign in to comment.