Update gradle plugin

This commit is contained in:
2021-08-26 06:20:01 +02:00
parent 6b90784ab9
commit 150bc30d7e
6 changed files with 64 additions and 71 deletions
@@ -11,28 +11,28 @@ import androidx.compose.ui.tooling.preview.Preview
import com.ericampire.android.androidstudycase.ui.theme.AndroidStudyCaseTheme import com.ericampire.android.androidstudycase.ui.theme.AndroidStudyCaseTheme
class MainActivity : ComponentActivity() { class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContent { setContent {
AndroidStudyCaseTheme { AndroidStudyCaseTheme {
// A surface container using the 'background' color from the theme // A surface container using the 'background' color from the theme
Surface(color = MaterialTheme.colors.background) { Surface(color = MaterialTheme.colors.background) {
Greeting("Android") Greeting("Android")
}
}
} }
}
} }
}
} }
@Composable @Composable
fun Greeting(name: String) { fun Greeting(name: String) {
Text(text = "Hello $name!") Text(text = "Hello $name!")
} }
@Preview(showBackground = true) @Preview(showBackground = true)
@Composable @Composable
fun DefaultPreview() { fun DefaultPreview() {
AndroidStudyCaseTheme { AndroidStudyCaseTheme {
Greeting("Android") Greeting("Android")
} }
} }
@@ -5,7 +5,7 @@ import dagger.hilt.android.HiltAndroidApp
@HiltAndroidApp @HiltAndroidApp
class App : Application() { class App : Application() {
override fun onCreate() { override fun onCreate() {
super.onCreate() super.onCreate()
} }
} }
@@ -5,7 +5,7 @@ import androidx.compose.material.Shapes
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
val Shapes = Shapes( val Shapes = Shapes(
small = RoundedCornerShape(4.dp), small = RoundedCornerShape(4.dp),
medium = RoundedCornerShape(4.dp), medium = RoundedCornerShape(4.dp),
large = RoundedCornerShape(0.dp) large = RoundedCornerShape(0.dp)
) )
@@ -7,41 +7,41 @@ import androidx.compose.material.lightColors
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
private val DarkColorPalette = darkColors( private val DarkColorPalette = darkColors(
primary = Purple200, primary = Purple200,
primaryVariant = Purple700, primaryVariant = Purple700,
secondary = Teal200 secondary = Teal200
) )
private val LightColorPalette = lightColors( private val LightColorPalette = lightColors(
primary = Purple500, primary = Purple500,
primaryVariant = Purple700, primaryVariant = Purple700,
secondary = Teal200 secondary = Teal200
/* Other default colors to override /* Other default colors to override
background = Color.White, background = Color.White,
surface = Color.White, surface = Color.White,
onPrimary = Color.White, onPrimary = Color.White,
onSecondary = Color.Black, onSecondary = Color.Black,
onBackground = Color.Black, onBackground = Color.Black,
onSurface = Color.Black, onSurface = Color.Black,
*/ */
) )
@Composable @Composable
fun AndroidStudyCaseTheme( fun AndroidStudyCaseTheme(
darkTheme: Boolean = isSystemInDarkTheme(), darkTheme: Boolean = isSystemInDarkTheme(),
content: @Composable() () -> Unit content: @Composable() () -> Unit
) { ) {
val colors = if (darkTheme) { val colors = if (darkTheme) {
DarkColorPalette DarkColorPalette
} else { } else {
LightColorPalette LightColorPalette
} }
MaterialTheme( MaterialTheme(
colors = colors, colors = colors,
typography = Typography, typography = Typography,
shapes = Shapes, shapes = Shapes,
content = content content = content
) )
} }
@@ -6,23 +6,22 @@ import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
// Set of Material typography styles to start with
val Typography = Typography( val Typography = Typography(
body1 = TextStyle( body1 = TextStyle(
fontFamily = FontFamily.Default, fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal, fontWeight = FontWeight.Normal,
fontSize = 16.sp fontSize = 16.sp
) )
/* Other default text styles to override /* Other default text styles to override
button = TextStyle( button = TextStyle(
fontFamily = FontFamily.Default, fontFamily = FontFamily.Default,
fontWeight = FontWeight.W500, fontWeight = FontWeight.W500,
fontSize = 14.sp fontSize = 14.sp
), ),
caption = TextStyle( caption = TextStyle(
fontFamily = FontFamily.Default, fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal, fontWeight = FontWeight.Normal,
fontSize = 12.sp fontSize = 12.sp
) )
*/ */
) )
+1 -7
View File
@@ -7,13 +7,7 @@
#### suppress inspection "SpellCheckingInspection" for whole file #### suppress inspection "SpellCheckingInspection" for whole file
#### suppress inspection "UnusedProperty" for whole file #### suppress inspection "UnusedProperty" for whole file
plugin.android=7.0.0 plugin.android=7.0.1
## # available=7.1.0-alpha01
## # available=7.1.0-alpha02
## # available=7.1.0-alpha03
## # available=7.1.0-alpha04
## # available=7.1.0-alpha05
## # available=7.1.0-alpha06
version.androidx.activity=1.3.0-alpha08 version.androidx.activity=1.3.0-alpha08
version.androidx.preference=1.1.1 version.androidx.preference=1.1.1
version.androidx.appcompat=1.3.0 version.androidx.appcompat=1.3.0