Skip to content

Commit 44a4802

Browse files
update versions
1 parent b1fbd4c commit 44a4802

File tree

11 files changed

+328
-200
lines changed

11 files changed

+328
-200
lines changed

app/build.gradle

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
13
plugins {
2-
id 'com.android.application'
3-
id 'org.jetbrains.kotlin.android'
4+
alias(libs.plugins.android.application)
5+
alias(libs.plugins.kotlin.android)
6+
alias(libs.plugins.kotlin.compose)
47
}
58

69
android {
7-
compileSdk 33
10+
compileSdk libs.versions.compileSdk.get().toInteger()
811

912
defaultConfig {
1013
applicationId "com.smarttoolfactory.composematerialslider"
11-
minSdk 21
12-
targetSdk 33
14+
minSdk libs.versions.minSdk.get().toInteger()
15+
targetSdk libs.versions.targetSdk.get().toInteger()
1316
versionCode 1
1417
versionName "1.0"
1518

@@ -26,48 +29,48 @@ android {
2629
}
2730
}
2831
compileOptions {
29-
sourceCompatibility JavaVersion.VERSION_1_8
30-
targetCompatibility JavaVersion.VERSION_1_8
31-
}
32-
kotlinOptions {
33-
jvmTarget = '1.8'
32+
sourceCompatibility JavaVersion.VERSION_17
33+
targetCompatibility JavaVersion.VERSION_17
3434
}
3535
buildFeatures {
3636
compose true
3737
}
38-
composeOptions {
39-
kotlinCompilerExtensionVersion = "1.4.7"
40-
}
41-
packagingOptions {
38+
packaging {
4239
resources {
4340
excludes += '/META-INF/{AL2.0,LGPL2.1}'
4441
}
4542
}
4643
namespace 'com.smarttoolfactory.composematerialslider'
4744
}
4845

46+
kotlin {
47+
compilerOptions {
48+
jvmTarget = JvmTarget.JVM_17
49+
}
50+
}
51+
4952
dependencies {
53+
def composeBom = platform(libs.androidx.compose.bom)
5054

5155
implementation project(':slider')
56+
implementation composeBom
57+
androidTestImplementation composeBom
5258

53-
implementation 'androidx.core:core-ktx:1.10.0'
54-
implementation 'androidx.appcompat:appcompat:1.6.1'
55-
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
59+
implementation libs.androidx.core.ktx
60+
implementation libs.androidx.appcompat
61+
implementation libs.androidx.lifecycle.runtime.ktx
5662

57-
implementation "androidx.compose.ui:ui:$compose_version"
58-
implementation "androidx.compose.material:material:$compose_version"
59-
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
60-
implementation 'androidx.activity:activity-compose:1.7.1'
63+
implementation libs.androidx.activity.compose
64+
implementation libs.androidx.compose.foundation
65+
implementation libs.androidx.compose.ui
66+
implementation libs.androidx.compose.material
67+
implementation libs.androidx.compose.material.icons.extended
68+
implementation libs.androidx.compose.ui.tooling.preview
6169

62-
def accompanist_version = "0.27.0"
63-
// Accompanist
64-
implementation "com.google.accompanist:accompanist-systemuicontroller:$accompanist_version"
65-
implementation "com.google.accompanist:accompanist-pager:$accompanist_version"
66-
implementation "com.google.accompanist:accompanist-drawablepainter:$accompanist_version"
67-
68-
testImplementation 'junit:junit:4.13.2'
69-
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
70-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
71-
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
72-
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
73-
}
70+
testImplementation libs.junit4
71+
androidTestImplementation libs.androidx.test.ext.junit
72+
androidTestImplementation libs.androidx.test.espresso.core
73+
androidTestImplementation libs.androidx.compose.ui.test.junit4
74+
debugImplementation libs.androidx.compose.ui.test.manifest
75+
debugImplementation libs.androidx.compose.ui.tooling
76+
}

app/src/main/java/com/smarttoolfactory/composematerialslider/MainActivity.kt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@ import android.os.Bundle
44
import androidx.activity.ComponentActivity
55
import androidx.activity.compose.setContent
66
import androidx.compose.animation.ExperimentalAnimationApi
7+
import androidx.compose.foundation.pager.HorizontalPager
8+
import androidx.compose.foundation.pager.PagerState
9+
import androidx.compose.foundation.pager.rememberPagerState
710
import androidx.compose.foundation.layout.*
811
import androidx.compose.material.*
912
import androidx.compose.runtime.Composable
1013
import androidx.compose.runtime.rememberCoroutineScope
1114
import androidx.compose.ui.Modifier
1215
import androidx.compose.ui.graphics.Color
1316
import androidx.compose.ui.unit.dp
14-
import com.google.accompanist.pager.*
1517
import com.smarttoolfactory.composematerialslider.demo.*
1618
import com.smarttoolfactory.composematerialslider.ui.theme.BlueSmartDark
1719
import com.smarttoolfactory.composematerialslider.ui.theme.ComposeMaterialSliderTheme
1820
import kotlinx.coroutines.launch
1921

20-
@ExperimentalPagerApi
2122
class MainActivity : ComponentActivity() {
2223
override fun onCreate(savedInstanceState: Bundle?) {
2324
super.onCreate(savedInstanceState)
@@ -36,12 +37,14 @@ class MainActivity : ComponentActivity() {
3637
}
3738
}
3839

39-
@ExperimentalPagerApi
4040
@OptIn(ExperimentalAnimationApi::class)
4141
@Composable
4242
private fun HomeContent() {
4343

44-
val pagerState: PagerState = rememberPagerState(initialPage = 0)
44+
val pagerState: PagerState = rememberPagerState(
45+
initialPage = 0,
46+
pageCount = { tabList.size }
47+
)
4548
val coroutineScope = rememberCoroutineScope()
4649

4750
ScrollableTabRow(
@@ -67,10 +70,7 @@ private fun HomeContent() {
6770
}
6871
}
6972

70-
HorizontalPager(
71-
state = pagerState,
72-
count = tabList.size
73-
) { page: Int ->
73+
HorizontalPager(state = pagerState) { page: Int ->
7474

7575
when (page) {
7676
0 -> ColorfulSliderDemo()
@@ -92,4 +92,3 @@ internal val tabList =
9292
"Slider Gradients1",
9393
"Slider Gradients2",
9494
)
95-

app/src/main/java/com/smarttoolfactory/composematerialslider/demo/SliderGradientDemo2.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ fun SliderGradientDemo2() {
3737
HSVSliderExamples(modifier, sliderModifier)
3838
HSLSliderExamples(modifier, sliderModifier)
3939
RGBSliderExamples(modifier, sliderModifier)
40+
4041
}
4142
}
4243

build.gradle

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
buildscript {
2-
ext {
3-
compose_version = '1.4.3'
4-
}
5-
}
61
plugins {
7-
id 'com.android.application' version '8.0.0-rc01' apply false
8-
id 'com.android.library' version '8.0.0-rc01' apply false
9-
id 'org.jetbrains.kotlin.android' version '1.8.21' apply false
10-
}
2+
alias(libs.plugins.android.application) apply false
3+
alias(libs.plugins.android.library) apply false
4+
alias(libs.plugins.kotlin.android) apply false
5+
alias(libs.plugins.kotlin.compose) apply false
6+
}

gradle.properties

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,14 @@ org.gradle.parallel=true
55
org.gradle.caching=true
66

77
android.useAndroidX=true
8-
android.nonTransitiveRClass=true
8+
android.nonTransitiveRClass=true
9+
android.defaults.buildfeatures.resvalues=true
10+
android.sdk.defaultTargetSdkToCompileSdkIfUnset=false
11+
android.enableAppCompileTimeRClass=false
12+
android.usesSdkInManifest.disallowed=false
13+
android.uniquePackageNames=false
14+
android.dependency.useConstraints=true
15+
android.r8.strictFullModeForKeepRules=false
16+
android.r8.optimizedResourceShrinking=false
17+
android.builtInKotlin=false
18+
android.newDsl=false

gradle/libs.versions.toml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
[versions]
2+
agp = "9.0.1"
3+
kotlin = "2.3.10"
4+
compileSdk = "36"
5+
targetSdk = "36"
6+
minSdk = "23"
7+
composeBom = "2026.02.01"
8+
coreKtx = "1.17.0"
9+
appcompat = "1.7.1"
10+
lifecycle = "2.10.0"
11+
activityCompose = "1.12.4"
12+
junit4 = "4.13.2"
13+
androidxJunit = "1.3.0"
14+
espresso = "3.7.0"
15+
16+
[libraries]
17+
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
18+
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
19+
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycle" }
20+
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
21+
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
22+
androidx-compose-foundation = { group = "androidx.compose.foundation", name = "foundation" }
23+
androidx-compose-material = { group = "androidx.compose.material", name = "material" }
24+
androidx-compose-material-icons-extended = { group = "androidx.compose.material", name = "material-icons-extended" }
25+
androidx-compose-runtime = { group = "androidx.compose.runtime", name = "runtime" }
26+
androidx-compose-ui = { group = "androidx.compose.ui", name = "ui" }
27+
androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
28+
androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
29+
androidx-compose-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
30+
androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
31+
junit4 = { group = "junit", name = "junit", version.ref = "junit4" }
32+
androidx-test-ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidxJunit" }
33+
androidx-test-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso" }
34+
35+
[plugins]
36+
android-application = { id = "com.android.application", version.ref = "agp" }
37+
android-library = { id = "com.android.library", version.ref = "agp" }
38+
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
39+
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }

gradle/wrapper/gradle-wrapper.jar

-13.4 KB
Binary file not shown.
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#Sat May 21 20:06:04 TRT 2022
21
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
42
distributionPath=wrapper/dists
5-
zipStorePath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)