Delete some compose stuff

pull/1957/head
Alex Baker 2 years ago
parent 2ee7715c16
commit 8ed2880953

@ -1,43 +0,0 @@
package org.tasks.compose
import android.content.res.Configuration
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.material.darkColors
import androidx.compose.material.lightColors
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
@Composable
fun AlarmRow(text: String, remove: () -> Unit = {}) {
Row(
modifier = Modifier
.fillMaxWidth()
) {
Text(
text = text,
modifier = Modifier
.padding(vertical = 12.dp)
.weight(weight = 1f),
)
ClearButton(onClick = remove)
}
}
@Preview(showBackground = true)
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
fun AlarmRowPreview() {
MaterialTheme(if (isSystemInDarkTheme()) darkColors() else lightColors()) {
AlarmRow(text = "When due") {
}
}
}

@ -1,65 +0,0 @@
package org.tasks.compose
import androidx.compose.material.Icon
import androidx.compose.material.IconButton
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import org.tasks.R
import org.tasks.compose.TopAppBar.TopAppBar
import org.tasks.themes.ThemeColor
@Preview
@Composable
private fun DarkAppBar() {
TopAppBar(
title = R.string.upgrade_to_pro,
icon = R.drawable.ic_outline_arrow_back_24px,
color = ThemeColor(LocalContext.current, 0),
onClickNavigation = {},
)
}
@Preview
@Composable
private fun LightAppBar() {
TopAppBar(
title = R.string.BFE_Active,
icon = R.drawable.ic_outline_menu_24px,
color = ThemeColor(LocalContext.current, -1),
onClickNavigation = {},
)
}
object TopAppBar {
@Composable
fun TopAppBar(
title: Int,
icon: Int,
color: ThemeColor,
onClickNavigation: () -> Unit = {}
) {
androidx.compose.material.TopAppBar(
title = {
Text(stringResource(title))
},
backgroundColor = Color(color.primaryColor),
contentColor = Color(color.colorOnPrimary),
navigationIcon = {
IconButton(
onClick = onClickNavigation,
) {
Icon(
painter = painterResource(icon),
contentDescription = stringResource(R.string.back),
tint = Color(color.colorOnPrimary),
)
}
},
)
}
}

@ -23,10 +23,7 @@ import com.google.accompanist.permissions.PermissionStatus
import com.google.android.material.composethemeadapter.MdcTheme
import com.todoroo.astrid.ui.ReminderControlSetViewModel
import org.tasks.R
import org.tasks.compose.AddReminderDialog
import org.tasks.compose.DisabledText
import org.tasks.compose.TaskEditRow
import org.tasks.compose.collectAsStateLifecycleAware
import org.tasks.compose.*
import org.tasks.data.Alarm
import org.tasks.reminders.AlarmToString
import java.util.*
@ -110,7 +107,7 @@ fun Alarms(
Column {
Spacer(modifier = Modifier.height(8.dp))
alarms.forEach { alarm ->
org.tasks.compose.AlarmRow(AlarmToString(LocalContext.current, locale).toString(alarm)) {
AlarmRow(AlarmToString(LocalContext.current, locale).toString(alarm)) {
deleteAlarm(alarm)
}
}
@ -152,6 +149,22 @@ fun Alarms(
}
}
@Composable
private fun AlarmRow(text: String, remove: () -> Unit = {}) {
Row(
modifier = Modifier
.fillMaxWidth()
) {
Text(
text = text,
modifier = Modifier
.padding(vertical = 12.dp)
.weight(weight = 1f),
)
ClearButton(onClick = remove)
}
}
@OptIn(ExperimentalPermissionsApi::class)
@Preview(showBackground = true, widthDp = 320)
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 320)

Loading…
Cancel
Save