forked from Writand/writand
Merge branch 'frontend/material3-migration' into 'main'
other: migrated to material version 3 (originally version 2) See merge request EmmaVandewalle/writand!33
This commit is contained in:
commit
72b63766d9
7 changed files with 27 additions and 27 deletions
|
@ -59,16 +59,16 @@ android {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'androidx.core:core-ktx:1.13.1'
|
implementation 'androidx.core:core-ktx:1.13.1'
|
||||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.3'
|
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.4'
|
||||||
implementation 'androidx.activity:activity-compose:1.9.0'
|
implementation 'androidx.activity:activity-compose:1.9.1'
|
||||||
implementation "androidx.compose.ui:ui:$compose_ui_version"
|
implementation "androidx.compose.ui:ui:$compose_ui_version"
|
||||||
implementation "androidx.compose.ui:ui-tooling-preview:$compose_ui_version"
|
implementation "androidx.compose.ui:ui-tooling-preview:$compose_ui_version"
|
||||||
implementation 'androidx.compose.material:material:1.6.8'
|
implementation "androidx.compose.material3:material3:1.2.1"
|
||||||
implementation 'androidx.test:core-ktx:1.6.1'
|
implementation 'androidx.test:core-ktx:1.6.1'
|
||||||
implementation 'com.google.ar:core:1.44.0'
|
implementation 'com.google.ar:core:1.44.0'
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
||||||
|
|
||||||
// Testing
|
// Testing
|
||||||
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_ui_version"
|
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_ui_version"
|
||||||
|
@ -79,7 +79,7 @@ dependencies {
|
||||||
// Mockito testing
|
// Mockito testing
|
||||||
testImplementation "org.mockito.kotlin:mockito-kotlin:3.2.0"
|
testImplementation "org.mockito.kotlin:mockito-kotlin:3.2.0"
|
||||||
testImplementation "org.robolectric:robolectric:4.4"
|
testImplementation "org.robolectric:robolectric:4.4"
|
||||||
testImplementation "androidx.test.ext:junit-ktx:1.1.5"
|
testImplementation "androidx.test.ext:junit-ktx:1.2.1"
|
||||||
testImplementation 'org.powermock:powermock-api-mockito:1.4.12'
|
testImplementation 'org.powermock:powermock-api-mockito:1.4.12'
|
||||||
testImplementation 'org.powermock:powermock-module-junit4:1.6.2'
|
testImplementation 'org.powermock:powermock-module-junit4:1.6.2'
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@ import android.os.Bundle
|
||||||
import androidx.activity.ComponentActivity
|
import androidx.activity.ComponentActivity
|
||||||
import androidx.activity.compose.setContent
|
import androidx.activity.compose.setContent
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.material.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material.Surface
|
import androidx.compose.material3.Surface
|
||||||
import androidx.compose.material.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
|
@ -20,7 +20,7 @@ class MainActivity : ComponentActivity() {
|
||||||
// A surface container using the 'background' color from the theme
|
// A surface container using the 'background' color from the theme
|
||||||
Surface(
|
Surface(
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
color = MaterialTheme.colors.primary
|
color = MaterialTheme.colorScheme.primary
|
||||||
) {
|
) {
|
||||||
Greeting("Android")
|
Greeting("Android")
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,9 @@ package be.re.writand.screens.components
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.material.Button
|
import androidx.compose.material3.Button
|
||||||
import androidx.compose.material.ButtonDefaults
|
import androidx.compose.material3.ButtonDefaults
|
||||||
import androidx.compose.material.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
@ -25,7 +25,7 @@ fun WButton(
|
||||||
) {
|
) {
|
||||||
Button(
|
Button(
|
||||||
onClick = onClick,
|
onClick = onClick,
|
||||||
colors = ButtonDefaults.buttonColors(backgroundColor = MainGreen),
|
colors = ButtonDefaults.buttonColors(containerColor = MainGreen),
|
||||||
shape = RoundedCornerShape(10.dp),
|
shape = RoundedCornerShape(10.dp),
|
||||||
enabled = enabled
|
enabled = enabled
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package be.re.writand.ui.theme
|
package be.re.writand.ui.theme
|
||||||
|
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.material.Shapes
|
import androidx.compose.material3.Shapes
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
|
||||||
val Shapes = Shapes(
|
val Shapes = Shapes(
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
package be.re.writand.ui.theme
|
package be.re.writand.ui.theme
|
||||||
|
|
||||||
import androidx.compose.foundation.isSystemInDarkTheme
|
import androidx.compose.foundation.isSystemInDarkTheme
|
||||||
import androidx.compose.material.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material.darkColors
|
import androidx.compose.material3.darkColorScheme
|
||||||
import androidx.compose.material.lightColors
|
import androidx.compose.material3.lightColorScheme
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
|
||||||
private val DarkColorPalette = darkColors(
|
private val DarkColorPalette = darkColorScheme(
|
||||||
primary = MainGrey,
|
primary = MainGrey,
|
||||||
primaryVariant = VariantDarkGrey,
|
secondary = VariantDarkGrey,
|
||||||
secondary = MainGreen,
|
tertiary = MainGreen,
|
||||||
onBackground = Color.White
|
onBackground = Color.White
|
||||||
)
|
)
|
||||||
|
|
||||||
private val LightColorPalette = lightColors(
|
private val LightColorPalette = lightColorScheme(
|
||||||
primary = Color.White,
|
primary = Color.White,
|
||||||
primaryVariant = VariantLightGrey,
|
secondary = VariantLightGrey,
|
||||||
secondary = MainGreen,
|
tertiary = MainGreen,
|
||||||
onBackground = Color.Black
|
onBackground = Color.Black
|
||||||
|
|
||||||
/* Other default colors to override
|
/* Other default colors to override
|
||||||
|
@ -39,7 +39,7 @@ fun WritandTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composabl
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialTheme(
|
MaterialTheme(
|
||||||
colors = colors,
|
colorScheme = colors,
|
||||||
typography = Typography,
|
typography = Typography,
|
||||||
shapes = Shapes,
|
shapes = Shapes,
|
||||||
content = content,
|
content = content,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package be.re.writand.ui.theme
|
package be.re.writand.ui.theme
|
||||||
|
|
||||||
import androidx.compose.material.Typography
|
import androidx.compose.material3.Typography
|
||||||
import androidx.compose.ui.text.TextStyle
|
import androidx.compose.ui.text.TextStyle
|
||||||
import androidx.compose.ui.text.font.FontFamily
|
import androidx.compose.ui.text.font.FontFamily
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
|
@ -8,7 +8,7 @@ import androidx.compose.ui.unit.sp
|
||||||
|
|
||||||
// Set of Material typography styles to start with
|
// Set of Material typography styles to start with
|
||||||
val Typography = Typography(
|
val Typography = Typography(
|
||||||
body1 = TextStyle(
|
bodyLarge = TextStyle(
|
||||||
fontFamily = FontFamily.Default,
|
fontFamily = FontFamily.Default,
|
||||||
fontWeight = FontWeight.Normal,
|
fontWeight = FontWeight.Normal,
|
||||||
fontSize = 16.sp
|
fontSize = 16.sp
|
||||||
|
|
Loading…
Reference in a new issue