mirror of https://github.com/tasks/tasks
Delete some compose stuff
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),
|
||||
)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue