Moving to Material3 colors
This commit is contained in:
@@ -58,7 +58,6 @@ private fun AboutScreen(onBack: () -> Unit) {
|
|||||||
title = {
|
title = {
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.about_title),
|
text = stringResource(R.string.about_title),
|
||||||
color = LocalCustomColors.current.light,
|
|
||||||
fontWeight = FontWeight.Bold
|
fontWeight = FontWeight.Bold
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
@@ -67,12 +66,13 @@ private fun AboutScreen(onBack: () -> Unit) {
|
|||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
|
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
tint = LocalCustomColors.current.light
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
colors = TopAppBarDefaults.topAppBarColors(
|
colors = TopAppBarDefaults.topAppBarColors(
|
||||||
containerColor = LocalCustomColors.current.primary
|
containerColor = LocalCustomColors.current.primary,
|
||||||
|
titleContentColor = LocalCustomColors.current.onPrimary,
|
||||||
|
navigationIconContentColor = LocalCustomColors.current.onPrimary,
|
||||||
),
|
),
|
||||||
windowInsets = WindowInsets(0, 0, 0, 0)
|
windowInsets = WindowInsets(0, 0, 0, 0)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.tutpro.baresip
|
package com.tutpro.baresip
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.compose.foundation.Image
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
@@ -15,18 +14,19 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|||||||
import androidx.compose.foundation.layout.imePadding
|
import androidx.compose.foundation.layout.imePadding
|
||||||
import androidx.compose.foundation.layout.navigationBarsPadding
|
import androidx.compose.foundation.layout.navigationBarsPadding
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
|
||||||
import androidx.compose.foundation.layout.statusBars
|
import androidx.compose.foundation.layout.statusBars
|
||||||
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.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||||
|
import androidx.compose.material.icons.filled.Add
|
||||||
import androidx.compose.material.icons.filled.Delete
|
import androidx.compose.material.icons.filled.Delete
|
||||||
import androidx.compose.material.icons.outlined.Clear
|
import androidx.compose.material.icons.outlined.Clear
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.OutlinedTextField
|
import androidx.compose.material3.OutlinedTextField
|
||||||
import androidx.compose.material3.Scaffold
|
import androidx.compose.material3.Scaffold
|
||||||
import androidx.compose.material3.SmallFloatingActionButton
|
import androidx.compose.material3.SmallFloatingActionButton
|
||||||
@@ -40,10 +40,8 @@ import androidx.compose.runtime.remember
|
|||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.layout.ContentScale
|
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.platform.LocalFocusManager
|
import androidx.compose.ui.platform.LocalFocusManager
|
||||||
import androidx.compose.ui.res.painterResource
|
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.TextStyle
|
import androidx.compose.ui.text.TextStyle
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
@@ -109,7 +107,6 @@ fun AccountsScreen(navController: NavController) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun AccountsContent(contentPadding: PaddingValues, navController: NavController) {
|
fun AccountsContent(contentPadding: PaddingValues, navController: NavController) {
|
||||||
|
|
||||||
@@ -174,8 +171,8 @@ fun AccountsContent(contentPadding: PaddingValues, navController: NavController)
|
|||||||
}
|
}
|
||||||
showDialog.value = true
|
showDialog.value = true
|
||||||
},
|
},
|
||||||
containerColor = LocalCustomColors.current.background,
|
containerColor = MaterialTheme.colorScheme.errorContainer,
|
||||||
contentColor = LocalCustomColors.current.secondary
|
contentColor = MaterialTheme.colorScheme.onErrorContainer
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
Icons.Filled.Delete,
|
Icons.Filled.Delete,
|
||||||
@@ -282,12 +279,7 @@ fun NewAccount(navController: NavController) {
|
|||||||
keyboardType = KeyboardType.Text,
|
keyboardType = KeyboardType.Text,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
Image(
|
SmallFloatingActionButton(
|
||||||
painter = painterResource(id = R.drawable.plus),
|
|
||||||
contentDescription = "Add",
|
|
||||||
contentScale = ContentScale.Crop,
|
|
||||||
modifier = Modifier.size(48.dp)
|
|
||||||
.clickable(
|
|
||||||
onClick = {
|
onClick = {
|
||||||
val account = createNew(ctx, newAor.trim())
|
val account = createNew(ctx, newAor.trim())
|
||||||
if (account != null) {
|
if (account != null) {
|
||||||
@@ -295,9 +287,15 @@ fun NewAccount(navController: NavController) {
|
|||||||
newAor = ""
|
newAor = ""
|
||||||
focusManager.clearFocus()
|
focusManager.clearFocus()
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
containerColor = MaterialTheme.colorScheme.secondaryContainer,
|
||||||
|
contentColor = MaterialTheme.colorScheme.onSecondaryContainer
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Filled.Add,
|
||||||
|
contentDescription = stringResource(R.string.add)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -97,16 +97,20 @@ private fun AudioScreen(
|
|||||||
title = {
|
title = {
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.audio_settings),
|
text = stringResource(R.string.audio_settings),
|
||||||
color = LocalCustomColors.current.light,
|
|
||||||
fontWeight = FontWeight.Bold
|
fontWeight = FontWeight.Bold
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
colors = TopAppBarDefaults.topAppBarColors(
|
||||||
|
containerColor = LocalCustomColors.current.primary,
|
||||||
|
navigationIconContentColor = LocalCustomColors.current.onPrimary,
|
||||||
|
titleContentColor = LocalCustomColors.current.onPrimary,
|
||||||
|
actionIconContentColor = LocalCustomColors.current.onPrimary
|
||||||
|
),
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
IconButton(onClick = onBack) {
|
IconButton(onClick = onBack) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
|
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
tint = LocalCustomColors.current.light
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -115,14 +119,10 @@ private fun AudioScreen(
|
|||||||
IconButton(onClick = checkOnClick) {
|
IconButton(onClick = checkOnClick) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Filled.Check,
|
imageVector = Icons.Filled.Check,
|
||||||
tint = LocalCustomColors.current.light,
|
|
||||||
contentDescription = "Check"
|
contentDescription = "Check"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
colors = TopAppBarDefaults.topAppBarColors(
|
|
||||||
containerColor = LocalCustomColors.current.primary
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,12 +118,14 @@ private fun CodecsScreen(
|
|||||||
stringResource(R.string.audio_codecs)
|
stringResource(R.string.audio_codecs)
|
||||||
else
|
else
|
||||||
stringResource(R.string.video_codecs),
|
stringResource(R.string.video_codecs),
|
||||||
color = LocalCustomColors.current.light,
|
|
||||||
fontWeight = FontWeight.Bold
|
fontWeight = FontWeight.Bold
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
colors = TopAppBarDefaults.topAppBarColors(
|
colors = TopAppBarDefaults.topAppBarColors(
|
||||||
containerColor = LocalCustomColors.current.primary
|
containerColor = LocalCustomColors.current.primary,
|
||||||
|
navigationIconContentColor = LocalCustomColors.current.onPrimary,
|
||||||
|
titleContentColor = LocalCustomColors.current.onPrimary,
|
||||||
|
actionIconContentColor = LocalCustomColors.current.onPrimary
|
||||||
),
|
),
|
||||||
windowInsets = WindowInsets(0, 0, 0, 0),
|
windowInsets = WindowInsets(0, 0, 0, 0),
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
@@ -131,7 +133,6 @@ private fun CodecsScreen(
|
|||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
|
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
|
||||||
contentDescription = "Back",
|
contentDescription = "Back",
|
||||||
tint = LocalCustomColors.current.light
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -141,7 +142,6 @@ private fun CodecsScreen(
|
|||||||
}) {
|
}) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Filled.Check,
|
imageVector = Icons.Filled.Check,
|
||||||
tint = LocalCustomColors.current.light,
|
|
||||||
contentDescription = "Check"
|
contentDescription = "Check"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,11 +6,33 @@ import androidx.compose.runtime.compositionLocalOf
|
|||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
data class CustomColors(
|
data class CustomColors(
|
||||||
|
// standard colors
|
||||||
val primary: Color = Color.Unspecified,
|
val primary: Color = Color.Unspecified,
|
||||||
val onPrimary: Color = Color.Unspecified,
|
val onPrimary: Color = Color.Unspecified,
|
||||||
|
val primaryContainer: Color = Color.Unspecified,
|
||||||
|
val onPrimaryContainer: Color = Color.Unspecified,
|
||||||
|
val secondary: Color = Color.Unspecified,
|
||||||
|
val onSecondary: Color = Color.Unspecified,
|
||||||
|
val secondaryContainer: Color = Color.Unspecified,
|
||||||
|
val onSecondaryContainer: Color = Color.Unspecified,
|
||||||
|
val tertiary: Color = Color.Unspecified,
|
||||||
|
val onTertiary: Color = Color.Unspecified,
|
||||||
|
val tertiaryContainer: Color = Color.Unspecified,
|
||||||
|
val onTertiaryContainer: Color = Color.Unspecified,
|
||||||
|
val error: Color = Color.Unspecified,
|
||||||
|
val onError: Color = Color.Unspecified,
|
||||||
|
val errorContainer: Color = Color.Unspecified,
|
||||||
|
val onErrorContainer: Color = Color.Unspecified,
|
||||||
|
val background: Color = Color.Unspecified,
|
||||||
|
val onBackground: Color = Color.Unspecified,
|
||||||
|
val surface: Color = Color.Unspecified,
|
||||||
|
val onSurface: Color = Color.Unspecified,
|
||||||
|
val surfaceVariant: Color = Color.Unspecified,
|
||||||
|
val onSurfaceVariant: Color = Color.Unspecified,
|
||||||
|
val outline: Color = Color.Unspecified,
|
||||||
|
// custom colors
|
||||||
val primaryDark: Color = Color.Unspecified,
|
val primaryDark: Color = Color.Unspecified,
|
||||||
val primaryLight: Color = Color.Unspecified,
|
val primaryLight: Color = Color.Unspecified,
|
||||||
val secondary: Color = Color.Unspecified,
|
|
||||||
val secondaryDark: Color = Color.Unspecified,
|
val secondaryDark: Color = Color.Unspecified,
|
||||||
val secondaryLight: Color = Color.Unspecified,
|
val secondaryLight: Color = Color.Unspecified,
|
||||||
val gray: Color = Color.Unspecified,
|
val gray: Color = Color.Unspecified,
|
||||||
@@ -18,11 +40,6 @@ data class CustomColors(
|
|||||||
val grayLight: Color = Color.Unspecified,
|
val grayLight: Color = Color.Unspecified,
|
||||||
val accent: Color = Color.Unspecified,
|
val accent: Color = Color.Unspecified,
|
||||||
val baresip: Color = Color.Unspecified,
|
val baresip: Color = Color.Unspecified,
|
||||||
val white: Color = Color.Unspecified,
|
|
||||||
val black: Color = Color.Unspecified,
|
|
||||||
val strong: Color = Color.Unspecified,
|
|
||||||
val green: Color = Color.Unspecified,
|
|
||||||
val red: Color = Color.Unspecified,
|
|
||||||
val trafficGreen: Color = Color.Unspecified,
|
val trafficGreen: Color = Color.Unspecified,
|
||||||
val trafficYellow: Color = Color.Unspecified,
|
val trafficYellow: Color = Color.Unspecified,
|
||||||
val trafficRed: Color = Color.Unspecified,
|
val trafficRed: Color = Color.Unspecified,
|
||||||
@@ -34,20 +51,37 @@ data class CustomColors(
|
|||||||
val itemText: Color = Color.Unspecified,
|
val itemText: Color = Color.Unspecified,
|
||||||
val alertText: Color = Color.Unspecified,
|
val alertText: Color = Color.Unspecified,
|
||||||
val codec: Color = Color.Unspecified,
|
val codec: Color = Color.Unspecified,
|
||||||
val background: Color = Color.Unspecified,
|
|
||||||
val onBackground: Color = Color.Unspecified,
|
|
||||||
val cardBackground: Color = Color.Unspecified,
|
val cardBackground: Color = Color.Unspecified,
|
||||||
val textFieldBackground: Color = Color.Unspecified,
|
val textFieldBackground: Color = Color.Unspecified,
|
||||||
val popupBackground: Color = Color.Unspecified,
|
val popupBackground: Color = Color.Unspecified,
|
||||||
val alert: Color = Color.Unspecified,
|
val alert: Color = Color.Unspecified
|
||||||
val actionbar: Color = Color.Unspecified,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
val light_primary = Color(0xff0ca1fd)
|
val light_primary = Color(0xff0ca1fd)
|
||||||
val light_on_primary = Color(0xffe0e0e0)
|
val light_on_primary = Color(0xffe0e0e0)
|
||||||
|
val light_primary_container = Color(0xFFA1CBE6)
|
||||||
|
val light_on_primary_container = Color(0xFF032133)
|
||||||
|
val light_secondary = Color(0xFF00B9A1)
|
||||||
|
val light_on_secondary = Color(0xffe0e0e0)
|
||||||
|
val light_secondary_container = Color(0xFF9DE6DC)
|
||||||
|
val light_on_secondary_container = Color(0xFF00332C)
|
||||||
|
val light_tertiary = Color(0xFF7D5260)
|
||||||
|
val light_on_tertiary = Color(0xffe0e0e0)
|
||||||
|
val light_tertiary_container = Color(0xFFE6CDD5)
|
||||||
|
val light_on_tertiary_container = Color(0xFF332227)
|
||||||
|
val light_error = Color(0xFFF77445)
|
||||||
|
val light_on_error = Color(0xffe0e0e0)
|
||||||
|
val light_error_container = Color(0xFFE6BFB1)
|
||||||
|
val light_on_error_container = Color(0xFF33180E)
|
||||||
|
val light_background = Color(0xFFFCFCFC)
|
||||||
|
val light_on_background = Color(0xFF313233)
|
||||||
|
val light_surface = Color(0xFFfbfcfc)
|
||||||
|
val light_on_surface = Color(0xFF313233)
|
||||||
|
val light_surfaceVariant = Color(0xFFd8e0e6)
|
||||||
|
val light_on_surfaceVariant = Color(0xFF535f66)
|
||||||
|
val light_outline = Color(0xFF7c8e99)
|
||||||
val light_primary_dark = Color(0xff0073c9)
|
val light_primary_dark = Color(0xff0073c9)
|
||||||
val light_primary_light = Color(0xff6ad2ff)
|
val light_primary_light = Color(0xff6ad2ff)
|
||||||
val light_secondary = Color(0xFF00B9A1)
|
|
||||||
val light_secondary_dark = Color(0xFF008873)
|
val light_secondary_dark = Color(0xFF008873)
|
||||||
val light_secondary_light = Color(0xff5cecd2)
|
val light_secondary_light = Color(0xff5cecd2)
|
||||||
val light_gray = Color(0xff9e9e9e)
|
val light_gray = Color(0xff9e9e9e)
|
||||||
@@ -58,19 +92,36 @@ val light_light = Color(0xfffcfcfc)
|
|||||||
val light_dark = Color(0xFF383838)
|
val light_dark = Color(0xFF383838)
|
||||||
val light_spinner_divider = light_gray
|
val light_spinner_divider = light_gray
|
||||||
val light_item_text = light_dark
|
val light_item_text = light_dark
|
||||||
val light_background = light_light
|
|
||||||
|
|
||||||
val light_on_background = Color(0xFF00B9A1)
|
|
||||||
val light_textfield_background = light_gray_light
|
val light_textfield_background = light_gray_light
|
||||||
val light_card_background = light_gray_light
|
val light_card_background = light_gray_light
|
||||||
val light_popup_background = light_secondary_dark
|
val light_popup_background = light_secondary_dark
|
||||||
val light_alert = light_primary
|
val light_alert = light_primary
|
||||||
|
|
||||||
val dark_primary = Color(0xff0073c9)
|
val dark_primary = Color(0xFF84C1E6)
|
||||||
val dark_on_primary = Color(0xffe0e0e0)
|
val dark_on_primary = Color(0xFF04314C)
|
||||||
|
val dark_primary_container = Color(0xFF054166)
|
||||||
|
val dark_on_primary_container = Color(0xFFA1CBE6)
|
||||||
|
val dark_secondary = Color(0xFF7FE6D8)
|
||||||
|
val dark_on_secondary = Color(0xFF004C43)
|
||||||
|
val dark_secondary_container = Color(0xFF006659)
|
||||||
|
val dark_on_secondary_container = Color(0xFF9DE6DC)
|
||||||
|
val dark_tertiary = Color(0xFFE6C3CE)
|
||||||
|
val dark_on_tertiary = Color(0xFF4C323B)
|
||||||
|
val dark_tertiary_container = Color(0xFF66434F)
|
||||||
|
val dark_on_tertiary_container = Color(0xFFE6CDD5)
|
||||||
|
val dark_error = Color(0xFFE6AF9C)
|
||||||
|
val dark_on_error = Color(0xFF4C2415)
|
||||||
|
val dark_error_container = Color(0xFF66301D)
|
||||||
|
val dark_on_error_container = Color(0xFFE6BFB1)
|
||||||
|
val dark_background = Color(0xFF313233)
|
||||||
|
val dark_on_background = Color(0xFFe2e4e6)
|
||||||
|
val dark_surface = Color(0xFF313233)
|
||||||
|
val dark_on_surface = Color(0xFFe2e4e6)
|
||||||
|
val dark_surfaceVariant = Color(0xFF535f66)
|
||||||
|
val dark_on_surfaceVariant = Color(0xFFd2dee6)
|
||||||
|
val dark_outline = Color(0xFF9daab3)
|
||||||
val dark_primary_dark = Color(0xff00008b)
|
val dark_primary_dark = Color(0xff00008b)
|
||||||
val dark_primary_light = Color(0xff0ca1fd)
|
val dark_primary_light = Color(0xff0ca1fd)
|
||||||
val dark_secondary = Color(0xFF00B9A1)
|
|
||||||
val dark_secondary_dark = Color(0xFF008873)
|
val dark_secondary_dark = Color(0xFF008873)
|
||||||
val dark_secondary_light = Color(0xff5cecd2)
|
val dark_secondary_light = Color(0xff5cecd2)
|
||||||
val dark_gray = Color(0xff9e9e9e)
|
val dark_gray = Color(0xff9e9e9e)
|
||||||
@@ -81,8 +132,6 @@ val dark_light = dark_gray_light
|
|||||||
val dark_dark = Color(0xFF121212)
|
val dark_dark = Color(0xFF121212)
|
||||||
val dark_spinner_divider = dark_gray_dark
|
val dark_spinner_divider = dark_gray_dark
|
||||||
val dark_item_text = dark_gray_light
|
val dark_item_text = dark_gray_light
|
||||||
val dark_background = dark_dark
|
|
||||||
val dark_on_background = Color(0xFF00B9A1)
|
|
||||||
val dark_textfield_background = dark_gray
|
val dark_textfield_background = dark_gray
|
||||||
val dark_card_background = dark_gray_dark
|
val dark_card_background = dark_gray_dark
|
||||||
val dark_popup_background = dark_secondary_dark
|
val dark_popup_background = dark_secondary_dark
|
||||||
@@ -91,9 +140,30 @@ val dark_alert = dark_primary_light
|
|||||||
val LightCustomColors = CustomColors(
|
val LightCustomColors = CustomColors(
|
||||||
primary = light_primary,
|
primary = light_primary,
|
||||||
onPrimary = light_on_primary,
|
onPrimary = light_on_primary,
|
||||||
|
primaryContainer = light_primary_container,
|
||||||
|
onPrimaryContainer = light_on_primary_container,
|
||||||
|
secondary = light_secondary,
|
||||||
|
onSecondary = light_on_secondary,
|
||||||
|
secondaryContainer = light_secondary_container,
|
||||||
|
onSecondaryContainer = light_on_secondary_container,
|
||||||
|
tertiary = light_tertiary,
|
||||||
|
onTertiary = light_on_tertiary,
|
||||||
|
tertiaryContainer = light_tertiary_container,
|
||||||
|
onTertiaryContainer = light_on_tertiary_container,
|
||||||
|
error = light_error,
|
||||||
|
onError = light_on_error,
|
||||||
|
errorContainer = light_error_container,
|
||||||
|
onErrorContainer = light_on_error_container,
|
||||||
|
background = light_background,
|
||||||
|
onBackground = light_on_background,
|
||||||
|
surface = light_surface,
|
||||||
|
onSurface = light_on_surface,
|
||||||
|
surfaceVariant = light_surfaceVariant,
|
||||||
|
onSurfaceVariant = light_on_surfaceVariant,
|
||||||
|
outline = light_outline,
|
||||||
|
|
||||||
primaryDark = light_primary_dark,
|
primaryDark = light_primary_dark,
|
||||||
primaryLight = light_primary_light,
|
primaryLight = light_primary_light,
|
||||||
secondary = light_secondary,
|
|
||||||
secondaryDark = light_secondary_dark,
|
secondaryDark = light_secondary_dark,
|
||||||
secondaryLight = light_secondary_light,
|
secondaryLight = light_secondary_light,
|
||||||
gray = light_gray,
|
gray = light_gray,
|
||||||
@@ -104,8 +174,6 @@ val LightCustomColors = CustomColors(
|
|||||||
dark = light_dark,
|
dark = light_dark,
|
||||||
spinnerDivider = light_spinner_divider,
|
spinnerDivider = light_spinner_divider,
|
||||||
itemText = light_item_text,
|
itemText = light_item_text,
|
||||||
background = light_background,
|
|
||||||
onBackground = light_on_background,
|
|
||||||
cardBackground = light_card_background,
|
cardBackground = light_card_background,
|
||||||
textFieldBackground = light_textfield_background,
|
textFieldBackground = light_textfield_background,
|
||||||
popupBackground = light_popup_background,
|
popupBackground = light_popup_background,
|
||||||
@@ -115,9 +183,30 @@ val LightCustomColors = CustomColors(
|
|||||||
val DarkCustomColors = CustomColors(
|
val DarkCustomColors = CustomColors(
|
||||||
primary = dark_primary,
|
primary = dark_primary,
|
||||||
onPrimary = dark_on_primary,
|
onPrimary = dark_on_primary,
|
||||||
|
primaryContainer = dark_primary_container,
|
||||||
|
onPrimaryContainer = dark_on_primary_container,
|
||||||
|
secondary = dark_secondary,
|
||||||
|
onSecondary = dark_on_secondary,
|
||||||
|
secondaryContainer = dark_secondary_container,
|
||||||
|
onSecondaryContainer = dark_on_secondary_container,
|
||||||
|
tertiary = dark_tertiary,
|
||||||
|
onTertiary = dark_on_tertiary,
|
||||||
|
tertiaryContainer = dark_tertiary_container,
|
||||||
|
onTertiaryContainer = dark_on_tertiary_container,
|
||||||
|
error = dark_error,
|
||||||
|
onError = dark_on_error,
|
||||||
|
errorContainer = dark_error_container,
|
||||||
|
onErrorContainer = dark_on_error_container,
|
||||||
|
background = dark_background,
|
||||||
|
onBackground = dark_on_background,
|
||||||
|
surface = dark_surface,
|
||||||
|
onSurface = dark_on_surface,
|
||||||
|
surfaceVariant = dark_surfaceVariant,
|
||||||
|
onSurfaceVariant = dark_on_surfaceVariant,
|
||||||
|
outline = dark_outline,
|
||||||
|
|
||||||
primaryDark = dark_primary_dark,
|
primaryDark = dark_primary_dark,
|
||||||
primaryLight = dark_primary_light,
|
primaryLight = dark_primary_light,
|
||||||
secondary = dark_secondary,
|
|
||||||
secondaryDark = dark_secondary_dark,
|
secondaryDark = dark_secondary_dark,
|
||||||
secondaryLight = dark_secondary_light,
|
secondaryLight = dark_secondary_light,
|
||||||
gray = dark_gray,
|
gray = dark_gray,
|
||||||
@@ -128,8 +217,6 @@ val DarkCustomColors = CustomColors(
|
|||||||
dark = dark_dark,
|
dark = dark_dark,
|
||||||
spinnerDivider = dark_spinner_divider,
|
spinnerDivider = dark_spinner_divider,
|
||||||
itemText = dark_item_text,
|
itemText = dark_item_text,
|
||||||
background = dark_background,
|
|
||||||
onBackground = dark_on_background,
|
|
||||||
cardBackground = dark_card_background,
|
cardBackground = dark_card_background,
|
||||||
textFieldBackground = dark_textfield_background,
|
textFieldBackground = dark_textfield_background,
|
||||||
popupBackground = dark_popup_background,
|
popupBackground = dark_popup_background,
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import androidx.compose.foundation.BorderStroke
|
|||||||
import androidx.compose.foundation.Canvas
|
import androidx.compose.foundation.Canvas
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.ScrollState
|
import androidx.compose.foundation.ScrollState
|
||||||
import androidx.compose.foundation.background
|
|
||||||
import androidx.compose.foundation.gestures.detectTapGestures
|
import androidx.compose.foundation.gestures.detectTapGestures
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
@@ -22,10 +21,10 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
|
import androidx.compose.foundation.layout.width
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
import androidx.compose.foundation.lazy.LazyListState
|
import androidx.compose.foundation.lazy.LazyListState
|
||||||
import androidx.compose.foundation.lazy.itemsIndexed
|
import androidx.compose.foundation.lazy.itemsIndexed
|
||||||
import androidx.compose.foundation.lazy.rememberLazyListState
|
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.foundation.text.KeyboardOptions
|
import androidx.compose.foundation.text.KeyboardOptions
|
||||||
@@ -39,6 +38,7 @@ import androidx.compose.material3.ExperimentalMaterial3Api
|
|||||||
import androidx.compose.material3.HorizontalDivider
|
import androidx.compose.material3.HorizontalDivider
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.OutlinedTextField
|
import androidx.compose.material3.OutlinedTextField
|
||||||
import androidx.compose.material3.OutlinedTextFieldDefaults
|
import androidx.compose.material3.OutlinedTextFieldDefaults
|
||||||
import androidx.compose.material3.Surface
|
import androidx.compose.material3.Surface
|
||||||
@@ -82,7 +82,6 @@ import androidx.compose.ui.unit.TextUnit
|
|||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import androidx.compose.ui.window.DialogProperties
|
import androidx.compose.ui.window.DialogProperties
|
||||||
import androidx.core.content.ContextCompat.getString
|
|
||||||
|
|
||||||
object CustomElements {
|
object CustomElements {
|
||||||
|
|
||||||
@@ -148,10 +147,7 @@ object CustomElements {
|
|||||||
DropdownMenu(
|
DropdownMenu(
|
||||||
expanded = expanded,
|
expanded = expanded,
|
||||||
onDismissRequest = onDismissRequest,
|
onDismissRequest = onDismissRequest,
|
||||||
containerColor = LocalCustomColors.current.onPrimary,
|
containerColor = MaterialTheme.colorScheme.surfaceContainer
|
||||||
modifier = Modifier.background(
|
|
||||||
LocalCustomColors.current.popupBackground.copy(alpha = 0.95f)
|
|
||||||
)
|
|
||||||
) {
|
) {
|
||||||
val itemsIterator = items.iterator()
|
val itemsIterator = items.iterator()
|
||||||
while (itemsIterator.hasNext()) {
|
while (itemsIterator.hasNext()) {
|
||||||
@@ -160,13 +156,13 @@ object CustomElements {
|
|||||||
text = {
|
text = {
|
||||||
Text(
|
Text(
|
||||||
text = item,
|
text = item,
|
||||||
color = LocalCustomColors.current.light,
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
fontSize = 16.sp
|
fontSize = 16.sp
|
||||||
) },
|
) },
|
||||||
onClick = { onItemClick(item) }
|
onClick = { onItemClick(item) }
|
||||||
)
|
)
|
||||||
if (itemsIterator.hasNext())
|
if (itemsIterator.hasNext())
|
||||||
HorizontalDivider(color = LocalCustomColors.current.spinnerDivider)
|
HorizontalDivider(color = MaterialTheme.colorScheme.outlineVariant)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -288,9 +284,7 @@ object CustomElements {
|
|||||||
) {
|
) {
|
||||||
if (showDialog.value) {
|
if (showDialog.value) {
|
||||||
BasicAlertDialog(
|
BasicAlertDialog(
|
||||||
onDismissRequest = {
|
onDismissRequest = { showDialog.value = false },
|
||||||
showDialog.value = false
|
|
||||||
},
|
|
||||||
content = {
|
content = {
|
||||||
Card(
|
Card(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@@ -298,66 +292,32 @@ object CustomElements {
|
|||||||
.padding(top = 16.dp, start = 16.dp, end = 16.dp, bottom = 0.dp),
|
.padding(top = 16.dp, start = 16.dp, end = 16.dp, bottom = 0.dp),
|
||||||
shape = RoundedCornerShape(16.dp),
|
shape = RoundedCornerShape(16.dp),
|
||||||
colors = CardDefaults.cardColors(
|
colors = CardDefaults.cardColors(
|
||||||
containerColor = LocalCustomColors.current.cardBackground
|
containerColor = MaterialTheme.colorScheme.surfaceContainer
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
Column(modifier = Modifier.padding(16.dp)) {
|
Column(modifier = Modifier.padding(16.dp)) {
|
||||||
Text(
|
Text(
|
||||||
text = title,
|
text = title,
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
textAlign = TextAlign.Start,
|
||||||
fontSize = 20.sp,
|
fontSize = 20.sp,
|
||||||
color = LocalCustomColors.current.alert,
|
color = MaterialTheme.colorScheme.onSurface
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
Text(
|
Text(
|
||||||
text = message,
|
text = message,
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
textAlign = TextAlign.Start,
|
||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
color = LocalCustomColors.current.itemText,
|
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
if (negativeButtonText.isNotEmpty() && neutralButtonText.isNotEmpty()) {
|
if (positiveButtonText.isNotEmpty()) {
|
||||||
Column(
|
|
||||||
modifier = Modifier.fillMaxWidth(),
|
|
||||||
horizontalAlignment = Alignment.End
|
|
||||||
) {
|
|
||||||
TextButton(onClick = {
|
|
||||||
onPositiveClicked()
|
|
||||||
showDialog.value = false
|
|
||||||
}) {
|
|
||||||
Text(
|
|
||||||
text = positiveButtonText.uppercase(),
|
|
||||||
fontSize = 14.sp,
|
|
||||||
color = LocalCustomColors.current.alert,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
TextButton(onClick = {
|
|
||||||
onNeutralClicked()
|
|
||||||
showDialog.value = false
|
|
||||||
}) {
|
|
||||||
Text(
|
|
||||||
text = neutralButtonText.uppercase(),
|
|
||||||
fontSize = 14.sp,
|
|
||||||
color = LocalCustomColors.current.alert
|
|
||||||
)
|
|
||||||
}
|
|
||||||
TextButton(onClick = {
|
|
||||||
onNegativeClicked()
|
|
||||||
showDialog.value = false
|
|
||||||
}) {
|
|
||||||
Text(
|
|
||||||
text = negativeButtonText.uppercase(),
|
|
||||||
fontSize = 14.sp,
|
|
||||||
color = LocalCustomColors.current.gray
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if (positiveButtonText.isNotEmpty())
|
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
horizontalArrangement = Arrangement.End
|
horizontalArrangement = Arrangement.End
|
||||||
) {
|
) {
|
||||||
if (negativeButtonText.isNotEmpty())
|
if (negativeButtonText.isNotEmpty()) {
|
||||||
TextButton(onClick = {
|
TextButton(onClick = {
|
||||||
onNegativeClicked()
|
onNegativeClicked()
|
||||||
showDialog.value = false
|
showDialog.value = false
|
||||||
@@ -365,10 +325,11 @@ object CustomElements {
|
|||||||
Text(
|
Text(
|
||||||
text = negativeButtonText.uppercase(),
|
text = negativeButtonText.uppercase(),
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
color = LocalCustomColors.current.gray
|
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (neutralButtonText.isNotEmpty())
|
}
|
||||||
|
if (neutralButtonText.isNotEmpty()) {
|
||||||
TextButton(onClick = {
|
TextButton(onClick = {
|
||||||
onNeutralClicked()
|
onNeutralClicked()
|
||||||
showDialog.value = false
|
showDialog.value = false
|
||||||
@@ -376,9 +337,10 @@ object CustomElements {
|
|||||||
Text(
|
Text(
|
||||||
text = neutralButtonText.uppercase(),
|
text = neutralButtonText.uppercase(),
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
color = LocalCustomColors.current.alert
|
color = MaterialTheme.colorScheme.primary
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
TextButton(onClick = {
|
TextButton(onClick = {
|
||||||
onPositiveClicked()
|
onPositiveClicked()
|
||||||
showDialog.value = false
|
showDialog.value = false
|
||||||
@@ -386,13 +348,14 @@ object CustomElements {
|
|||||||
Text(
|
Text(
|
||||||
text = positiveButtonText.uppercase(),
|
text = positiveButtonText.uppercase(),
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
color = LocalCustomColors.current.alert,
|
color = MaterialTheme.colorScheme.primary,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -419,23 +382,21 @@ object CustomElements {
|
|||||||
.padding(top = 16.dp, start = 16.dp, end = 16.dp, bottom = 0.dp),
|
.padding(top = 16.dp, start = 16.dp, end = 16.dp, bottom = 0.dp),
|
||||||
shape = RoundedCornerShape(16.dp),
|
shape = RoundedCornerShape(16.dp),
|
||||||
colors = CardDefaults.cardColors(
|
colors = CardDefaults.cardColors(
|
||||||
containerColor = LocalCustomColors.current.cardBackground
|
containerColor = MaterialTheme.colorScheme.surfaceContainer
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
Column(modifier = Modifier.padding(16.dp)) {
|
Column(modifier = Modifier.padding(16.dp)) {
|
||||||
Text(
|
Text(
|
||||||
text = title,
|
text = title,
|
||||||
fontSize = 20.sp,
|
fontSize = 20.sp,
|
||||||
color = LocalCustomColors.current.alert,
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
textAlign = TextAlign.Start,
|
textAlign = TextAlign.Start,
|
||||||
modifier = Modifier.fillMaxWidth()
|
modifier = Modifier.fillMaxWidth()
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
val lazyListState = rememberLazyListState()
|
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
horizontalAlignment = Alignment.End,
|
horizontalAlignment = Alignment.End
|
||||||
state = lazyListState,
|
|
||||||
) {
|
) {
|
||||||
itemsIndexed(items) { index, item ->
|
itemsIndexed(items) { index, item ->
|
||||||
TextButton(
|
TextButton(
|
||||||
@@ -443,31 +404,38 @@ object CustomElements {
|
|||||||
onItemClicked(index)
|
onItemClicked(index)
|
||||||
openDialog.value = false
|
openDialog.value = false
|
||||||
},
|
},
|
||||||
modifier = Modifier.align(Alignment.End)
|
modifier = Modifier.fillMaxWidth()
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = item,
|
text = item,
|
||||||
color = LocalCustomColors.current.itemText,
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
textAlign = TextAlign.Start
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (neutralButtonText.isNotEmpty()) {
|
if (neutralButtonText.isNotEmpty()) {
|
||||||
|
Row(
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
horizontalArrangement = Arrangement.End
|
||||||
|
) {
|
||||||
TextButton(
|
TextButton(
|
||||||
onClick = {
|
onClick = {
|
||||||
onNeutralClicked()
|
onNeutralClicked()
|
||||||
openDialog.value = false
|
openDialog.value = false
|
||||||
},
|
}
|
||||||
modifier = Modifier.align(Alignment.End)){
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = neutralButtonText.uppercase(),
|
text = neutralButtonText.uppercase(),
|
||||||
color = LocalCustomColors.current.gray,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -486,6 +454,8 @@ object CustomElements {
|
|||||||
) {
|
) {
|
||||||
val showPassword = remember { mutableStateOf(false) }
|
val showPassword = remember { mutableStateOf(false) }
|
||||||
val focusRequester = remember { FocusRequester() }
|
val focusRequester = remember { FocusRequester() }
|
||||||
|
|
||||||
|
if (showPasswordDialog.value) {
|
||||||
BasicAlertDialog(
|
BasicAlertDialog(
|
||||||
properties = DialogProperties(
|
properties = DialogProperties(
|
||||||
dismissOnBackPress = false,
|
dismissOnBackPress = false,
|
||||||
@@ -502,7 +472,7 @@ object CustomElements {
|
|||||||
.padding(top = 16.dp, start = 16.dp, end = 16.dp, bottom = 0.dp),
|
.padding(top = 16.dp, start = 16.dp, end = 16.dp, bottom = 0.dp),
|
||||||
shape = RoundedCornerShape(16.dp),
|
shape = RoundedCornerShape(16.dp),
|
||||||
colors = CardDefaults.cardColors(
|
colors = CardDefaults.cardColors(
|
||||||
containerColor = LocalCustomColors.current.cardBackground
|
containerColor = MaterialTheme.colorScheme.surfaceContainer
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
Column(modifier = Modifier.padding(16.dp)) {
|
Column(modifier = Modifier.padding(16.dp)) {
|
||||||
@@ -510,22 +480,20 @@ object CustomElements {
|
|||||||
text = title,
|
text = title,
|
||||||
fontSize = 20.sp,
|
fontSize = 20.sp,
|
||||||
modifier = Modifier.padding(top = 16.dp, bottom = 16.dp),
|
modifier = Modifier.padding(top = 16.dp, bottom = 16.dp),
|
||||||
color = LocalCustomColors.current.alert,
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
)
|
)
|
||||||
if (message != "")
|
if (message.isNotEmpty())
|
||||||
Text(
|
Text(
|
||||||
text = message,
|
text = message,
|
||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
modifier = Modifier.padding(16.dp),
|
modifier = Modifier.padding(16.dp),
|
||||||
color = LocalCustomColors.current.itemText,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
)
|
)
|
||||||
OutlinedTextField(
|
OutlinedTextField(
|
||||||
value = password.value,
|
value = password.value,
|
||||||
singleLine = true,
|
singleLine = true,
|
||||||
colors = OutlinedTextFieldDefaults.colors(
|
colors = OutlinedTextFieldDefaults.colors(
|
||||||
focusedContainerColor = LocalCustomColors.current.textFieldBackground,
|
cursorColor = MaterialTheme.colorScheme.primary,
|
||||||
unfocusedContainerColor = LocalCustomColors.current.textFieldBackground,
|
|
||||||
cursorColor = LocalCustomColors.current.primary,
|
|
||||||
),
|
),
|
||||||
onValueChange = {
|
onValueChange = {
|
||||||
password.value = it
|
password.value = it
|
||||||
@@ -537,16 +505,14 @@ object CustomElements {
|
|||||||
trailingIcon = {
|
trailingIcon = {
|
||||||
IconButton(onClick = {
|
IconButton(onClick = {
|
||||||
showPassword.value = !showPassword.value
|
showPassword.value = !showPassword.value
|
||||||
showPasswordDialog.value = true
|
|
||||||
}) {
|
}) {
|
||||||
Icon(
|
Icon(
|
||||||
if (showPassword.value)
|
imageVector = if (showPassword.value)
|
||||||
ImageVector.vectorResource(R.drawable.visibility)
|
ImageVector.vectorResource(R.drawable.visibility)
|
||||||
else
|
else
|
||||||
ImageVector.vectorResource(R.drawable.visibility_off),
|
ImageVector.vectorResource(R.drawable.visibility_off),
|
||||||
contentDescription = "Visibility",
|
contentDescription = "Visibility",
|
||||||
tint = LocalCustomColors.current.grayDark
|
tint = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -556,7 +522,7 @@ object CustomElements {
|
|||||||
.focusRequester(focusRequester),
|
.focusRequester(focusRequester),
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp,
|
||||||
color = LocalCustomColors.current.dark
|
color = MaterialTheme.colorScheme.onSurface
|
||||||
),
|
),
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
||||||
)
|
)
|
||||||
@@ -565,7 +531,8 @@ object CustomElements {
|
|||||||
keyboardController?.show()
|
keyboardController?.show()
|
||||||
}
|
}
|
||||||
Row(
|
Row(
|
||||||
horizontalArrangement = Arrangement.Start
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
horizontalArrangement = Arrangement.End
|
||||||
) {
|
) {
|
||||||
TextButton(
|
TextButton(
|
||||||
onClick = {
|
onClick = {
|
||||||
@@ -576,10 +543,10 @@ object CustomElements {
|
|||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.cancel),
|
text = stringResource(R.string.cancel),
|
||||||
color = LocalCustomColors.current.gray
|
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
TextButton(
|
TextButton(
|
||||||
onClick = {
|
onClick = {
|
||||||
keyboardController?.hide()
|
keyboardController?.hide()
|
||||||
@@ -589,10 +556,8 @@ object CustomElements {
|
|||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
ctx,
|
ctx,
|
||||||
String.format(
|
String.format(
|
||||||
getString(
|
ctx.getString(R.string.invalid_authentication_password),
|
||||||
ctx,
|
password.value
|
||||||
R.string.invalid_authentication_password
|
|
||||||
), password.value
|
|
||||||
),
|
),
|
||||||
Toast.LENGTH_SHORT
|
Toast.LENGTH_SHORT
|
||||||
).show()
|
).show()
|
||||||
@@ -603,7 +568,7 @@ object CustomElements {
|
|||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.ok),
|
text = stringResource(R.string.ok),
|
||||||
color = LocalCustomColors.current.alert
|
color = MaterialTheme.colorScheme.primary
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -611,5 +576,5 @@ object CustomElements {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user