|
|
@ -3,31 +3,14 @@ package org.tasks.compose
|
|
|
|
import android.content.res.Configuration
|
|
|
|
import android.content.res.Configuration
|
|
|
|
import androidx.annotation.StringRes
|
|
|
|
import androidx.annotation.StringRes
|
|
|
|
import androidx.compose.foundation.clickable
|
|
|
|
import androidx.compose.foundation.clickable
|
|
|
|
import androidx.compose.foundation.layout.Column
|
|
|
|
import androidx.compose.foundation.layout.*
|
|
|
|
import androidx.compose.foundation.layout.Row
|
|
|
|
|
|
|
|
import androidx.compose.foundation.layout.Spacer
|
|
|
|
|
|
|
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
|
|
|
|
|
|
import androidx.compose.foundation.layout.height
|
|
|
|
|
|
|
|
import androidx.compose.foundation.layout.padding
|
|
|
|
|
|
|
|
import androidx.compose.foundation.rememberScrollState
|
|
|
|
import androidx.compose.foundation.rememberScrollState
|
|
|
|
import androidx.compose.foundation.text.KeyboardOptions
|
|
|
|
import androidx.compose.foundation.text.KeyboardOptions
|
|
|
|
import androidx.compose.foundation.verticalScroll
|
|
|
|
import androidx.compose.foundation.verticalScroll
|
|
|
|
import androidx.compose.material.AlertDialog
|
|
|
|
import androidx.compose.material.*
|
|
|
|
import androidx.compose.material.Divider
|
|
|
|
|
|
|
|
import androidx.compose.material.Icon
|
|
|
|
|
|
|
|
import androidx.compose.material.IconButton
|
|
|
|
|
|
|
|
import androidx.compose.material.MaterialTheme
|
|
|
|
|
|
|
|
import androidx.compose.material.OutlinedTextField
|
|
|
|
|
|
|
|
import androidx.compose.material.RadioButton
|
|
|
|
|
|
|
|
import androidx.compose.material.Text
|
|
|
|
|
|
|
|
import androidx.compose.material.TextFieldDefaults
|
|
|
|
|
|
|
|
import androidx.compose.material.icons.Icons
|
|
|
|
import androidx.compose.material.icons.Icons
|
|
|
|
import androidx.compose.material.icons.outlined.Autorenew
|
|
|
|
import androidx.compose.material.icons.outlined.Autorenew
|
|
|
|
import androidx.compose.runtime.Composable
|
|
|
|
import androidx.compose.runtime.*
|
|
|
|
import androidx.compose.runtime.LaunchedEffect
|
|
|
|
|
|
|
|
import androidx.compose.runtime.MutableState
|
|
|
|
|
|
|
|
import androidx.compose.runtime.mutableStateOf
|
|
|
|
|
|
|
|
import androidx.compose.runtime.remember
|
|
|
|
|
|
|
|
import androidx.compose.runtime.saveable.rememberSaveable
|
|
|
|
import androidx.compose.runtime.saveable.rememberSaveable
|
|
|
|
import androidx.compose.ui.Alignment.Companion.CenterVertically
|
|
|
|
import androidx.compose.ui.Alignment.Companion.CenterVertically
|
|
|
|
import androidx.compose.ui.ExperimentalComposeUiApi
|
|
|
|
import androidx.compose.ui.ExperimentalComposeUiApi
|
|
|
@ -45,7 +28,7 @@ import androidx.compose.ui.text.style.TextAlign
|
|
|
|
import androidx.compose.ui.tooling.preview.Preview
|
|
|
|
import androidx.compose.ui.tooling.preview.Preview
|
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
|
import androidx.core.content.res.ResourcesCompat
|
|
|
|
import androidx.core.content.res.ResourcesCompat
|
|
|
|
import com.google.accompanist.themeadapter.appcompat.AppCompatTheme
|
|
|
|
import com.google.android.material.composethemeadapter.MdcTheme
|
|
|
|
import com.todoroo.astrid.ui.ReminderControlSetViewModel.ViewState
|
|
|
|
import com.todoroo.astrid.ui.ReminderControlSetViewModel.ViewState
|
|
|
|
import kotlinx.coroutines.android.awaitFrame
|
|
|
|
import kotlinx.coroutines.android.awaitFrame
|
|
|
|
import org.tasks.R
|
|
|
|
import org.tasks.R
|
|
|
@ -550,7 +533,7 @@ fun AddAlarmDialog(
|
|
|
|
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
|
|
|
|
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
fun AddCustomReminderOne() =
|
|
|
|
fun AddCustomReminderOne() =
|
|
|
|
AppCompatTheme {
|
|
|
|
MdcTheme {
|
|
|
|
AddReminderDialog.AddCustomReminder(
|
|
|
|
AddReminderDialog.AddCustomReminder(
|
|
|
|
time = remember { mutableStateOf(1) },
|
|
|
|
time = remember { mutableStateOf(1) },
|
|
|
|
units = remember { mutableStateOf(0) },
|
|
|
|
units = remember { mutableStateOf(0) },
|
|
|
@ -566,7 +549,7 @@ fun AddCustomReminderOne() =
|
|
|
|
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
|
|
|
|
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
fun AddCustomReminder() =
|
|
|
|
fun AddCustomReminder() =
|
|
|
|
AppCompatTheme {
|
|
|
|
MdcTheme {
|
|
|
|
AddReminderDialog.AddCustomReminder(
|
|
|
|
AddReminderDialog.AddCustomReminder(
|
|
|
|
time = remember { mutableStateOf(15) },
|
|
|
|
time = remember { mutableStateOf(15) },
|
|
|
|
units = remember { mutableStateOf(1) },
|
|
|
|
units = remember { mutableStateOf(1) },
|
|
|
@ -582,7 +565,7 @@ fun AddCustomReminder() =
|
|
|
|
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
|
|
|
|
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
fun AddRepeatingReminderOne() =
|
|
|
|
fun AddRepeatingReminderOne() =
|
|
|
|
AppCompatTheme {
|
|
|
|
MdcTheme {
|
|
|
|
AddReminderDialog.AddRecurringReminder(
|
|
|
|
AddReminderDialog.AddRecurringReminder(
|
|
|
|
openDialog = true,
|
|
|
|
openDialog = true,
|
|
|
|
interval = remember { mutableStateOf(1) },
|
|
|
|
interval = remember { mutableStateOf(1) },
|
|
|
@ -596,7 +579,7 @@ fun AddRepeatingReminderOne() =
|
|
|
|
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
|
|
|
|
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
fun AddRepeatingReminder() =
|
|
|
|
fun AddRepeatingReminder() =
|
|
|
|
AppCompatTheme {
|
|
|
|
MdcTheme {
|
|
|
|
AddReminderDialog.AddRecurringReminder(
|
|
|
|
AddReminderDialog.AddRecurringReminder(
|
|
|
|
openDialog = true,
|
|
|
|
openDialog = true,
|
|
|
|
interval = remember { mutableStateOf(15) },
|
|
|
|
interval = remember { mutableStateOf(15) },
|
|
|
@ -610,7 +593,7 @@ fun AddRepeatingReminder() =
|
|
|
|
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
|
|
|
|
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
fun AddRandomReminderOne() =
|
|
|
|
fun AddRandomReminderOne() =
|
|
|
|
AppCompatTheme {
|
|
|
|
MdcTheme {
|
|
|
|
AddReminderDialog.AddRandomReminder(
|
|
|
|
AddReminderDialog.AddRandomReminder(
|
|
|
|
time = remember { mutableStateOf(1) },
|
|
|
|
time = remember { mutableStateOf(1) },
|
|
|
|
units = remember { mutableStateOf(0) }
|
|
|
|
units = remember { mutableStateOf(0) }
|
|
|
@ -622,7 +605,7 @@ fun AddRandomReminderOne() =
|
|
|
|
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
|
|
|
|
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
fun AddRandomReminder() =
|
|
|
|
fun AddRandomReminder() =
|
|
|
|
AppCompatTheme {
|
|
|
|
MdcTheme {
|
|
|
|
AddReminderDialog.AddRandomReminder(
|
|
|
|
AddReminderDialog.AddRandomReminder(
|
|
|
|
time = remember { mutableStateOf(15) },
|
|
|
|
time = remember { mutableStateOf(15) },
|
|
|
|
units = remember { mutableStateOf(1) }
|
|
|
|
units = remember { mutableStateOf(1) }
|
|
|
@ -633,7 +616,7 @@ fun AddRandomReminder() =
|
|
|
|
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
|
|
|
|
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
fun AddReminderDialog() =
|
|
|
|
fun AddReminderDialog() =
|
|
|
|
AppCompatTheme {
|
|
|
|
MdcTheme {
|
|
|
|
AddAlarmDialog(
|
|
|
|
AddAlarmDialog(
|
|
|
|
viewState = ViewState(showAddAlarm = true),
|
|
|
|
viewState = ViewState(showAddAlarm = true),
|
|
|
|
existingAlarms = emptyList(),
|
|
|
|
existingAlarms = emptyList(),
|
|
|
|