Skip to content

Commit

Permalink
[app] add DateTimeEngineScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
Tornaco committed May 6, 2022
1 parent 7115b76 commit 2f390f3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ fun SingleChoiceDialog(state: SingleChoiceDialogState) {
.fillMaxWidth()
.clip(RoundedCornerShape(8.dp))
.clickableWithRipple {
state.dismiss()
state.onItemClick(it.id)
}
.padding(16.dp),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,18 @@ package github.tornaco.thanos.android.module.profile.engine
import android.app.Activity
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
import androidx.compose.material.icons.filled.LockClock
import androidx.compose.material.icons.filled.Schedule
import androidx.compose.material.icons.filled.Timer
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.runtime.*
import androidx.compose.ui.res.stringResource
import github.tornaco.android.thanos.module.compose.common.theme.TypographyDefaults
import github.tornaco.android.thanos.module.compose.common.widget.*
import github.tornaco.thanos.android.module.profile.R

private class UIState {
var showCreateRegularIntervalDialog by mutableStateOf(false)
}

@Composable
Expand All @@ -42,10 +41,12 @@ fun Activity.DateTimeEngineScreen() {
val dialogState =
rememberDialogState(title = stringResource(id = R.string.module_profile_rule_new),
items = listOf(
SingleChoiceItem(id = "", icon = Icons.Filled.Schedule, label = "Time of a day"),
SingleChoiceItem(id = "", icon = Icons.Filled.Timer, label = "Regular interval"),
SingleChoiceItem(id = "", icon = Icons.Filled.Schedule, label = "Time of a day (coming soon)"),
SingleChoiceItem(id = "", icon = Icons.Filled.Timer, label = "Regular interval (coming soon)"),
),
onItemClick = {})
onItemClick = {
uiState.showCreateRegularIntervalDialog = true
})

ThanoxSmallAppBarScaffold(title = {
Text(
Expand Down Expand Up @@ -73,6 +74,15 @@ fun Activity.DateTimeEngineScreen() {
}
}


@Composable
private fun CreateRegularIntervalDialog(uiState: UIState) {
if (uiState.showCreateRegularIntervalDialog) {
// TODO Impl.
}
}


@Composable
private fun rememberUIState(): UIState {
return remember {
Expand Down

0 comments on commit 2f390f3

Please sign in to comment.