diff --git a/app/build.gradle b/app/build.gradle index 580c494a6..eb18ed46d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,6 +12,7 @@ android { targetSdkVersion rootProject.targetSdkVersion versionCode 1 versionName "1.0" + multiDexEnabled true testInstrumentationRunner 'com.example.android.architecture.blueprints.todoapp.CustomTestRunner' } @@ -32,14 +33,12 @@ android { debug { minifyEnabled false testCoverageEnabled true - useProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' testProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguardTest-rules.pro' } release { minifyEnabled true - useProguard true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' testProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguardTest-rules.pro' } @@ -85,8 +84,7 @@ dependencies { implementation "androidx.room:room-runtime:$roomVersion" kapt "androidx.room:room-compiler:$roomVersion" implementation "androidx.room:room-ktx:$roomVersion" - implementation "androidx.lifecycle:lifecycle-extensions:$archLifecycleVersion" - kapt "androidx.lifecycle:lifecycle-compiler:$archLifecycleVersion" + implementation "androidx.lifecycle:lifecycle-common-java8:$archLifecycleVersion" implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$archLifecycleVersion" implementation "androidx.navigation:navigation-fragment-ktx:$navigationVersion" implementation "androidx.navigation:navigation-ui-ktx:$navigationVersion" @@ -114,10 +112,12 @@ dependencies { testImplementation "androidx.test:core-ktx:$androidXTestCoreVersion" testImplementation "androidx.test.ext:junit-ktx:$androidXTestExtKotlinRunnerVersion" testImplementation "androidx.test:rules:$androidXTestRulesVersion" - // Once https://issuetracker.google.com/127986458 is fixed this can be testImplementation - implementation "androidx.fragment:fragment-testing:$fragmentVersion" - implementation "androidx.test:core:$androidXTestCoreVersion" + testImplementation "androidx.test:core:$androidXTestCoreVersion" + debugImplementation "androidx.fragment:fragment-testing:$fragmentVersion" + + // AndroidX Fragments implementation "androidx.fragment:fragment:$fragmentVersion" + implementation "androidx.fragment:fragment-ktx:$fragmentVersion" // AndroidX Test - Instrumented testing androidTestImplementation "androidx.test:core-ktx:$androidXTestCoreVersion" @@ -140,7 +140,7 @@ dependencies { androidTestImplementation "com.google.android.material:material:$materialVersion" // Kotlin - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion" implementation "androidx.fragment:fragment-ktx:$fragmentKtxVersion" // Dagger diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e85b438cf..9bf45f3dd 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -28,6 +28,7 @@ diff --git a/app/src/main/java/com/example/android/architecture/blueprints/todoapp/addedittask/AddEditTaskFragment.kt b/app/src/main/java/com/example/android/architecture/blueprints/todoapp/addedittask/AddEditTaskFragment.kt index 4435ec130..0992c99c6 100644 --- a/app/src/main/java/com/example/android/architecture/blueprints/todoapp/addedittask/AddEditTaskFragment.kt +++ b/app/src/main/java/com/example/android/architecture/blueprints/todoapp/addedittask/AddEditTaskFragment.kt @@ -50,7 +50,7 @@ class AddEditTaskFragment : DaggerFragment() { override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? - ): View? { + ): View { val root = inflater.inflate(R.layout.addtask_frag, container, false) viewDataBinding = AddtaskFragBinding.bind(root).apply { this.viewmodel = viewModel @@ -60,8 +60,8 @@ class AddEditTaskFragment : DaggerFragment() { return viewDataBinding.root } - override fun onActivityCreated(savedInstanceState: Bundle?) { - super.onActivityCreated(savedInstanceState) + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) setupSnackbar() setupNavigation() this.setupRefreshLayout(viewDataBinding.refreshLayout) @@ -73,7 +73,7 @@ class AddEditTaskFragment : DaggerFragment() { } private fun setupNavigation() { - viewModel.taskUpdatedEvent.observe(this, EventObserver { + viewModel.taskUpdatedEvent.observe(viewLifecycleOwner, EventObserver { val action = AddEditTaskFragmentDirections .actionAddEditTaskFragmentToTasksFragment(ADD_EDIT_RESULT_OK) findNavController().navigate(action) diff --git a/build.gradle b/build.gradle index e6dd3d1be..b007deacb 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlinVersion = '1.3.31' - ext.navigationVersion = "2.1.0-alpha06" + ext.kotlinVersion = '1.6.10' + ext.navigationVersion = "2.5.0" repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:3.4.1' + classpath 'com.android.tools.build:gradle:7.2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigationVersion" @@ -18,7 +18,7 @@ buildscript { allprojects { repositories { google() - jcenter() + mavenCentral() } } @@ -31,34 +31,34 @@ ext { // Sdk and tools // Support library and architecture components support minSdk 14 and above. minSdkVersion = 14 - targetSdkVersion = 28 - compileSdkVersion = 28 + targetSdkVersion = 31 + compileSdkVersion = 31 // App dependencies androidXVersion = '1.0.0' - androidXTestCoreVersion = '1.2.0' - androidXTestExtKotlinRunnerVersion = '1.1.1' + androidXTestCoreVersion = '1.4.0' + androidXTestExtKotlinRunnerVersion = '1.1.3' androidXTestRulesVersion = '1.2.0-beta01' - androidXAnnotations = '1.0.1' + androidXAnnotations = '1.4.0' androidXLegacySupport = '1.0.0' - appCompatVersion = '1.0.2' - archLifecycleVersion = '2.1.0-rc01' - archTestingVersion = '2.0.0' + appCompatVersion = '1.4.2' + archLifecycleVersion = '2.5.0' + archTestingVersion = '2.1.0' cardVersion = '1.0.0' - coroutinesVersion = '1.2.1' - dexMakerVersion = '2.12.1' - daggerVersion = '2.23.2' - espressoVersion = '3.2.0-beta01' - fragmentVersion = '1.1.0-alpha07' + coroutinesVersion = '1.6.1' + dexMakerVersion = '2.28.1' + daggerVersion = '2.42' + espressoVersion = '3.5.0-alpha07' + fragmentVersion = '1.5.0' fragmentKtxVersion = '1.1.0-rc01' hamcrestVersion = '1.3' junitVersion = '4.12' - materialVersion = '1.0.0' - mockitoVersion = '2.8.9' - recyclerViewVersion = '1.0.0' - robolectricVersion = '4.3-beta-1' - roomVersion = '2.1.0' + materialVersion = '1.6.1' + mockitoVersion = '2.28.2' + recyclerViewVersion = '1.2.1' + robolectricVersion = '4.8.1' + roomVersion = '2.4.2' rulesVersion = '1.0.1' timberVersion = '4.7.1' - truthVersion = '0.44' + truthVersion = '1.1.2' } diff --git a/gradle.properties b/gradle.properties index 94c4d55e0..915f0e66f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,5 +17,4 @@ # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true android.enableJetifier=true -android.useAndroidX=true -android.enableUnitTestBinaryResources=true \ No newline at end of file +android.useAndroidX=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 464ed4166..5b8cf877c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Apr 04 11:20:54 PDT 2019 +#Fri Jul 08 11:17:21 IST 2022 distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip +zipStoreBase=GRADLE_USER_HOME