Android theme colours

This commit is contained in:
Jackson Harper
2023-11-09 13:17:03 +08:00
parent e18e30cfaf
commit 4f7d075193
3 changed files with 96 additions and 88 deletions

View File

@ -3,12 +3,15 @@ package app.omnivore.omnivore
import android.app.Application
import dagger.hilt.android.HiltAndroidApp
import io.intercom.android.sdk.Intercom
import com.google.android.material.color.DynamicColors;
@HiltAndroidApp
class OmnivoreApplication: Application() {
override fun onCreate() {
super.onCreate()
DynamicColors.applyToActivitiesIfAvailable(this);
Intercom.initialize(
this,
this.getString(R.string.intercom_api_key),

View File

@ -155,42 +155,45 @@ fun EditNoteModal(initialValue: String?, onDismiss: (save: Boolean, text: String
val annotation = rememberSaveable { mutableStateOf(initialValue ?: "") }
BottomSheetUI() {
Scaffold(
topBar = {
CenterAlignedTopAppBar(
title = { Text(stringResource(R.string.edit_note_modal_title)) },
modifier = Modifier.statusBarsPadding(),
colors = TopAppBarDefaults.topAppBarColors(
containerColor = MaterialTheme.colorScheme.background
),
navigationIcon = {
TextButton(onClick = {
onDismiss(false, initialValue)
}) {
Text(text = stringResource(R.string.edit_note_modal_action_cancel))
MaterialTheme {
Scaffold(
topBar = {
CenterAlignedTopAppBar(
title = { Text(stringResource(R.string.edit_note_modal_title)) },
modifier = Modifier.statusBarsPadding(),
colors = TopAppBarDefaults.topAppBarColors(
containerColor = MaterialTheme.colorScheme.background
),
navigationIcon = {
TextButton(onClick = {
onDismiss(false, initialValue)
}) {
Text(text = stringResource(R.string.edit_note_modal_action_cancel))
}
},
actions = {
TextButton(onClick = {
onDismiss(true, annotation.value)
}) {
Text(text = stringResource(R.string.edit_note_modal_action_save))
}
}
},
actions = {
TextButton(onClick = {
onDismiss(true, annotation.value)
}) {
Text(text = stringResource(R.string.edit_note_modal_action_save))
}
}
)
}
) { paddingValues ->
TextField(
modifier = Modifier
.padding(top = paddingValues.calculateTopPadding())
.focusRequester(focusRequester)
.fillMaxSize(),
value = annotation.value, onValueChange = { annotation.value = it },
colors = TextFieldDefaults.textFieldColors(
focusedTextColor = MaterialTheme.colorScheme.onSurface,
unfocusedTextColor = MaterialTheme.colorScheme.onSurface,
)
)
}
) { paddingValues ->
TextField(
modifier = Modifier
.padding(top = paddingValues.calculateTopPadding())
.focusRequester(focusRequester)
.fillMaxSize(),
value = annotation.value, onValueChange = { annotation.value = it },
colors = TextFieldDefaults.textFieldColors(
focusedTextColor = Color.White,
unfocusedTextColor = Color.White,
)
)
}
}

View File

@ -1,62 +1,64 @@
package app.omnivore.omnivore.ui.theme
import androidx.compose.material3.darkColorScheme
import androidx.compose.ui.graphics.Color
//
val md_theme_light_primary = Color(0xFF745B00)
val md_theme_light_onPrimary = Color(0xFFFFFFFF)
val md_theme_light_primaryContainer = Color(0xFFFFE08C)
val md_theme_light_onPrimaryContainer = Color(0xFF241A00)
val md_theme_light_secondary = Color(0xFF6D5E00)
val md_theme_light_onSecondary = Color(0xFFFFFFFF)
val md_theme_light_secondaryContainer = Color(0xFFFCE365)
val md_theme_light_onSecondaryContainer = Color(0xFF211B00)
val md_theme_light_tertiary = Color(0xFF4B670A)
val md_theme_light_onTertiary = Color(0xFFFFFFFF)
val md_theme_light_tertiaryContainer = Color(0xFFCBEF86)
val md_theme_light_onTertiaryContainer = Color(0xFF141F00)
val md_theme_light_error = Color(0xFFBA1A1A)
val md_theme_light_errorContainer = Color(0xFFFFDAD6)
val md_theme_light_onError = Color(0xFFFFFFFF)
val md_theme_light_onErrorContainer = Color(0xFF410002)
val md_theme_light_background = Color(0xFFF7FFED)
val md_theme_light_onBackground = Color(0xFF032100)
val md_theme_light_surface = Color(0xFFF7FFED)
val md_theme_light_onSurface = Color(0xFF032100)
val md_theme_light_surfaceVariant = Color(0xFFEBE1CF)
val md_theme_light_onSurfaceVariant = Color(0xFF4C4639)
val md_theme_light_outline = Color(0xFF7E7667)
val md_theme_light_inverseOnSurface = Color(0xFFCBFFB5)
val md_theme_light_inverseSurface = Color(0xFF083900)
val md_theme_light_inversePrimary = Color(0xFFEFC125)
val md_theme_light_shadow = Color(0xFF000000)
val md_theme_light_surfaceTint = Color(0xFF745B00)
//val md_theme_light_primaryContainer = Color(0xFFFFE08C)
//val md_theme_light_onPrimaryContainer = Color(0xFF241A00)
//val md_theme_light_secondary = Color(0xFF6D5E00)
//val md_theme_light_onSecondary = Color(0xFFFFFFFF)
//val md_theme_light_secondaryContainer = Color(0xFFFCE365)
//val md_theme_light_onSecondaryContainer = Color(0xFF211B00)
//val md_theme_light_tertiary = Color(0xFF4B670A)
//val md_theme_light_onTertiary = Color(0xFFFFFFFF)
//val md_theme_light_tertiaryContainer = Color(0xFFCBEF86)
//val md_theme_light_onTertiaryContainer = Color(0xFF141F00)
//val md_theme_light_error = Color(0xFFBA1A1A)
//val md_theme_light_errorContainer = Color(0xFFFFDAD6)
//val md_theme_light_onError = Color(0xFFFFFFFF)
//val md_theme_light_onErrorContainer = Color(0xFF410002)
//val md_theme_light_background = Color(0xFFF7FFED)
//val md_theme_light_onBackground = Color(0xFF032100)
//val md_theme_light_surface = Color(0xFFF7FFED)
//val md_theme_light_onSurface = Color(0xFF032100)
//val md_theme_light_surfaceVariant = Color(0xFFEBE1CF)
//val md_theme_light_onSurfaceVariant = Color(0xFF4C4639)
//val md_theme_light_outline = Color(0xFF7E7667)
//val md_theme_light_inverseOnSurface = Color(0xFFCBFFB5)
//val md_theme_light_inverseSurface = Color(0xFF083900)
//val md_theme_light_inversePrimary = Color(0xFFEFC125)
//val md_theme_light_shadow = Color(0xFF000000)
//val md_theme_light_surfaceTint = Color(0xFF745B00)
//
val md_theme_dark_primary = Color(0xFFEFC125)
val md_theme_dark_onPrimary = Color(0xFF3D2F00)
val md_theme_dark_primaryContainer = Color(0xFF584400)
val md_theme_dark_onPrimaryContainer = Color(0xFFFFE08C)
val md_theme_dark_secondary = Color(0xFFDEC64C)
val md_theme_dark_onSecondary = Color(0xFF393000)
val md_theme_dark_secondaryContainer = Color(0xFF524600)
val md_theme_dark_onSecondaryContainer = Color(0xFFFCE365)
val md_theme_dark_tertiary = Color(0xFFB0D36D)
val md_theme_dark_onTertiary = Color(0xFF243600)
val md_theme_dark_tertiaryContainer = Color(0xFF364E00)
val md_theme_dark_onTertiaryContainer = Color(0xFFCBEF86)
val md_theme_dark_error = Color(0xFFFFB4AB)
val md_theme_dark_errorContainer = Color(0xFF93000A)
val md_theme_dark_onError = Color(0xFF690005)
val md_theme_dark_onErrorContainer = Color(0xFFFFDAD6)
val md_theme_dark_background = Color(0xFF032100)
val md_theme_dark_onBackground = Color(0xFFB4F39B)
val md_theme_dark_surface = Color(0xFF032100)
val md_theme_dark_onSurface = Color(0xFFB4F39B)
val md_theme_dark_surfaceVariant = Color(0xFF4C4639)
val md_theme_dark_onSurfaceVariant = Color(0xFFCFC5B4)
val md_theme_dark_outline = Color(0xFF989080)
val md_theme_dark_inverseOnSurface = Color(0xFF032100)
val md_theme_dark_inverseSurface = Color(0xFFB4F39B)
val md_theme_dark_inversePrimary = Color(0xFF745B00)
val md_theme_dark_shadow = Color(0xFF000000)
val md_theme_dark_surfaceTint = Color(0xFFEFC125)
val seed = Color(0xFFE2B513)
//val md_theme_dark_primaryContainer = Color(0xFF584400)
//val md_theme_dark_onPrimaryContainer = Color(0xFFFFE08C)
//val md_theme_dark_secondary = Color(0xFFDEC64C)
//val md_theme_dark_onSecondary = Color(0xFF393000)
//val md_theme_dark_secondaryContainer = Color(0xFF524600)
//val md_theme_dark_onSecondaryContainer = Color(0xFFFCE365)
//val md_theme_dark_tertiary = Color(0xFFB0D36D)
//val md_theme_dark_onTertiary = Color(0xFF243600)
//val md_theme_dark_tertiaryContainer = Color(0xFF364E00)
//val md_theme_dark_onTertiaryContainer = Color(0xFFCBEF86)
//val md_theme_dark_error = Color(0xFFFFB4AB)
//val md_theme_dark_errorContainer = Color(0xFF93000A)
//val md_theme_dark_onError = Color(0xFF690005)
//val md_theme_dark_onErrorContainer = Color(0xFFFFDAD6)
//val md_theme_dark_background = Color(0xFF032100)
//val md_theme_dark_onBackground = Color(0xFFB4F39B)
//val md_theme_dark_surface = Color(0xFF032100)
//val md_theme_dark_onSurface = Color(0xFFB4F39B)
//val md_theme_dark_surfaceVariant = Color(0xFF4C4639)
//val md_theme_dark_onSurfaceVariant = Color(0xFFCFC5B4)
//val md_theme_dark_outline = Color(0xFF989080)
//val md_theme_dark_inverseOnSurface = Color(0xFF032100)
//val md_theme_dark_inverseSurface = Color(0xFFB4F39B)
//val md_theme_dark_inversePrimary = Color(0xFF745B00)
//val md_theme_dark_shadow = Color(0xFF000000)
//val md_theme_dark_surfaceTint = Color(0xFFEFC125)
//
//val seed = Color(0xFFE2B513)