Skip to content

Commit

Permalink
Merge pull request #15 from skydoves/deps/2023.07
Browse files Browse the repository at this point in the history
Update Kotlin to 1.8.22, AGO to 7.4.2, Coroutines, and other dependencies
  • Loading branch information
skydoves authored Jul 16, 2023
2 parents e02a22d + 4e0f9ca commit bd7e1d1
Show file tree
Hide file tree
Showing 27 changed files with 292 additions and 237 deletions.
6 changes: 3 additions & 3 deletions app/src/main/kotlin/com/skydoves/whatifdemo/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class MainActivity : ComponentActivity() {
.align(Alignment.Center)
.clickable { isBlueColor = !isBlueColor }
.whatIfMap(isBlueColor, { it.background(Color.Blue) }, { it.background(Color.Cyan) })
.whatIfMap(isBlueColor, { it.size(120.dp) }, { it.size(240.dp) })
.whatIfMap(isBlueColor, { it.size(120.dp) }, { it.size(240.dp) }),
)
}
}
Expand All @@ -80,7 +80,7 @@ class MainActivity : ComponentActivity() {
// example2 : nullable Boolean true-false check extension with whatIfNot
nullableBoolean.whatIf(
whatIf = { log("not-null and true : $nullableBoolean") },
whatIfNot = { log("null or false : $nullableBoolean") }
whatIfNot = { log("null or false : $nullableBoolean") },
)

// example3 : nullable String true-false check extension with default value.
Expand All @@ -105,7 +105,7 @@ class MainActivity : ComponentActivity() {
whatIfNot = {
log("$it is short.")
"short"
}
},
)
}

Expand Down
20 changes: 10 additions & 10 deletions app/src/main/kotlin/com/skydoves/whatifdemo/theme/Type.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@ val DarkTypography = Typography(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Bold,
color = Color.White,
fontSize = 28.sp
fontSize = 28.sp,
),
h2 = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Bold,
color = Color.White,
fontSize = 21.sp
fontSize = 21.sp,
),
body1 = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
color = Color.White,
fontSize = 14.sp
fontSize = 14.sp,
),
body2 = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
color = white87,
fontSize = 14.sp
)
fontSize = 14.sp,
),
)

// set of light material typography styles to start with.
Expand All @@ -57,24 +57,24 @@ val LightTypography = Typography(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Bold,
color = background900,
fontSize = 28.sp
fontSize = 28.sp,
),
h2 = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Bold,
color = background900,
fontSize = 21.sp
fontSize = 21.sp,
),
body1 = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
color = background800,
fontSize = 14.sp
fontSize = 14.sp,
),
body2 = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
color = background800,
fontSize = 14.sp
)
fontSize = 14.sp,
),
)
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private val DarkColorPalette = darkColors(
primaryVariant = purple500,
secondary = purple500,
onPrimary = Color.White,
onSecondary = Color.White
onSecondary = Color.White,
)

private val LightColorPalette = lightColors(
Expand All @@ -39,13 +39,13 @@ private val LightColorPalette = lightColors(
primaryVariant = purple500,
secondary = purple500,
onPrimary = Color.White,
onSecondary = Color.White
onSecondary = Color.White,
)

@Composable
fun WhatIfTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
content: @Composable () -> Unit
content: @Composable () -> Unit,
) {
val colors = if (darkTheme) {
DarkColorPalette
Expand All @@ -62,6 +62,6 @@ fun WhatIfTheme(
MaterialTheme(
colors = colors,
typography = typography,
content = content
content = content,
)
}
8 changes: 2 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@ plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.nexusPlugin)
alias(libs.plugins.kotlin.binary.compatibility) apply false
alias(libs.plugins.nexus.plugin)
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
alias(libs.plugins.kotlinBinaryCompatibilityValidator)
}

apply(from ="${rootDir}/scripts/publish-root.gradle")

apiValidation {
ignoredProjects.addAll(listOf("app"))
}

subprojects {
if (name != "app") {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
Expand Down
33 changes: 18 additions & 15 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
[versions]
agp = "7.4.0"
kotlin = "1.8.0"
agp = "7.4.2"
kotlin = "1.8.22"
dokka = "1.8.20"
nexusPlugin = "1.3.0"
kotlinBinaryCompatibility = "0.13.1"
javaRelease = "8"
jvmTarget = "1.8"
kotlinpoet = "1.12.0"
material = "1.6.1"
androidxActivity = "1.4.0"
androidxAppCompat = "1.5.1"
androidxCompose = "1.3.1"
androidxComposeCompiler = "1.4.0"
landscapist = "2.1.1"
coroutines = "1.6.4"
material = "1.9.0"
androidxActivity = "1.7.2"
androidxAppCompat = "1.6.1"
androidxCompose = "1.4.3"
androidxComposeCompiler = "1.4.8"
landscapist = "2.2.2"
coroutines = "1.7.1"
retrofit = "2.9.0"
retrofitAdapters = "1.0.5"
retrofitAdapters = "1.0.6"
robolectric = "4.4"
spotless = "6.19.0"

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
dokka = { id = "org.jetbrains.dokka", version = "1.7.10" }
nexusPlugin = { id = "io.github.gradle-nexus.publish-plugin", version = "1.1.0" }
spotless = { id = "com.diffplug.spotless", version = "6.7.0" }
kotlinBinaryCompatibilityValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.11.0" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
nexus-plugin = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexusPlugin" }
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
kotlin-binary-compatibility = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "kotlinBinaryCompatibility" }

[libraries]
agp = { module = "com.android.tools.build:gradle", version.ref = "agp" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 1 addition & 0 deletions whatif-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
plugins {
id(libs.plugins.android.library.get().pluginId)
id(libs.plugins.kotlin.android.get().pluginId)
id(libs.plugins.kotlin.binary.compatibility.get().pluginId)
}

rootProject.extra.apply {
Expand Down
Loading

0 comments on commit bd7e1d1

Please sign in to comment.