Change banner appearance
This commit is contained in:
parent
47a93cc98a
commit
b866d54503
@ -2,10 +2,7 @@ package de.mm20.launcher2.ui.component
|
||||
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.*
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
@ -13,6 +10,7 @@ import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun Banner(
|
||||
modifier: Modifier = Modifier,
|
||||
@ -21,12 +19,9 @@ fun Banner(
|
||||
primaryAction: @Composable () -> Unit,
|
||||
secondaryAction: @Composable () -> Unit = {}
|
||||
) {
|
||||
Surface(
|
||||
Card(
|
||||
modifier = modifier,
|
||||
color = MaterialTheme.colorScheme.secondaryContainer,
|
||||
shape = RoundedCornerShape(8.dp),
|
||||
shadowElevation = 2.dp,
|
||||
tonalElevation = 2.dp
|
||||
shape = MaterialTheme.shapes.small,
|
||||
) {
|
||||
Column {
|
||||
Row(
|
||||
@ -44,7 +39,7 @@ fun Banner(
|
||||
.weight(1f)
|
||||
.padding(vertical = 16.dp)
|
||||
.padding(end = 16.dp),
|
||||
style = MaterialTheme.typography.bodyMedium.copy(fontWeight = FontWeight.Medium)
|
||||
style = MaterialTheme.typography.labelMedium
|
||||
)
|
||||
}
|
||||
Row(
|
||||
|
||||
@ -3,8 +3,8 @@ package de.mm20.launcher2.ui.component
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.rounded.Lock
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
@ -23,7 +23,7 @@ fun MissingPermissionBanner(
|
||||
text = text,
|
||||
icon = Icons.Rounded.Lock,
|
||||
primaryAction = {
|
||||
TextButton(
|
||||
Button(
|
||||
modifier = Modifier.padding(start = 8.dp),
|
||||
onClick = onClick
|
||||
) {
|
||||
|
||||
@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.ColumnScope
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.OutlinedButton
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
@ -44,7 +45,7 @@ fun ColumnScope.AppShortcutResults(reverse: Boolean = false) {
|
||||
onClick = { viewModel.requestAppShortcutPermission(context as AppCompatActivity) },
|
||||
modifier = Modifier.padding(16.dp),
|
||||
secondaryAction = {
|
||||
TextButton(onClick = {
|
||||
OutlinedButton(onClick = {
|
||||
viewModel.disableAppShortcutSearch()
|
||||
}) {
|
||||
Text(
|
||||
|
||||
@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.ColumnScope
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.OutlinedButton
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
@ -44,7 +45,7 @@ fun ColumnScope.CalendarResults(reverse: Boolean = false) {
|
||||
onClick = { viewModel.requestCalendarPermission(context as AppCompatActivity) },
|
||||
modifier = Modifier.padding(16.dp),
|
||||
secondaryAction = {
|
||||
TextButton(onClick = {
|
||||
OutlinedButton(onClick = {
|
||||
viewModel.disableCalendarSearch()
|
||||
}) {
|
||||
Text(
|
||||
|
||||
@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.ColumnScope
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.OutlinedButton
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
@ -44,7 +45,7 @@ fun ColumnScope.ContactResults(reverse: Boolean = false) {
|
||||
onClick = { viewModel.requestContactsPermission(context as AppCompatActivity) },
|
||||
modifier = Modifier.padding(16.dp),
|
||||
secondaryAction = {
|
||||
TextButton(onClick = {
|
||||
OutlinedButton(onClick = {
|
||||
viewModel.disableContactsSearch()
|
||||
}) {
|
||||
Text(
|
||||
|
||||
@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.ColumnScope
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.OutlinedButton
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
@ -44,7 +45,7 @@ fun ColumnScope.FileResults(reverse: Boolean = false) {
|
||||
onClick = { viewModel.requestFilesPermission(context as AppCompatActivity) },
|
||||
modifier = Modifier.padding(16.dp),
|
||||
secondaryAction = {
|
||||
TextButton(onClick = {
|
||||
OutlinedButton(onClick = {
|
||||
viewModel.disableFilesSearch()
|
||||
}) {
|
||||
Text(
|
||||
|
||||
@ -69,7 +69,7 @@ fun WeatherWidget() {
|
||||
viewModel.requestLocationPermission(context as AppCompatActivity)
|
||||
},
|
||||
secondaryAction = {
|
||||
TextButton(onClick = {
|
||||
OutlinedButton(onClick = {
|
||||
showLocationDialog = true
|
||||
}) {
|
||||
Text(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user