Added M3 theme to intro pages (#756)

* Added M3 theme

Signed-off-by: Arnau Mora <arnyminerz@proton.me>

* Don't use M2 colors anymore

---------

Signed-off-by: Arnau Mora <arnyminerz@proton.me>
Co-authored-by: Sunik Kupfer <kupfer@bitfire.at>
Co-authored-by: Ricki Hirner <hirner@bitfire.at>
This commit is contained in:
Arnau Mora 2024-05-15 15:59:53 +02:00 committed by GitHub
parent 6b863164a4
commit b5334887e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 8 deletions

View file

@ -24,8 +24,8 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.lifecycle.ViewModel
import at.bitfire.davdroid.log.Logger
import at.bitfire.davdroid.ui.M2Colors
import at.bitfire.davdroid.ui.M2Theme
import at.bitfire.davdroid.ui.AppTheme
import at.bitfire.davdroid.ui.M3ColorScheme
import com.github.appintro.AppIntro2
import dagger.hilt.android.AndroidEntryPoint
import dagger.hilt.android.lifecycle.HiltViewModel
@ -49,7 +49,7 @@ class IntroActivity : AppIntro2() {
})
}
setBarColor(M2Colors.primaryDark.toArgb())
setBarColor(M3ColorScheme.LightColors.primary.toArgb())
isSkipButtonEnabled = false
onBackPressedDispatcher.addCallback(this) {
@ -88,7 +88,7 @@ class IntroActivity : AppIntro2() {
ComposeView(requireActivity()).apply {
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
setContent {
M2Theme {
AppTheme {
Box(Modifier.padding(bottom = dimensionResource(com.github.appintro.R.dimen.appintro2_bottombar_height))) {
page.ComposePage()
}

View file

@ -4,7 +4,6 @@
package at.bitfire.davdroid.ui.intro
import android.app.Application
import android.content.res.Configuration
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
@ -31,7 +30,6 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import at.bitfire.davdroid.R
import at.bitfire.davdroid.ui.M2Colors.primaryDark
class WelcomePage: IntroPage {
@ -55,7 +53,7 @@ class WelcomePage: IntroPage {
Column(
modifier = Modifier
.fillMaxSize()
.background(color = primaryDark),
.background(color = MaterialTheme.colorScheme.primary),
) {
Image(
painter = painterResource(R.drawable.ic_launcher_foreground),
@ -108,7 +106,7 @@ class WelcomePage: IntroPage {
Row(
modifier = Modifier
.fillMaxSize()
.background(color = primaryDark)
.background(color = MaterialTheme.colorScheme.primary)
.padding(
bottom = dimensionResource(
com.github.appintro.R.dimen.appintro2_bottombar_height