Merge pull request #4226 from element-hq/feature/bma/themeOverride

Theme override
This commit is contained in:
Benoit Marty 2025-02-06 16:48:16 +01:00 committed by GitHub
commit 5456f0e38e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
111 changed files with 293 additions and 275 deletions

View file

@ -27,7 +27,6 @@ import androidx.compose.foundation.layout.systemBarsPadding
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Lock
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
@ -316,7 +315,7 @@ private fun PinUnlockHeader(
.fillMaxWidth(),
textAlign = TextAlign.Center,
style = ElementTheme.typography.fontHeadingMdBold,
color = MaterialTheme.colorScheme.primary,
color = ElementTheme.colors.textPrimary,
)
Spacer(Modifier.height(8.dp))
val remainingAttempts = state.remainingAttempts.dataOrNull()
@ -330,9 +329,9 @@ private fun PinUnlockHeader(
""
}
val subtitleColor = if (state.showWrongPinTitle) {
MaterialTheme.colorScheme.error
ElementTheme.colors.textCriticalPrimary
} else {
MaterialTheme.colorScheme.secondary
ElementTheme.colors.textSecondary
}
Text(
text = subtitle,

View file

@ -16,6 +16,7 @@ import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.lifecycleScope
import io.element.android.compound.theme.ElementTheme
import io.element.android.features.enterprise.api.EnterpriseService
import io.element.android.features.lockscreen.api.LockScreenLockState
import io.element.android.features.lockscreen.api.LockScreenService
import io.element.android.features.lockscreen.impl.unlock.PinUnlockPresenter
@ -38,13 +39,17 @@ class PinUnlockActivity : AppCompatActivity() {
@Inject lateinit var presenter: PinUnlockPresenter
@Inject lateinit var lockScreenService: LockScreenService
@Inject lateinit var appPreferencesStore: AppPreferencesStore
@Inject lateinit var enterpriseService: EnterpriseService
override fun onCreate(savedInstanceState: Bundle?) {
enableEdgeToEdge()
super.onCreate(savedInstanceState)
bindings<PinUnlockBindings>().inject(this)
setContent {
ElementThemeApp(appPreferencesStore) {
ElementThemeApp(
appPreferencesStore = appPreferencesStore,
enterpriseService = enterpriseService,
) {
val state = presenter.present()
val isDark = ElementTheme.isLightTheme.not()
PinUnlockView(