diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 562d3ae1..57897618 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -30,10 +30,10 @@ jobs: java-version: 17 - name: Setup Gradle - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 - name: Install Android SDK - uses: malinskiy/action-android/install-sdk@release/0.1.4 + uses: malinskiy/action-android/install-sdk@release/0.1.6 - name: Run quality checks run: ./gradlew --build-cache check --stacktrace @@ -42,7 +42,7 @@ jobs: run: ./gradlew --build-cache assembleRelease ui_test: - runs-on: macos-12 + runs-on: ubuntu-latest timeout-minutes: 60 strategy: fail-fast: false @@ -55,13 +55,26 @@ jobs: - name: checkout uses: actions/checkout@v3 + - name: Enable KVM + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + - uses: actions/setup-java@v3 with: distribution: 'zulu' java-version: 17 - - name: Gradle cache - uses: gradle/gradle-build-action@v2 + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: false - name: Compile instrumented tests run: ./gradlew --build-cache assembleDebugAndroidTest diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 124fc828..3a2cbb07 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -26,10 +26,10 @@ jobs: java-version: 17 - name: Setup Gradle - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 - name: Install Android SDK - uses: malinskiy/action-android/install-sdk@release/0.1.4 + uses: malinskiy/action-android/install-sdk@release/0.1.6 - name: Run quality checks run: ./gradlew --build-cache check --stacktrace @@ -56,8 +56,21 @@ jobs: distribution: 'zulu' java-version: 17 - - name: Gradle cache - uses: gradle/gradle-build-action@v2 + - name: Enable KVM + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: false - name: Compile instrumented tests run: ./gradlew --build-cache assembleDebugAndroidTest diff --git a/build.gradle b/build.gradle index 1e416fd5..97df539a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,24 +1,22 @@ buildscript { apply from: 'versions.gradle' - - dependencies { - classpath "org.jacoco:org.jacoco.core:$testVersions.jacoco" - classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$versions.navigation" + repositories { + google() + mavenCentral() + gradlePluginPortal() } } plugins { - id 'com.android.application' version '8.2.2' apply false - id 'com.android.library' version '8.2.2' apply false - id 'org.jetbrains.kotlin.android' version '1.9.22' apply false - id 'org.jetbrains.kotlinx.binary-compatibility-validator' version '0.13.0' + alias libs.plugins.android.application apply false + alias libs.plugins.android.library apply false + alias libs.plugins.kotlin.android apply false + alias libs.plugins.kotlin.kover apply false + alias libs.plugins.androidx.navigation.safeargs apply false + id 'org.jetbrains.kotlinx.binary-compatibility-validator' version "0.14.0" } apiValidation { ignoredProjects += ["sample", "dpadrecyclerview-test-fixtures"] ignoredClasses += "com.rubensousa.dpadrecyclerview.BuildConfig" } - -task clean(type: Delete) { - delete rootProject.buildDir -} \ No newline at end of file diff --git a/dpadrecyclerview-compose/build.gradle b/dpadrecyclerview-compose/build.gradle index c486cc4a..0df1fa5e 100644 --- a/dpadrecyclerview-compose/build.gradle +++ b/dpadrecyclerview-compose/build.gradle @@ -1,6 +1,6 @@ plugins { - id 'com.android.library' - id 'org.jetbrains.kotlin.android' + alias(libs.plugins.android.library) + alias(libs.plugins.kotlin.android) } apply from: "$rootProject.projectDir/gradle/publish.gradle" @@ -30,10 +30,6 @@ android { compose true } - testOptions { - // execution 'ANDROIDX_TEST_ORCHESTRATOR' - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -44,7 +40,7 @@ android { } composeOptions { - kotlinCompilerExtensionVersion = "$composeVersions.compiler" + kotlinCompilerExtensionVersion = libs.versions.androidx.compose.compiler.get() } publishing { @@ -57,22 +53,20 @@ android { } dependencies { - implementation project(':dpadrecyclerview') - implementation "androidx.appcompat:appcompat:$versions.appcompat" - implementation "androidx.recyclerview:recyclerview:$versions.recyclerview" - implementation "androidx.customview:customview-poolingcontainer:$versions.poolingContainer" - implementation "androidx.compose.runtime:runtime:$composeVersions.runtime" - implementation "androidx.compose.ui:ui:$composeVersions.ui" + api project(':dpadrecyclerview') + implementation libs.androidx.appcompat + implementation libs.androidx.recyclerview + implementation libs.androidx.customview.poolingcontainer + implementation libs.androidx.compose.ui // Test dependencies - debugImplementation("androidx.compose.ui:ui-test-manifest:$composeVersions.ui") - debugImplementation "androidx.compose.ui:ui-tooling:$composeVersions.ui" - debugImplementation "androidx.compose.ui:ui-tooling-preview:$composeVersions.ui" - debugImplementation "androidx.compose.material3:material3:$composeVersions.material3" - debugImplementation 'androidx.customview:customview:1.1.0' - - androidTestImplementation project (':dpadrecyclerview-testing') - androidTestImplementation project (':dpadrecyclerview-test-fixtures') - androidTestImplementation("androidx.compose.ui:ui-test-junit4:$composeVersions.ui") - androidTestUtil "androidx.test.services:test-services:$testVersions.services" + debugImplementation libs.androidx.test.compose.ui.manifest + debugImplementation libs.androidx.compose.ui.tooling + debugImplementation libs.androidx.compose.ui.tooling.preview + debugImplementation libs.androidx.compose.material3 + debugImplementation libs.androidx.customview + androidTestImplementation project(':dpadrecyclerview-testing') + androidTestImplementation project(':dpadrecyclerview-test-fixtures') + androidTestImplementation libs.androidx.test.compose.ui.junit4 + androidTestUtil libs.androidx.test.services } diff --git a/dpadrecyclerview-test-fixtures/build.gradle b/dpadrecyclerview-test-fixtures/build.gradle index 3cbc6d4a..2d8b3283 100644 --- a/dpadrecyclerview-test-fixtures/build.gradle +++ b/dpadrecyclerview-test-fixtures/build.gradle @@ -1,6 +1,6 @@ plugins { - id 'com.android.library' - id 'org.jetbrains.kotlin.android' + alias(libs.plugins.android.library) + alias(libs.plugins.kotlin.android) } apply from: "$rootProject.projectDir/gradle/coverage.gradle" @@ -10,17 +10,12 @@ android { compileSdk versions.compileSdkVersion defaultConfig { - minSdk 19 + minSdk versions.minSdkVersion targetSdk versions.targetSdkVersion testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" } - - buildTypes { - release { - } - } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -32,11 +27,10 @@ android { dependencies { implementation project (':dpadrecyclerview') - implementation "androidx.recyclerview:recyclerview:$versions.recyclerview" - implementation "androidx.collection:collection-ktx:1.2.0" - implementation "junit:junit:$testVersions.junit" - implementation "com.google.truth:truth:$testVersions.truth" - api "androidx.test.uiautomator:uiautomator:$testVersions.uiautomator" - api "androidx.test:runner:$testVersions.runner" - testImplementation "com.google.truth:truth:$testVersions.truth" + implementation libs.androidx.recyclerview + implementation libs.androidx.collection + implementation libs.junit + implementation libs.truth + implementation libs.androidx.test.uiautomator + implementation libs.androidx.test.runner } diff --git a/dpadrecyclerview-testing/build.gradle b/dpadrecyclerview-testing/build.gradle index 32e433c5..b9ed4454 100644 --- a/dpadrecyclerview-testing/build.gradle +++ b/dpadrecyclerview-testing/build.gradle @@ -1,6 +1,6 @@ plugins { - id 'com.android.library' - id 'org.jetbrains.kotlin.android' + alias(libs.plugins.android.library) + alias(libs.plugins.kotlin.android) } apply from: "$rootProject.projectDir/gradle/publish.gradle" @@ -11,7 +11,7 @@ android { compileSdk versions.compileSdkVersion defaultConfig { - minSdk 19 + minSdk versions.minSdkVersion targetSdk versions.targetSdkVersion testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunnerArguments useTestStorageService: 'true' @@ -31,10 +31,6 @@ android { buildConfig false } - testOptions { - // execution 'ANDROIDX_TEST_ORCHESTRATOR' - } - compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -55,20 +51,18 @@ android { dependencies { implementation project (':dpadrecyclerview') - debugImplementation "androidx.fragment:fragment-testing-manifest:$versions.fragment" - api "androidx.recyclerview:recyclerview:$versions.recyclerview" - api "androidx.test:runner:$testVersions.runner" - api "androidx.test:core-ktx:$testVersions.core" - api "androidx.test:rules:$testVersions.rules" - api "androidx.test.ext:truth:$testVersions.espressoTruth" - api "androidx.test.ext:junit-ktx:$testVersions.espressoJunit" - api "androidx.test.espresso:espresso-idling-resource:$testVersions.espresso" - api "androidx.test.espresso:espresso-core:$testVersions.espresso" - api "androidx.test.espresso:espresso-contrib:$testVersions.espresso" - api "androidx.test.uiautomator:uiautomator:$testVersions.uiautomator" - - //noinspection FragmentGradleConfiguration - androidTestImplementation "androidx.fragment:fragment-testing:$versions.fragment" + debugImplementation libs.androidx.fragment.testing.manifest + api libs.androidx.test.runner + api libs.androidx.test.core.ktx + api libs.androidx.test.rules + api libs.androidx.test.rules + api libs.androidx.test.truth + api libs.androidx.test.junit + api libs.androidx.test.espresso.core + api libs.androidx.test.espresso.idling + api libs.androidx.test.espresso.contrib + api libs.androidx.test.uiautomator + androidTestImplementation libs.androidx.fragment.testing androidTestImplementation project (':dpadrecyclerview-test-fixtures') - androidTestUtil "androidx.test.services:test-services:$testVersions.services" + androidTestUtil libs.androidx.test.services } diff --git a/dpadrecyclerview/build.gradle b/dpadrecyclerview/build.gradle index de4075c2..3966bfcb 100644 --- a/dpadrecyclerview/build.gradle +++ b/dpadrecyclerview/build.gradle @@ -1,6 +1,6 @@ plugins { - id 'com.android.library' - id 'org.jetbrains.kotlin.android' + alias(libs.plugins.android.library) + alias(libs.plugins.kotlin.android) } apply from: "$rootProject.projectDir/gradle/publish.gradle" @@ -11,12 +11,11 @@ android { compileSdk versions.compileSdkVersion defaultConfig { - minSdk 19 + minSdk versions.minSdkVersion targetSdk versions.targetSdkVersion testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunnerArguments useTestStorageService: 'true' testInstrumentationRunnerArguments listener: 'com.rubensousa.dpadrecyclerview.testfixtures.recording.TestRecordingListener' - multiDexEnabled true } buildTypes { @@ -34,7 +33,6 @@ android { testOptions { unitTests.returnDefaultValues = true - // execution 'ANDROIDX_TEST_ORCHESTRATOR' } compileOptions { @@ -55,16 +53,19 @@ android { } dependencies { - api "androidx.recyclerview:recyclerview:$versions.recyclerview" - implementation "androidx.collection:collection-ktx:$versions.collection" - testImplementation "junit:junit:$testVersions.junit" - testImplementation "com.google.truth:truth:$testVersions.truth" - testImplementation "io.mockk:mockk:$testVersions.mockk" + api libs.androidx.recyclerview + implementation libs.androidx.collection + + // Required for dependency resolution + debugImplementation libs.guava + debugImplementation libs.androidx.fragment.testing.manifest + testImplementation libs.junit + testImplementation libs.truth + testImplementation libs.mockk testImplementation project (':dpadrecyclerview-test-fixtures') - debugImplementation "androidx.fragment:fragment-testing-manifest:$versions.fragment" - //noinspection FragmentGradleConfiguration - androidTestImplementation "androidx.fragment:fragment-testing:$versions.fragment" + + androidTestImplementation libs.androidx.fragment.testing androidTestImplementation project (':dpadrecyclerview-testing') androidTestImplementation project (':dpadrecyclerview-test-fixtures') - androidTestUtil "androidx.test.services:test-services:$testVersions.services" + androidTestUtil libs.androidx.test.services } diff --git a/gradle/coverage.gradle b/gradle/coverage.gradle index 66a02f8a..257d06cc 100644 --- a/gradle/coverage.gradle +++ b/gradle/coverage.gradle @@ -1,7 +1,8 @@ apply plugin: 'jacoco' +apply plugin: 'org.jetbrains.kotlinx.kover' jacoco { - toolVersion = testVersions.jacoco + toolVersion = libs.versions.jacoco.get() } tasks.withType(Test).configureEach { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000..cccec27c --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,88 @@ +[versions] +android-gradle-plugin = "8.3.0" +androidx-appcompat = "1.6.1" +androidx-collection = "1.4.0" +androidx-concurrent-futures = "1.1.0" +androidx-compose-compiler = "1.5.10" +androidx-compose-material3 = '1.2.1' +androidx-compose-ui = "1.6.3" +androidx-constraintlayout = "2.1.4" +androidx-customview = "1.1.0" +androidx-fragment = "1.7.0-alpha10" +androidx-interpolator = "1.0.0" +androidx-leanback = "1.0.0-alpha03" +androidx-lifecycle = "2.7.0" +androidx-navigation = "2.7.7" +androidx-paging = "3.2.1" +androidx-poolingcontainer = "1.0.0" +androidx-recyclerview = "1.3.2" +androidx-test-core = '1.5.0' +androidx-test-espresso = '3.5.1' +androidx-test-espressoJunit = '1.1.5' +androidx-test-espressoTruth = '1.5.0' +androidx-test-orchestrator = '1.4.2' +androidx-test-rules = '1.5.0' +androidx-test-runner = '1.5.2' +androidx-test-services = '1.4.2' +androidx-test-uiautomator = '2.3.0' + +guava = "33.1.0-android" +timber = "5.0.1" + + +decorator = "2.1.0" +kotlin = "1.9.22" +kover = "0.7.6" +jacoco = "0.8.11" +test-junit = '4.13.2' +test-truth = '1.4.1' +test-mockk = '1.13.10' + +[plugins] +android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" } +android-library = { id = "com.android.library", version.ref = "android-gradle-plugin" } +androidx-navigation-safeargs = { id = "androidx.navigation.safeargs.kotlin", version.ref = "androidx-navigation" } +jacoco = { id = "org.jacoco.core", version.ref = "jacoco" } +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +kotlin-kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" } + +[libraries] +androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" } +androidx-collection = { module = "androidx.collection:collection", version.ref = "androidx-collection" } +androidx-compose-material3 = { module = "androidx.compose.material3:material3-android", version.ref = "androidx-compose-material3" } +androidx-compose-ui = { module = "androidx.compose.ui:ui", version.ref = "androidx-compose-ui" } +androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "androidx-compose-ui" } +androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "androidx-compose-ui" } +androidx-concurrent-futures = { module = "androidx.concurrent:concurrent-futures", version.ref = "androidx-concurrent-futures" } +androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "androidx-constraintlayout" } +androidx-customview = { module = "androidx.customview:customview", version.ref = "androidx-customview" } +androidx-customview-poolingcontainer = { module = "androidx.customview:customview-poolingcontainer", version.ref = "androidx-poolingcontainer" } +androidx-fragment = { module = "androidx.fragment:fragment", version.ref = "androidx-fragment" } +androidx-fragment-testing = { module = "androidx.fragment:fragment-testing", version.ref = "androidx-fragment" } +androidx-fragment-testing-manifest = { module = "androidx.fragment:fragment-testing-manifest", version.ref = "androidx-fragment" } +androidx-interpolator = { module = "androidx.interpolator:interpolator", version.ref = "androidx-interpolator" } +androidx-leanback-grid = { module = "androidx.leanback:leanback-grid", version.ref = "androidx-leanback" } +androidx-lifecycle-livedata = { module = "androidx.lifecycle:lifecycle-livedata", version.ref = "androidx-lifecycle" } +androidx-lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel", version.ref = "androidx-lifecycle" } +androidx-navigation-fragment = { module = "androidx.navigation:navigation-fragment", version.ref = "androidx-navigation" } +androidx-navigation-ui = { module = "androidx.navigation:navigation-ui", version.ref = "androidx-navigation" } +androidx-paging-runtime = { module = "androidx.paging:paging-runtime", version.ref = "androidx-paging" } +androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "androidx-recyclerview" } +androidx-test-compose-ui-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "androidx-compose-ui" } +androidx-test-compose-ui-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "androidx-compose-ui" } +androidx-test-core-ktx = { module = "androidx.test:core-ktx", version.ref = "androidx-test-core" } +androidx-test-espresso-contrib = { module = "androidx.test.espresso:espresso-contrib", version.ref = "androidx-test-espresso" } +androidx-test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "androidx-test-espresso" } +androidx-test-espresso-idling = { module = "androidx.test.espresso:espresso-idling-resource", version.ref = "androidx-test-espresso" } +androidx-test-junit = { module = "androidx.test.ext:junit-ktx", version.ref = "androidx-test-espressoJunit" } +androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidx-test-rules" } +androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidx-test-runner" } +androidx-test-services = { module = "androidx.test.services:test-services", version.ref = "androidx-test-services" } +androidx-test-truth = { module = "androidx.test.ext:truth", version.ref = "androidx-test-espressoTruth" } +androidx-test-uiautomator = { module = "androidx.test.uiautomator:uiautomator", version.ref = "androidx-test-uiautomator" } +decorator = { module = "com.rubensousa:decorator", version.ref = "decorator" } +guava = { module = "com.google.guava:guava", version.ref = "guava" } +junit = { module = "junit:junit", version.ref = "test-junit" } +mockk = { module = "io.mockk:mockk", version.ref = "test-mockk" } +timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" } +truth = { module = "com.google.truth:truth", version.ref = "test-truth" } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4e1474ee..1a465415 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue Jan 24 12:52:07 CET 2023 +#Tue Mar 12 23:29:23 CET 2024 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/sample/build.gradle b/sample/build.gradle index 35880e30..3beb74ba 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -1,7 +1,7 @@ plugins { - id 'com.android.application' - id 'org.jetbrains.kotlin.android' - id 'androidx.navigation.safeargs' + alias(libs.plugins.android.application) + alias(libs.plugins.kotlin.android) + alias(libs.plugins.androidx.navigation.safeargs) } android { @@ -41,7 +41,7 @@ android { } composeOptions { - kotlinCompilerExtensionVersion = "$composeVersions.compiler" + kotlinCompilerExtensionVersion = libs.versions.androidx.compose.compiler.get() } } @@ -49,24 +49,25 @@ android { dependencies { implementation project (":dpadrecyclerview") implementation project (":dpadrecyclerview-compose") - implementation "androidx.appcompat:appcompat:$versions.appcompat" - implementation "androidx.leanback:leanback-grid:1.0.0-alpha01" - implementation "androidx.constraintlayout:constraintlayout:$versions.constraintLayout" - implementation "androidx.lifecycle:lifecycle-livedata-ktx:$versions.lifecycle" - implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$versions.lifecycle" - implementation "androidx.navigation:navigation-fragment-ktx:$versions.navigation" - implementation "androidx.navigation:navigation-ui-ktx:$versions.navigation" - implementation "androidx.compose.material3:material3:$composeVersions.material3" - implementation "androidx.compose.ui:ui-tooling-preview:$composeVersions.ui" - implementation "androidx.customview:customview-poolingcontainer:$versions.poolingContainer" - implementation "androidx.paging:paging-runtime-ktx:$versions.paging" - debugImplementation "androidx.compose.ui:ui-tooling:$composeVersions.ui" - implementation "androidx.interpolator:interpolator:1.0.0" - implementation 'com.rubensousa:decorator:2.1.0' - implementation 'com.jakewharton.timber:timber:5.0.1' + implementation libs.androidx.appcompat + implementation libs.androidx.leanback.grid + implementation libs.androidx.constraintlayout + implementation libs.androidx.lifecycle.livedata + implementation libs.androidx.lifecycle.viewmodel + implementation libs.androidx.customview.poolingcontainer + implementation libs.androidx.paging.runtime + implementation libs.androidx.interpolator + implementation libs.decorator + implementation libs.timber + implementation libs.androidx.navigation.fragment + implementation libs.androidx.navigation.ui + implementation libs.androidx.compose.material3 + implementation libs.androidx.compose.ui.tooling.preview + debugImplementation libs.androidx.compose.ui.tooling - androidTestImplementation "androidx.fragment:fragment-testing:$versions.fragment" + + androidTestImplementation libs.androidx.fragment.testing androidTestImplementation project (':dpadrecyclerview-testing') - androidTestImplementation("androidx.compose.ui:ui-test-junit4:$composeVersions.ui") - androidTestUtil "androidx.test.services:test-services:$testVersions.services" + androidTestImplementation libs.androidx.test.compose.ui.junit4 + androidTestUtil libs.androidx.test.services } diff --git a/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/screen/main/MainViewModel.kt b/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/screen/main/MainViewModel.kt index 15516f98..9519d3a6 100644 --- a/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/screen/main/MainViewModel.kt +++ b/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/screen/main/MainViewModel.kt @@ -58,9 +58,7 @@ class MainViewModel : ViewModel() { title = "Short list" ), ScreenDestination( - direction = MainFragmentDirections.openList().apply { - enableLooping = true - }, + direction = MainFragmentDirections.openList(enableLooping = true), title = "Infinite lists" ), ScreenDestination( @@ -68,18 +66,18 @@ class MainViewModel : ViewModel() { title = "Fading Edges" ), ScreenDestination( - direction = MainFragmentDirections.openList().apply { - showOverlay = true + direction = MainFragmentDirections.openList( + showOverlay = true, slowScroll = true - }, + ), title = "Nested with Focus Overlay" ), ScreenDestination( - direction = MainFragmentDirections.openList().apply { showHeader = true }, + direction = MainFragmentDirections.openList(showHeader = true), title = "Nested with Header" ), ScreenDestination( - direction = MainFragmentDirections.openList().apply { reverseLayout = true }, + direction = MainFragmentDirections.openList(reverseLayout = true), title = "Reversed" ), ), @@ -95,11 +93,11 @@ class MainViewModel : ViewModel() { title = "Default" ), ScreenDestination( - direction = MainFragmentDirections.openGrid().apply { evenSpans = false }, + direction = MainFragmentDirections.openGrid(evenSpans = false), title = "Different span sizes" ), ScreenDestination( - direction = MainFragmentDirections.openGrid().apply { reverseLayout = true }, + direction = MainFragmentDirections.openGrid(reverseLayout = true), title = "Reversed" ), ScreenDestination( diff --git a/versions.gradle b/versions.gradle index d9581297..13735bff 100644 --- a/versions.gradle +++ b/versions.gradle @@ -2,37 +2,5 @@ def versions = [:] versions.minSdkVersion = 21 versions.targetSdkVersion = 34 versions.compileSdkVersion = 34 -versions.recyclerview = '1.3.2' -versions.collection = '1.3.0' -versions.constraintLayout = '2.1.4' -versions.lifecycle = '2.5.1' -versions.navigation = '2.5.3' -versions.fragment = '1.6.0-beta01' -versions.appcompat = '1.6.1' -versions.poolingContainer = '1.0.0' -versions.paging = '3.1.1' -def composeVersions = [:] -composeVersions.runtime = '1.6.0' -composeVersions.ui = '1.6.0' -composeVersions.material3 = '1.2.0-rc01' -composeVersions.compiler = '1.5.8' - -def testVersions = [:] -testVersions.junit = '4.13.2' -testVersions.espressoJunit = '1.1.5' -testVersions.truth = '1.1.3' -testVersions.jacoco = '0.8.8' -testVersions.core = '1.5.0' -testVersions.rules = '1.5.0' -testVersions.espressoTruth = '1.5.0' -testVersions.runner = '1.5.2' -testVersions.orchestrator = '1.4.2' -testVersions.services = '1.4.2' -testVersions.uiautomator = '2.2.0' -testVersions.espresso = '3.5.1' -testVersions.mockk = '1.13.2' - -ext.composeVersions = composeVersions -ext.testVersions = testVersions ext.versions = versions \ No newline at end of file