Skip to content

Commit

Permalink
Added M3 theme to intro pages (#756)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people committed May 15, 2024
1 parent 6b86316 commit b533488
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -49,7 +49,7 @@ class IntroActivity : AppIntro2() {
})
}

setBarColor(M2Colors.primaryDark.toArgb())
setBarColor(M3ColorScheme.LightColors.primary.toArgb())
isSkipButtonEnabled = false

onBackPressedDispatcher.addCallback(this) {
Expand Down Expand Up @@ -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()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {

Expand All @@ -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),
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b533488

Please sign in to comment.