mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-02-01 19:59:14 +00:00
Add theme generated from the Material Theme Builder
This commit is contained in:
parent
c98ad62163
commit
43bbddcc26
@ -4,7 +4,6 @@ import android.os.Bundle
|
|||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.compose.material3.MaterialTheme
|
|
||||||
import androidx.compose.material3.Surface
|
import androidx.compose.material3.Surface
|
||||||
import androidx.compose.ui.platform.ComposeView
|
import androidx.compose.ui.platform.ComposeView
|
||||||
import androidx.compose.ui.platform.ViewCompositionStrategy
|
import androidx.compose.ui.platform.ViewCompositionStrategy
|
||||||
@ -26,7 +25,7 @@ class RelatedItemsFragment : Fragment() {
|
|||||||
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
|
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
|
||||||
setContent {
|
setContent {
|
||||||
AppTheme {
|
AppTheme {
|
||||||
Surface(color = MaterialTheme.colorScheme.background) {
|
Surface {
|
||||||
RelatedItems(requireArguments().serializable<StreamInfo>(KEY_INFO)!!)
|
RelatedItems(requireArguments().serializable<StreamInfo>(KEY_INFO)!!)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,6 @@ import androidx.compose.material3.Icon
|
|||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.SearchBar
|
import androidx.compose.material3.SearchBar
|
||||||
import androidx.compose.material3.SearchBarDefaults
|
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.material3.TopAppBar
|
import androidx.compose.material3.TopAppBar
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
@ -91,14 +90,7 @@ fun Toolbar(
|
|||||||
active = true,
|
active = true,
|
||||||
onActiveChange = {
|
onActiveChange = {
|
||||||
isSearchActive = it
|
isSearchActive = it
|
||||||
},
|
}
|
||||||
colors = SearchBarDefaults.colors(
|
|
||||||
containerColor = MaterialTheme.colorScheme.background,
|
|
||||||
inputFieldColors = SearchBarDefaults.inputFieldColors(
|
|
||||||
focusedTextColor = MaterialTheme.colorScheme.onBackground,
|
|
||||||
unfocusedTextColor = MaterialTheme.colorScheme.onBackground
|
|
||||||
)
|
|
||||||
)
|
|
||||||
) {
|
) {
|
||||||
onSearchQueryChange?.invoke(query)?.takeIf { it.isNotEmpty() }
|
onSearchQueryChange?.invoke(query)?.takeIf { it.isNotEmpty() }
|
||||||
?.map { suggestionText -> SearchSuggestionItem(text = suggestionText) }
|
?.map { suggestionText -> SearchSuggestionItem(text = suggestionText) }
|
||||||
|
@ -5,7 +5,6 @@ import androidx.annotation.StringRes
|
|||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.wrapContentSize
|
import androidx.compose.foundation.layout.wrapContentSize
|
||||||
import androidx.compose.material3.MaterialTheme
|
|
||||||
import androidx.compose.material3.Surface
|
import androidx.compose.material3.Surface
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
@ -35,7 +34,7 @@ fun NoItemsMessage(@StringRes message: Int) {
|
|||||||
@Composable
|
@Composable
|
||||||
private fun NoItemsMessagePreview() {
|
private fun NoItemsMessagePreview() {
|
||||||
AppTheme {
|
AppTheme {
|
||||||
Surface(color = MaterialTheme.colorScheme.background) {
|
Surface {
|
||||||
NoItemsMessage(message = R.string.no_videos)
|
NoItemsMessage(message = R.string.no_videos)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ private fun PlaylistListItemPreview() {
|
|||||||
playlist.uploaderName = "Uploader"
|
playlist.uploaderName = "Uploader"
|
||||||
|
|
||||||
AppTheme {
|
AppTheme {
|
||||||
Surface(color = MaterialTheme.colorScheme.background) {
|
Surface {
|
||||||
PlaylistListItem(playlist)
|
PlaylistListItem(playlist)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ private fun StreamListItemPreview(
|
|||||||
@PreviewParameter(StreamItemPreviewProvider::class) stream: StreamInfoItem
|
@PreviewParameter(StreamItemPreviewProvider::class) stream: StreamInfoItem
|
||||||
) {
|
) {
|
||||||
AppTheme {
|
AppTheme {
|
||||||
Surface(color = MaterialTheme.colorScheme.background) {
|
Surface {
|
||||||
StreamListItem(stream, showProgress = false, isSelected = false)
|
StreamListItem(stream, showProgress = false, isSelected = false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
package org.schabi.newpipe.ui.components.items.stream
|
package org.schabi.newpipe.ui.components.items.stream
|
||||||
|
|
||||||
import androidx.annotation.StringRes
|
|
||||||
import androidx.compose.material3.DropdownMenu
|
import androidx.compose.material3.DropdownMenu
|
||||||
import androidx.compose.material3.DropdownMenuItem
|
import androidx.compose.material3.DropdownMenuItem
|
||||||
import androidx.compose.material3.MaterialTheme
|
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
@ -34,8 +32,8 @@ fun StreamMenu(
|
|||||||
|
|
||||||
DropdownMenu(expanded = expanded, onDismissRequest = onDismissRequest) {
|
DropdownMenu(expanded = expanded, onDismissRequest = onDismissRequest) {
|
||||||
if (playerHolder.isPlayQueueReady) {
|
if (playerHolder.isPlayQueueReady) {
|
||||||
StreamMenuItem(
|
DropdownMenuItem(
|
||||||
text = R.string.enqueue_stream,
|
text = { Text(text = stringResource(R.string.enqueue_stream)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onDismissRequest()
|
onDismissRequest()
|
||||||
SparseItemUtil.fetchItemInfoIfSparse(context, stream) {
|
SparseItemUtil.fetchItemInfoIfSparse(context, stream) {
|
||||||
@ -45,8 +43,8 @@ fun StreamMenu(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (playerHolder.queuePosition < playerHolder.queueSize - 1) {
|
if (playerHolder.queuePosition < playerHolder.queueSize - 1) {
|
||||||
StreamMenuItem(
|
DropdownMenuItem(
|
||||||
text = R.string.enqueue_next_stream,
|
text = { Text(text = stringResource(R.string.enqueue_next_stream)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onDismissRequest()
|
onDismissRequest()
|
||||||
SparseItemUtil.fetchItemInfoIfSparse(context, stream) {
|
SparseItemUtil.fetchItemInfoIfSparse(context, stream) {
|
||||||
@ -57,8 +55,8 @@ fun StreamMenu(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StreamMenuItem(
|
DropdownMenuItem(
|
||||||
text = R.string.start_here_on_background,
|
text = { Text(text = stringResource(R.string.start_here_on_background)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onDismissRequest()
|
onDismissRequest()
|
||||||
SparseItemUtil.fetchItemInfoIfSparse(context, stream) {
|
SparseItemUtil.fetchItemInfoIfSparse(context, stream) {
|
||||||
@ -66,8 +64,8 @@ fun StreamMenu(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
StreamMenuItem(
|
DropdownMenuItem(
|
||||||
text = R.string.start_here_on_popup,
|
text = { Text(text = stringResource(R.string.start_here_on_popup)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onDismissRequest()
|
onDismissRequest()
|
||||||
SparseItemUtil.fetchItemInfoIfSparse(context, stream) {
|
SparseItemUtil.fetchItemInfoIfSparse(context, stream) {
|
||||||
@ -75,8 +73,8 @@ fun StreamMenu(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
StreamMenuItem(
|
DropdownMenuItem(
|
||||||
text = R.string.download,
|
text = { Text(text = stringResource(R.string.download)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onDismissRequest()
|
onDismissRequest()
|
||||||
SparseItemUtil.fetchStreamInfoAndSaveToDatabase(
|
SparseItemUtil.fetchStreamInfoAndSaveToDatabase(
|
||||||
@ -89,8 +87,8 @@ fun StreamMenu(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
StreamMenuItem(
|
DropdownMenuItem(
|
||||||
text = R.string.add_to_playlist,
|
text = { Text(text = stringResource(R.string.add_to_playlist)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onDismissRequest()
|
onDismissRequest()
|
||||||
val list = listOf(StreamEntity(stream))
|
val list = listOf(StreamEntity(stream))
|
||||||
@ -103,29 +101,29 @@ fun StreamMenu(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
StreamMenuItem(
|
DropdownMenuItem(
|
||||||
text = R.string.share,
|
text = { Text(text = stringResource(R.string.share)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onDismissRequest()
|
onDismissRequest()
|
||||||
ShareUtils.shareText(context, stream.name, stream.url, stream.thumbnails)
|
ShareUtils.shareText(context, stream.name, stream.url, stream.thumbnails)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
StreamMenuItem(
|
DropdownMenuItem(
|
||||||
text = R.string.open_in_browser,
|
text = { Text(text = stringResource(R.string.open_in_browser)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onDismissRequest()
|
onDismissRequest()
|
||||||
ShareUtils.openUrlInBrowser(context, stream.url)
|
ShareUtils.openUrlInBrowser(context, stream.url)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
StreamMenuItem(
|
DropdownMenuItem(
|
||||||
text = R.string.mark_as_watched,
|
text = { Text(text = stringResource(R.string.mark_as_watched)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onDismissRequest()
|
onDismissRequest()
|
||||||
streamViewModel.markAsWatched(stream)
|
streamViewModel.markAsWatched(stream)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
StreamMenuItem(
|
DropdownMenuItem(
|
||||||
text = R.string.show_channel_details,
|
text = { Text(text = stringResource(R.string.show_channel_details)) },
|
||||||
onClick = {
|
onClick = {
|
||||||
onDismissRequest()
|
onDismissRequest()
|
||||||
SparseItemUtil.fetchUploaderUrlIfSparse(
|
SparseItemUtil.fetchUploaderUrlIfSparse(
|
||||||
@ -137,16 +135,3 @@ fun StreamMenu(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
|
||||||
private fun StreamMenuItem(
|
|
||||||
@StringRes text: Int,
|
|
||||||
onClick: () -> Unit
|
|
||||||
) {
|
|
||||||
DropdownMenuItem(
|
|
||||||
text = {
|
|
||||||
Text(text = stringResource(text), color = MaterialTheme.colorScheme.onBackground)
|
|
||||||
},
|
|
||||||
onClick = onClick
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
@ -5,7 +5,6 @@ import androidx.compose.foundation.layout.Arrangement
|
|||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.material3.MaterialTheme
|
|
||||||
import androidx.compose.material3.Surface
|
import androidx.compose.material3.Surface
|
||||||
import androidx.compose.material3.Switch
|
import androidx.compose.material3.Switch
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
@ -92,7 +91,7 @@ private fun RelatedItemsPreview() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
AppTheme {
|
AppTheme {
|
||||||
Surface(color = MaterialTheme.colorScheme.background) {
|
Surface {
|
||||||
RelatedItems(info)
|
RelatedItems(info)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,62 +2,74 @@ package org.schabi.newpipe.ui.theme
|
|||||||
|
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
|
||||||
val md_theme_light_primary = Color(0xFFBB171C)
|
val primaryLight = Color(0xFF904A45)
|
||||||
val md_theme_light_onPrimary = Color(0xFFFFFFFF)
|
val onPrimaryLight = Color(0xFFFFFFFF)
|
||||||
val md_theme_light_primaryContainer = Color(0xFFFFDAD6)
|
val primaryContainerLight = Color(0xFFFFDAD6)
|
||||||
val md_theme_light_onPrimaryContainer = Color(0xFF410002)
|
val onPrimaryContainerLight = Color(0xFF3B0908)
|
||||||
val md_theme_light_secondary = Color(0xFF984061)
|
val secondaryLight = Color(0xFF775653)
|
||||||
val md_theme_light_onSecondary = Color(0xFFFFFFFF)
|
val onSecondaryLight = Color(0xFFFFFFFF)
|
||||||
val md_theme_light_secondaryContainer = Color(0xFFFFD9E2)
|
val secondaryContainerLight = Color(0xFFFFDAD6)
|
||||||
val md_theme_light_onSecondaryContainer = Color(0xFF3E001D)
|
val onSecondaryContainerLight = Color(0xFF2C1513)
|
||||||
val md_theme_light_tertiary = Color(0xFF006874)
|
val tertiaryLight = Color(0xFF725B2E)
|
||||||
val md_theme_light_onTertiary = Color(0xFFFFFFFF)
|
val onTertiaryLight = Color(0xFFFFFFFF)
|
||||||
val md_theme_light_tertiaryContainer = Color(0xFF97F0FF)
|
val tertiaryContainerLight = Color(0xFFFEDEA6)
|
||||||
val md_theme_light_onTertiaryContainer = Color(0xFF001F24)
|
val onTertiaryContainerLight = Color(0xFF261900)
|
||||||
val md_theme_light_error = Color(0xFFBA1A1A)
|
val errorLight = Color(0xFFBA1A1A)
|
||||||
val md_theme_light_errorContainer = Color(0xFFFFDAD6)
|
val onErrorLight = Color(0xFFFFFFFF)
|
||||||
val md_theme_light_onError = Color(0xFFFFFFFF)
|
val errorContainerLight = Color(0xFFFFDAD6)
|
||||||
val md_theme_light_onErrorContainer = Color(0xFF410002)
|
val onErrorContainerLight = Color(0xFF410002)
|
||||||
val md_theme_light_background = Color(0xFFEEEEEE)
|
val backgroundLight = Color(0xFFFFF8F7)
|
||||||
val md_theme_light_onBackground = Color(0xFF1B1B1B)
|
val onBackgroundLight = Color(0xFF231918)
|
||||||
val md_theme_light_surface = Color(0xFFE53835)
|
val surfaceLight = Color(0xFFFFF8F7)
|
||||||
val md_theme_light_onSurface = Color(0xFFFFFFFF)
|
val onSurfaceLight = Color(0xFF231918)
|
||||||
val md_theme_light_surfaceVariant = Color(0xFFF5DDDB)
|
val surfaceVariantLight = Color(0xFFF5DDDB)
|
||||||
val md_theme_light_onSurfaceVariant = Color(0xFF534341)
|
val onSurfaceVariantLight = Color(0xFF534342)
|
||||||
val md_theme_light_outline = Color(0xFF857371)
|
val outlineLight = Color(0xFF857371)
|
||||||
val md_theme_light_inverseOnSurface = Color(0xFFD6F6FF)
|
val outlineVariantLight = Color(0xFFD8C2BF)
|
||||||
val md_theme_light_inverseSurface = Color(0xFF00363F)
|
val scrimLight = Color(0xFF000000)
|
||||||
val md_theme_light_inversePrimary = Color(0xFFFFB4AC)
|
val inverseSurfaceLight = Color(0xFF392E2D)
|
||||||
val md_theme_light_surfaceTint = Color(0xFFBB171C)
|
val inverseOnSurfaceLight = Color(0xFFFFEDEB)
|
||||||
val md_theme_light_outlineVariant = Color(0xFFD8C2BF)
|
val inversePrimaryLight = Color(0xFFFFB3AC)
|
||||||
val md_theme_light_scrim = Color(0xFF000000)
|
val surfaceDimLight = Color(0xFFE8D6D4)
|
||||||
|
val surfaceBrightLight = Color(0xFFFFF8F7)
|
||||||
|
val surfaceContainerLowestLight = Color(0xFFFFFFFF)
|
||||||
|
val surfaceContainerLowLight = Color(0xFFFFF0EF)
|
||||||
|
val surfaceContainerLight = Color(0xFFFCEAE8)
|
||||||
|
val surfaceContainerHighLight = Color(0xFFF6E4E2)
|
||||||
|
val surfaceContainerHighestLight = Color(0xFFF1DEDC)
|
||||||
|
|
||||||
val md_theme_dark_primary = Color(0xFFFFB4AC)
|
val primaryDark = Color(0xFFFFB3AC)
|
||||||
val md_theme_dark_onPrimary = Color(0xFF690006)
|
val onPrimaryDark = Color(0xFF571E1B)
|
||||||
val md_theme_dark_primaryContainer = Color(0xFF93000D)
|
val primaryContainerDark = Color(0xFF73332F)
|
||||||
val md_theme_dark_onPrimaryContainer = Color(0xFFFFDAD6)
|
val onPrimaryContainerDark = Color(0xFFFFDAD6)
|
||||||
val md_theme_dark_secondary = Color(0xFFFFB1C8)
|
val secondaryDark = Color(0xFFE7BDB8)
|
||||||
val md_theme_dark_onSecondary = Color(0xFF5E1133)
|
val onSecondaryDark = Color(0xFF442927)
|
||||||
val md_theme_dark_secondaryContainer = Color(0xFF7B2949)
|
val secondaryContainerDark = Color(0xFF5D3F3C)
|
||||||
val md_theme_dark_onSecondaryContainer = Color(0xFFFFD9E2)
|
val onSecondaryContainerDark = Color(0xFFFFDAD6)
|
||||||
val md_theme_dark_tertiary = Color(0xFF4FD8EB)
|
val tertiaryDark = Color(0xFFE1C38C)
|
||||||
val md_theme_dark_onTertiary = Color(0xFF00363D)
|
val onTertiaryDark = Color(0xFF402D04)
|
||||||
val md_theme_dark_tertiaryContainer = Color(0xFF004F58)
|
val tertiaryContainerDark = Color(0xFF584419)
|
||||||
val md_theme_dark_onTertiaryContainer = Color(0xFF97F0FF)
|
val onTertiaryContainerDark = Color(0xFFFEDEA6)
|
||||||
val md_theme_dark_error = Color(0xFFFFB4AB)
|
val errorDark = Color(0xFFFFB4AB)
|
||||||
val md_theme_dark_errorContainer = Color(0xFF93000A)
|
val onErrorDark = Color(0xFF690005)
|
||||||
val md_theme_dark_onError = Color(0xFF690005)
|
val errorContainerDark = Color(0xFF93000A)
|
||||||
val md_theme_dark_onErrorContainer = Color(0xFFFFDAD6)
|
val onErrorContainerDark = Color(0xFFFFDAD6)
|
||||||
val md_theme_dark_background = Color(0xFF212121)
|
val backgroundDark = Color(0xFF1A1110)
|
||||||
val md_theme_dark_onBackground = Color(0xFFFFFFFF)
|
val onBackgroundDark = Color(0xFFF1DEDC)
|
||||||
val md_theme_dark_surface = Color(0xFF992521)
|
val surfaceDark = Color(0xFF1A1110)
|
||||||
val md_theme_dark_onSurface = Color(0xFFFFFFFF)
|
val onSurfaceDark = Color(0xFFF1DEDC)
|
||||||
val md_theme_dark_surfaceVariant = Color(0xFF534341)
|
val surfaceVariantDark = Color(0xFF534342)
|
||||||
val md_theme_dark_onSurfaceVariant = Color(0xFFD8C2BF)
|
val onSurfaceVariantDark = Color(0xFFD8C2BF)
|
||||||
val md_theme_dark_outline = Color(0xFFA08C8A)
|
val outlineDark = Color(0xFFA08C8A)
|
||||||
val md_theme_dark_inverseOnSurface = Color(0xFF001F25)
|
val outlineVariantDark = Color(0xFF534342)
|
||||||
val md_theme_dark_inverseSurface = Color(0xFFA6EEFF)
|
val scrimDark = Color(0xFF000000)
|
||||||
val md_theme_dark_inversePrimary = Color(0xFFBB171C)
|
val inverseSurfaceDark = Color(0xFFF1DEDC)
|
||||||
val md_theme_dark_surfaceTint = Color(0xFFFFB4AC)
|
val inverseOnSurfaceDark = Color(0xFF392E2D)
|
||||||
val md_theme_dark_outlineVariant = Color(0xFF534341)
|
val inversePrimaryDark = Color(0xFF904A45)
|
||||||
val md_theme_dark_scrim = Color(0xFF000000)
|
val surfaceDimDark = Color(0xFF1A1110)
|
||||||
|
val surfaceBrightDark = Color(0xFF423735)
|
||||||
|
val surfaceContainerLowestDark = Color(0xFF140C0B)
|
||||||
|
val surfaceContainerLowDark = Color(0xFF231918)
|
||||||
|
val surfaceContainerDark = Color(0xFF271D1C)
|
||||||
|
val surfaceContainerHighDark = Color(0xFF322827)
|
||||||
|
val surfaceContainerHighestDark = Color(0xFF3D3231)
|
||||||
|
@ -9,71 +9,83 @@ import androidx.compose.ui.graphics.Color
|
|||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.preference.PreferenceManager
|
import androidx.preference.PreferenceManager
|
||||||
|
|
||||||
private val LightColors = lightColorScheme(
|
private val lightScheme = lightColorScheme(
|
||||||
primary = md_theme_light_primary,
|
primary = primaryLight,
|
||||||
onPrimary = md_theme_light_onPrimary,
|
onPrimary = onPrimaryLight,
|
||||||
primaryContainer = md_theme_light_primaryContainer,
|
primaryContainer = primaryContainerLight,
|
||||||
onPrimaryContainer = md_theme_light_onPrimaryContainer,
|
onPrimaryContainer = onPrimaryContainerLight,
|
||||||
secondary = md_theme_light_secondary,
|
secondary = secondaryLight,
|
||||||
onSecondary = md_theme_light_onSecondary,
|
onSecondary = onSecondaryLight,
|
||||||
secondaryContainer = md_theme_light_secondaryContainer,
|
secondaryContainer = secondaryContainerLight,
|
||||||
onSecondaryContainer = md_theme_light_onSecondaryContainer,
|
onSecondaryContainer = onSecondaryContainerLight,
|
||||||
tertiary = md_theme_light_tertiary,
|
tertiary = tertiaryLight,
|
||||||
onTertiary = md_theme_light_onTertiary,
|
onTertiary = onTertiaryLight,
|
||||||
tertiaryContainer = md_theme_light_tertiaryContainer,
|
tertiaryContainer = tertiaryContainerLight,
|
||||||
onTertiaryContainer = md_theme_light_onTertiaryContainer,
|
onTertiaryContainer = onTertiaryContainerLight,
|
||||||
error = md_theme_light_error,
|
error = errorLight,
|
||||||
errorContainer = md_theme_light_errorContainer,
|
onError = onErrorLight,
|
||||||
onError = md_theme_light_onError,
|
errorContainer = errorContainerLight,
|
||||||
onErrorContainer = md_theme_light_onErrorContainer,
|
onErrorContainer = onErrorContainerLight,
|
||||||
background = md_theme_light_background,
|
background = backgroundLight,
|
||||||
onBackground = md_theme_light_onBackground,
|
onBackground = onBackgroundLight,
|
||||||
surface = md_theme_light_surface,
|
surface = surfaceLight,
|
||||||
onSurface = md_theme_light_onSurface,
|
onSurface = onSurfaceLight,
|
||||||
surfaceVariant = md_theme_light_surfaceVariant,
|
surfaceVariant = surfaceVariantLight,
|
||||||
onSurfaceVariant = md_theme_light_onSurfaceVariant,
|
onSurfaceVariant = onSurfaceVariantLight,
|
||||||
outline = md_theme_light_outline,
|
outline = outlineLight,
|
||||||
inverseOnSurface = md_theme_light_inverseOnSurface,
|
outlineVariant = outlineVariantLight,
|
||||||
inverseSurface = md_theme_light_inverseSurface,
|
scrim = scrimLight,
|
||||||
inversePrimary = md_theme_light_inversePrimary,
|
inverseSurface = inverseSurfaceLight,
|
||||||
surfaceTint = md_theme_light_surfaceTint,
|
inverseOnSurface = inverseOnSurfaceLight,
|
||||||
outlineVariant = md_theme_light_outlineVariant,
|
inversePrimary = inversePrimaryLight,
|
||||||
scrim = md_theme_light_scrim,
|
surfaceDim = surfaceDimLight,
|
||||||
|
surfaceBright = surfaceBrightLight,
|
||||||
|
surfaceContainerLowest = surfaceContainerLowestLight,
|
||||||
|
surfaceContainerLow = surfaceContainerLowLight,
|
||||||
|
surfaceContainer = surfaceContainerLight,
|
||||||
|
surfaceContainerHigh = surfaceContainerHighLight,
|
||||||
|
surfaceContainerHighest = surfaceContainerHighestLight,
|
||||||
)
|
)
|
||||||
|
|
||||||
private val DarkColors = darkColorScheme(
|
private val darkScheme = darkColorScheme(
|
||||||
primary = md_theme_dark_primary,
|
primary = primaryDark,
|
||||||
onPrimary = md_theme_dark_onPrimary,
|
onPrimary = onPrimaryDark,
|
||||||
primaryContainer = md_theme_dark_primaryContainer,
|
primaryContainer = primaryContainerDark,
|
||||||
onPrimaryContainer = md_theme_dark_onPrimaryContainer,
|
onPrimaryContainer = onPrimaryContainerDark,
|
||||||
secondary = md_theme_dark_secondary,
|
secondary = secondaryDark,
|
||||||
onSecondary = md_theme_dark_onSecondary,
|
onSecondary = onSecondaryDark,
|
||||||
secondaryContainer = md_theme_dark_secondaryContainer,
|
secondaryContainer = secondaryContainerDark,
|
||||||
onSecondaryContainer = md_theme_dark_onSecondaryContainer,
|
onSecondaryContainer = onSecondaryContainerDark,
|
||||||
tertiary = md_theme_dark_tertiary,
|
tertiary = tertiaryDark,
|
||||||
onTertiary = md_theme_dark_onTertiary,
|
onTertiary = onTertiaryDark,
|
||||||
tertiaryContainer = md_theme_dark_tertiaryContainer,
|
tertiaryContainer = tertiaryContainerDark,
|
||||||
onTertiaryContainer = md_theme_dark_onTertiaryContainer,
|
onTertiaryContainer = onTertiaryContainerDark,
|
||||||
error = md_theme_dark_error,
|
error = errorDark,
|
||||||
errorContainer = md_theme_dark_errorContainer,
|
onError = onErrorDark,
|
||||||
onError = md_theme_dark_onError,
|
errorContainer = errorContainerDark,
|
||||||
onErrorContainer = md_theme_dark_onErrorContainer,
|
onErrorContainer = onErrorContainerDark,
|
||||||
background = md_theme_dark_background,
|
background = backgroundDark,
|
||||||
onBackground = md_theme_dark_onBackground,
|
onBackground = onBackgroundDark,
|
||||||
surface = md_theme_dark_surface,
|
surface = surfaceDark,
|
||||||
onSurface = md_theme_dark_onSurface,
|
onSurface = onSurfaceDark,
|
||||||
surfaceVariant = md_theme_dark_surfaceVariant,
|
surfaceVariant = surfaceVariantDark,
|
||||||
onSurfaceVariant = md_theme_dark_onSurfaceVariant,
|
onSurfaceVariant = onSurfaceVariantDark,
|
||||||
outline = md_theme_dark_outline,
|
outline = outlineDark,
|
||||||
inverseOnSurface = md_theme_dark_inverseOnSurface,
|
outlineVariant = outlineVariantDark,
|
||||||
inverseSurface = md_theme_dark_inverseSurface,
|
scrim = scrimDark,
|
||||||
inversePrimary = md_theme_dark_inversePrimary,
|
inverseSurface = inverseSurfaceDark,
|
||||||
surfaceTint = md_theme_dark_surfaceTint,
|
inverseOnSurface = inverseOnSurfaceDark,
|
||||||
outlineVariant = md_theme_dark_outlineVariant,
|
inversePrimary = inversePrimaryDark,
|
||||||
scrim = md_theme_dark_scrim,
|
surfaceDim = surfaceDimDark,
|
||||||
|
surfaceBright = surfaceBrightDark,
|
||||||
|
surfaceContainerLowest = surfaceContainerLowestDark,
|
||||||
|
surfaceContainerLow = surfaceContainerLowDark,
|
||||||
|
surfaceContainer = surfaceContainerDark,
|
||||||
|
surfaceContainerHigh = surfaceContainerHighDark,
|
||||||
|
surfaceContainerHighest = surfaceContainerHighestDark,
|
||||||
)
|
)
|
||||||
|
|
||||||
private val BlackColors = DarkColors.copy(background = Color.Black)
|
private val blackScheme = darkScheme.copy(surface = Color.Black)
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun AppTheme(useDarkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) {
|
fun AppTheme(useDarkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) {
|
||||||
@ -83,11 +95,11 @@ fun AppTheme(useDarkTheme: Boolean = isSystemInDarkTheme(), content: @Composable
|
|||||||
|
|
||||||
MaterialTheme(
|
MaterialTheme(
|
||||||
colorScheme = if (!useDarkTheme) {
|
colorScheme = if (!useDarkTheme) {
|
||||||
LightColors
|
lightScheme
|
||||||
} else if (theme == "black_theme" || nightTheme == "black_theme") {
|
} else if (theme == "black_theme" || nightTheme == "black_theme") {
|
||||||
BlackColors
|
blackScheme
|
||||||
} else {
|
} else {
|
||||||
DarkColors
|
darkScheme
|
||||||
},
|
},
|
||||||
content = content
|
content = content
|
||||||
)
|
)
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
<color name="placeholder_foreground">#6C6C6C</color>
|
<color name="placeholder_foreground">#6C6C6C</color>
|
||||||
|
|
||||||
<!-- Light Theme -->
|
<!-- Light Theme -->
|
||||||
<color name="light_background_color">#EEEEEE</color>
|
<color name="light_background_color">#FFFFF8F7</color>
|
||||||
<color name="light_dialog_background_color">#EEEEEE</color>
|
<color name="light_dialog_background_color">#FFFFF8F7</color>
|
||||||
<color name="light_settings_accent_color">#e53935</color>
|
<color name="light_settings_accent_color">#e53935</color>
|
||||||
<color name="light_separator_color">#32000000</color>
|
<color name="light_separator_color">#32000000</color>
|
||||||
<color name="light_ripple_color">#48868686</color>
|
<color name="light_ripple_color">#48868686</color>
|
||||||
@ -25,7 +25,7 @@
|
|||||||
<color name="light_border_color">#33000000</color>
|
<color name="light_border_color">#33000000</color>
|
||||||
|
|
||||||
<!-- Dark Theme -->
|
<!-- Dark Theme -->
|
||||||
<color name="dark_background_color">#222222</color>
|
<color name="dark_background_color">#FF1A1110</color>
|
||||||
<color name="dark_dialog_background_color">#424242</color>
|
<color name="dark_dialog_background_color">#424242</color>
|
||||||
<color name="dark_settings_accent_color">#ff5252</color>
|
<color name="dark_settings_accent_color">#ff5252</color>
|
||||||
<color name="dark_separator_color">#0affffff</color>
|
<color name="dark_separator_color">#0affffff</color>
|
||||||
|
Loading…
Reference in New Issue
Block a user