mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-01 22:25:46 +01:00
Reshape entry point for V3 media screens.
This commit is contained in:
committed by
Greyson Parrelli
parent
6d944c0f8c
commit
5c415139fd
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2026 Signal Messenger, LLC
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package org.signal.core.ui
|
||||
|
||||
object CoreUiDependencies {
|
||||
|
||||
private lateinit var _provider: Provider
|
||||
|
||||
fun init(provider: Provider) {
|
||||
if (this::_provider.isInitialized) {
|
||||
return
|
||||
}
|
||||
|
||||
_provider = provider
|
||||
}
|
||||
|
||||
val isIncognitoKeyboardEnabled: Boolean
|
||||
get() = _provider.provideIsIncognitoKeyboardEnabled()
|
||||
|
||||
interface Provider {
|
||||
fun provideIsIncognitoKeyboardEnabled(): Boolean
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontStyle
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.sp
|
||||
import org.signal.core.ui.CoreUiDependencies
|
||||
import org.signal.core.ui.compose.ProvideIncognitoKeyboard
|
||||
|
||||
private val typography = Typography().run {
|
||||
@@ -190,7 +191,7 @@ private val darkSnackbarColors = SnackbarColors(
|
||||
@Composable
|
||||
fun SignalTheme(
|
||||
isDarkMode: Boolean = LocalConfiguration.current.uiMode and Configuration.UI_MODE_NIGHT_MASK == Configuration.UI_MODE_NIGHT_YES,
|
||||
incognitoKeyboardEnabled: Boolean = false,
|
||||
incognitoKeyboardEnabled: Boolean = CoreUiDependencies.isIncognitoKeyboardEnabled,
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
val extendedColors = if (isDarkMode) darkExtendedColors else lightExtendedColors
|
||||
|
||||
Reference in New Issue
Block a user