Added support for dynamic colors in all screens

This commit is contained in:
Juha Heinanen
2025-10-15 15:41:34 +03:00
parent 4b00b09683
commit fc9dbca08f
11 changed files with 47 additions and 44 deletions

View File

@ -144,16 +144,20 @@ private fun AccountScreen(
title = {
Text(
text = acc.text(),
color = LocalCustomColors.current.light,
fontWeight = FontWeight.Bold
)
},
colors = TopAppBarDefaults.topAppBarColors(
containerColor = LocalCustomColors.current.primary,
navigationIconContentColor = LocalCustomColors.current.onPrimary,
titleContentColor = LocalCustomColors.current.onPrimary,
actionIconContentColor = LocalCustomColors.current.onPrimary
),
navigationIcon = {
IconButton(onClick = onBack) {
Icon(
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = null,
tint = LocalCustomColors.current.light
)
}
},
@ -162,14 +166,10 @@ private fun AccountScreen(
IconButton(onClick = checkOnClick) {
Icon(
imageVector = Icons.Filled.Check,
tint = LocalCustomColors.current.light,
contentDescription = "Check"
)
}
},
colors = TopAppBarDefaults.topAppBarColors(
containerColor = LocalCustomColors.current.primary
)
)
}
}

View File

@ -82,22 +82,22 @@ fun AccountsScreen(navController: NavController) {
title = {
Text(
text = stringResource(R.string.accounts),
color = LocalCustomColors.current.light,
fontWeight = FontWeight.Bold
)
},
colors = TopAppBarDefaults.topAppBarColors(
containerColor = LocalCustomColors.current.primary,
navigationIconContentColor = LocalCustomColors.current.onPrimary,
titleContentColor = LocalCustomColors.current.onPrimary,
),
navigationIcon = {
IconButton(onClick = { navController.popBackStack() }) {
Icon(
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = null,
tint = LocalCustomColors.current.light
)
}
},
colors = TopAppBarDefaults.topAppBarColors(
containerColor = LocalCustomColors.current.primary
),
windowInsets = WindowInsets(0, 0, 0, 0)
)
}

View File

@ -103,12 +103,13 @@ private fun TopAppBar(title: String, navController: NavController) {
title = {
Text(
text = title,
color = LocalCustomColors.current.light,
fontWeight = FontWeight.Bold
)
},
colors = TopAppBarDefaults.topAppBarColors(
containerColor = LocalCustomColors.current.primary
containerColor = LocalCustomColors.current.primary,
navigationIconContentColor = LocalCustomColors.current.onPrimary,
titleContentColor = LocalCustomColors.current.onPrimary,
),
windowInsets = WindowInsets(0, 0, 0, 0),
navigationIcon = {
@ -116,7 +117,6 @@ private fun TopAppBar(title: String, navController: NavController) {
Icon(
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = "Back",
tint = LocalCustomColors.current.light
)
}
}

View File

@ -231,12 +231,14 @@ private fun TopAppBar(title: String, onBack: () -> Unit, onCheck: () -> Unit) {
title = {
Text(
text = title,
color = LocalCustomColors.current.light,
fontWeight = FontWeight.Bold
)
},
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),
navigationIcon = {
@ -244,7 +246,6 @@ private fun TopAppBar(title: String, onBack: () -> Unit, onCheck: () -> Unit) {
Icon(
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = "Back",
tint = LocalCustomColors.current.light
)
}
},
@ -252,7 +253,6 @@ private fun TopAppBar(title: String, onBack: () -> Unit, onCheck: () -> Unit) {
IconButton(onClick = onCheck) {
Icon(
imageVector = Icons.Filled.Check,
tint = LocalCustomColors.current.light,
contentDescription = "Check"
)
}

View File

@ -82,12 +82,13 @@ private fun CallDetailsScreen(navController: NavController, callRow: CallRow) {
title = {
Text(
text = stringResource(R.string.call_details),
color = LocalCustomColors.current.light,
fontWeight = FontWeight.Bold
)
},
colors = TopAppBarDefaults.topAppBarColors(
containerColor = LocalCustomColors.current.primary
containerColor = LocalCustomColors.current.primary,
navigationIconContentColor = LocalCustomColors.current.onPrimary,
titleContentColor = LocalCustomColors.current.onPrimary,
),
windowInsets = WindowInsets(0, 0, 0, 0),
navigationIcon = {
@ -95,7 +96,6 @@ private fun CallDetailsScreen(navController: NavController, callRow: CallRow) {
Icon(
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = "Back",
tint = LocalCustomColors.current.light
)
}
},

View File

@ -148,12 +148,14 @@ private fun TopAppBar(navController: NavController, account: Account, callHistor
title = {
Text(
text = stringResource(R.string.call_history),
color = LocalCustomColors.current.light,
fontWeight = FontWeight.Bold
)
},
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),
navigationIcon = {
@ -166,7 +168,6 @@ private fun TopAppBar(navController: NavController, account: Account, callHistor
Icon(
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = "Back",
tint = LocalCustomColors.current.light
)
}
},
@ -177,7 +178,6 @@ private fun TopAppBar(navController: NavController, account: Account, callHistor
Icon(
imageVector = Icons.Filled.Menu,
contentDescription = "Menu",
tint = LocalCustomColors.current.light
)
}
CustomElements.DropdownMenu(

View File

@ -222,20 +222,21 @@ private fun TopAppBar(
title = {
Text(
text = format(ctx.getString(R.string.chat_with), Utils.friendlyUri(ctx, peerUri, account)),
color = LocalCustomColors.current.light,
fontSize = 22.sp,
fontWeight = FontWeight.Bold
)
},
colors = TopAppBarDefaults.topAppBarColors(
containerColor = LocalCustomColors.current.primary
containerColor = LocalCustomColors.current.primary,
navigationIconContentColor = LocalCustomColors.current.onPrimary,
titleContentColor = LocalCustomColors.current.onPrimary,
actionIconContentColor = LocalCustomColors.current.onPrimary
),
navigationIcon = {
IconButton(onClick = { backAction(navController, account, peerUri) }) {
Icon(
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = "Back",
tint = LocalCustomColors.current.light
)
}
},
@ -261,7 +262,6 @@ private fun TopAppBar(
Icon(
imageVector = ImageVector.vectorResource(R.drawable.call_small),
contentDescription = "Call",
tint = LocalCustomColors.current.light
)
}
}

View File

@ -177,16 +177,20 @@ private fun TopAppBar(
title = {
Text(
text = stringResource(R.string.chats),
color = LocalCustomColors.current.light,
fontWeight = FontWeight.Bold
)
},
colors = TopAppBarDefaults.topAppBarColors(
containerColor = LocalCustomColors.current.primary,
navigationIconContentColor = LocalCustomColors.current.onPrimary,
titleContentColor = LocalCustomColors.current.onPrimary,
actionIconContentColor = LocalCustomColors.current.onPrimary
),
navigationIcon = {
IconButton(onClick = { navController.popBackStack() }) {
Icon(
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = null,
tint = LocalCustomColors.current.light
)
}
},
@ -198,7 +202,6 @@ private fun TopAppBar(
Icon(
imageVector = Icons.Filled.Menu,
contentDescription = "Menu",
tint = LocalCustomColors.current.light
)
}
DropdownMenu (
@ -221,9 +224,6 @@ private fun TopAppBar(
}
)
},
colors = TopAppBarDefaults.topAppBarColors(
containerColor = LocalCustomColors.current.primary
)
)
}

View File

@ -92,19 +92,19 @@ private fun ContactsScreen(navController: NavController, viewModel: ViewModel) {
title = {
Text(
text = stringResource(R.string.contacts),
color = LocalCustomColors.current.light,
fontWeight = FontWeight.Bold
)
},
colors = TopAppBarDefaults.topAppBarColors(
containerColor = LocalCustomColors.current.primary
containerColor = LocalCustomColors.current.primary,
navigationIconContentColor = LocalCustomColors.current.onPrimary,
titleContentColor = LocalCustomColors.current.onPrimary
),
navigationIcon = {
IconButton(onClick = { navController.popBackStack() }) {
Icon(
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = "Back",
tint = LocalCustomColors.current.light
)
}
},

View File

@ -163,16 +163,20 @@ private fun SettingsScreen(
title = {
Text(
text = stringResource(R.string.configuration),
color = LocalCustomColors.current.light,
fontWeight = FontWeight.Bold
)
},
colors = TopAppBarDefaults.topAppBarColors(
containerColor = LocalCustomColors.current.primary,
navigationIconContentColor = LocalCustomColors.current.onPrimary,
titleContentColor = LocalCustomColors.current.onPrimary,
actionIconContentColor = LocalCustomColors.current.onPrimary
),
navigationIcon = {
IconButton(onClick = onBack) {
Icon(
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = null,
tint = LocalCustomColors.current.light
)
}
},
@ -181,14 +185,10 @@ private fun SettingsScreen(
IconButton(onClick = checkOnClick) {
Icon(
imageVector = Icons.Filled.Check,
tint = LocalCustomColors.current.light,
contentDescription = "Check"
)
}
},
colors = TopAppBarDefaults.topAppBarColors(
containerColor = LocalCustomColors.current.primary
)
)
}
}

View File

@ -427,6 +427,9 @@
<string name="tone_country_help">Soitto-, odotus- ja varattuäänien maa</string>
<string name="dark_theme">Tumma teema</string>
<string name="dark_theme_help">Käytä aina tummaa näyttöteemaa</string>
<string name="dynamic_colors">Dynaamiset värit</string>
<string name="dynamic_colors_help">Käytä dynaamisia värejä, jos ne on otettu käyttöön
Android-asetuksissa</string>
<string name="colorblind">Värisokea</string>
<string name="colorblind_help">Käytä värisokealle ystävällisiä rekisteröintitilaikoineita</string>
<string name="proximity_sensing">Läheisyyden tunnistus</string>