diff --git a/app/build.gradle b/app/build.gradle index c268189..6a8e01a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,14 +3,15 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { - compileSdkVersion 27 + compileSdkVersion 33 + buildToolsVersion "33.0.1" defaultConfig { applicationId "com.pawegio.androidprofilersamples" minSdkVersion 21 - targetSdkVersion 27 + targetSdkVersion 33 versionCode 1 versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' } buildTypes { release { @@ -21,14 +22,15 @@ android { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" - implementation 'com.android.support:appcompat-v7:27.0.2' - implementation 'com.android.support:recyclerview-v7:27.0.2' + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20" + implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'androidx.recyclerview:recyclerview:1.2.1' implementation 'com.elpassion.android.commons:recycler:0.0.21' implementation 'com.jakewharton.threetenabp:threetenabp:1.0.5' + implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' - testImplementation 'junit:junit:4.12' + testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'com.android.support.test:runner:1.0.1' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e398eeb..264cbf8 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -11,7 +11,8 @@ android:theme="@style/AppTheme"> + android:label="@string/sample_1" + android:exported="true"> diff --git a/app/src/main/java/com/pawegio/androidprofilersamples/Sample1Activity.kt b/app/src/main/java/com/pawegio/androidprofilersamples/Sample1Activity.kt index c255861..e1b4782 100644 --- a/app/src/main/java/com/pawegio/androidprofilersamples/Sample1Activity.kt +++ b/app/src/main/java/com/pawegio/androidprofilersamples/Sample1Activity.kt @@ -1,7 +1,7 @@ package com.pawegio.androidprofilersamples import android.os.Bundle -import android.support.v7.app.AppCompatActivity +import androidx.appcompat.app.AppCompatActivity import com.elpassion.android.commons.recycler.adapters.basicAdapterWithLayoutAndBinder import com.elpassion.android.commons.recycler.basic.ViewHolderBinder import kotlinx.android.synthetic.main.sample_1_activity.* @@ -27,14 +27,14 @@ class Sample1Activity : AppCompatActivity() { private fun refreshData() { items.run { clear(); addAll(generateItems()) } - recyclerView.adapter.notifyDataSetChanged() + recyclerView.adapter?.notifyDataSetChanged() swipeRefreshLayout.isRefreshing = false } } private fun generateItems(): List { val now = LocalDateTime.now() - return List(1_000) { createItem(now, it + 1) } + return List(100_000) { createItem(now, it + 1) } } private fun createItem(now: LocalDateTime, offset: Int): Item { diff --git a/app/src/main/res/layout/sample_1_activity.xml b/app/src/main/res/layout/sample_1_activity.xml index 08481bf..e6a7025 100644 --- a/app/src/main/res/layout/sample_1_activity.xml +++ b/app/src/main/res/layout/sample_1_activity.xml @@ -1,5 +1,5 @@ - - - + diff --git a/build.gradle b/build.gradle index a149929..94ad123 100644 --- a/build.gradle +++ b/build.gradle @@ -1,19 +1,19 @@ buildscript { - ext.kotlin_version = '1.2.21' + ext.kotlin_version = '1.6.20' repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.0-beta3' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'com.android.tools.build:gradle:7.3.1' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20" } } allprojects { repositories { google() - jcenter() + mavenCentral() } } diff --git a/gradle.properties b/gradle.properties index 743d692..8de5058 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,6 +6,8 @@ # http://www.gradle.org/docs/current/userguide/build_environment.html # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. +android.enableJetifier=true +android.useAndroidX=true org.gradle.jvmargs=-Xmx1536m # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7a3265e..1948b90 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 90639ef..41dfb87 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Fri Feb 23 00:01:15 CET 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip