Skip to content
This repository was archived by the owner on Oct 25, 2025. It is now read-only.

Commit 7e2d794

Browse files
committed
Bumps versions for Studio AFox (codelab 3)
1 parent 16c4107 commit 7e2d794

File tree

9 files changed

+41
-48
lines changed

9 files changed

+41
-48
lines changed

app/build.gradle

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,18 @@ android {
3636
exclude 'META-INF/AL2.0'
3737
exclude 'META-INF/LGPL2.1'
3838
}
39-
40-
packagingOptions {
41-
exclude 'META-INF/AL2.0'
42-
exclude 'META-INF/LGPL2.1'
43-
}
4439
}
4540

4641
dependencies {
4742

4843
// App dependencies
4944
implementation "androidx.appcompat:appcompat:$appCompatVersion"
50-
implementation "androidx.cardview:cardview:$cardVersion"
45+
implementation "androidx.swiperefreshlayout:swiperefreshlayout:$swipeRefreshLayoutVersion"
5146
implementation "com.google.android.material:material:$materialVersion"
5247
implementation "androidx.recyclerview:recyclerview:$recyclerViewVersion"
5348
implementation "androidx.annotation:annotation:$androidXAnnotations"
5449
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion"
5550
implementation "com.jakewharton.timber:timber:$timberVersion"
56-
implementation "androidx.legacy:legacy-support-v4:$androidXLegacySupport"
5751
implementation "androidx.test.espresso:espresso-idling-resource:$espressoVersion"
5852
implementation "androidx.room:room-runtime:$roomVersion"
5953
kapt "androidx.room:room-compiler:$roomVersion"
@@ -75,13 +69,19 @@ dependencies {
7569
testImplementation "org.hamcrest:hamcrest-all:$hamcrestVersion"
7670
testImplementation "androidx.arch.core:core-testing:$archTestingVersion"
7771
testImplementation "org.robolectric:robolectric:$robolectricVersion"
78-
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion"
72+
testImplementation ("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion") {
73+
// https://github.com/Kotlin/kotlinx.coroutines/tree/master/kotlinx-coroutines-debug#debug-agent-and-android
74+
exclude group: "org.jetbrains.kotlinx", module: "kotlinx-coroutines-debug"
75+
}
7976

8077
// Dependencies for Android instrumented unit tests
8178
androidTestImplementation "junit:junit:$junitVersion"
8279
androidTestImplementation "org.mockito:mockito-core:$mockitoVersion"
8380
androidTestImplementation "com.linkedin.dexmaker:dexmaker-mockito:$dexMakerVersion"
84-
androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion"
81+
androidTestImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion") {
82+
// https://github.com/Kotlin/kotlinx.coroutines/tree/master/kotlinx-coroutines-debug#debug-agent-and-android
83+
exclude group: "org.jetbrains.kotlinx", module: "kotlinx-coroutines-debug"
84+
}
8585

8686
// Testing code should not be included in the main code.
8787
// Once https://issuetracker.google.com/128612536 is fixed this can be fixed.
@@ -100,5 +100,5 @@ dependencies {
100100

101101
// Kotlin
102102
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
103-
implementation "androidx.fragment:fragment-ktx:$fragmentKtxVersion"
103+
implementation "androidx.fragment:fragment-ktx:$fragmentVersion"
104104
}

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
<activity
2929
android:name="com.example.android.architecture.blueprints.todoapp.tasks.TasksActivity"
3030
android:windowSoftInputMode="adjustResize"
31-
android:theme="@style/AppTheme.OverlapSystemBar">
31+
android:theme="@style/AppTheme.OverlapSystemBar"
32+
android:exported="true">
3233
<intent-filter>
3334
<action android:name="android.intent.action.MAIN" />
3435
<category android:name="android.intent.category.LAUNCHER" />

app/src/main/java/com/example/android/architecture/blueprints/todoapp/addedittask/AddEditTaskFragment.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class AddEditTaskFragment : Fragment() {
4545
override fun onCreateView(
4646
inflater: LayoutInflater, container: ViewGroup?,
4747
savedInstanceState: Bundle?
48-
): View? {
48+
): View {
4949
val root = inflater.inflate(R.layout.addtask_frag, container, false)
5050
viewDataBinding = AddtaskFragBinding.bind(root).apply {
5151
this.viewmodel = viewModel
@@ -55,8 +55,7 @@ class AddEditTaskFragment : Fragment() {
5555
return viewDataBinding.root
5656
}
5757

58-
override fun onActivityCreated(savedInstanceState: Bundle?) {
59-
super.onActivityCreated(savedInstanceState)
58+
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
6059
setupSnackbar()
6160
setupNavigation()
6261
this.setupRefreshLayout(viewDataBinding.refreshLayout)

app/src/main/java/com/example/android/architecture/blueprints/todoapp/statistics/StatisticsFragment.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ class StatisticsFragment : Fragment() {
5050
return viewDataBinding.root
5151
}
5252

53-
override fun onActivityCreated(savedInstanceState: Bundle?) {
54-
super.onActivityCreated(savedInstanceState)
53+
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
5554
viewDataBinding.viewmodel = viewModel
5655
viewDataBinding.lifecycleOwner = this.viewLifecycleOwner
5756
this.setupRefreshLayout(viewDataBinding.refreshLayout)

app/src/main/java/com/example/android/architecture/blueprints/todoapp/taskdetail/TaskDetailFragment.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ class TaskDetailFragment : Fragment() {
4747
TaskDetailViewModelFactory((requireContext().applicationContext as TodoApplication).taskRepository)
4848
}
4949

50-
override fun onActivityCreated(savedInstanceState: Bundle?) {
51-
super.onActivityCreated(savedInstanceState)
50+
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
5251
setupFab()
53-
view?.setupSnackbar(this, viewModel.snackbarText, Snackbar.LENGTH_SHORT)
52+
view.setupSnackbar(this, viewModel.snackbarText, Snackbar.LENGTH_SHORT)
5453
setupNavigation()
5554
this.setupRefreshLayout(viewDataBinding.refreshLayout)
5655
}

app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class TasksActivity : AppCompatActivity() {
4545
val navController: NavController = findNavController(R.id.nav_host_fragment)
4646
appBarConfiguration =
4747
AppBarConfiguration.Builder(R.id.tasks_fragment_dest, R.id.statistics_fragment_dest)
48-
.setDrawerLayout(drawerLayout)
48+
.setOpenableLayout(drawerLayout)
4949
.build()
5050
setupActionBarWithNavController(navController, appBarConfiguration)
5151
findViewById<NavigationView>(R.id.nav_view)

app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksFragment.kt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class TasksFragment : Fragment() {
5757
override fun onCreateView(
5858
inflater: LayoutInflater, container: ViewGroup?,
5959
savedInstanceState: Bundle?
60-
): View? {
60+
): View {
6161
viewDataBinding = TasksFragBinding.inflate(inflater, container, false).apply {
6262
viewmodel = viewModel
6363
}
@@ -86,9 +86,7 @@ class TasksFragment : Fragment() {
8686
inflater.inflate(R.menu.tasks_fragment_menu, menu)
8787
}
8888

89-
override fun onActivityCreated(savedInstanceState: Bundle?) {
90-
super.onActivityCreated(savedInstanceState)
91-
89+
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
9290
// Set the lifecycle owner to the lifecycle of the view
9391
viewDataBinding.lifecycleOwner = this.viewLifecycleOwner
9492
setupSnackbar()
@@ -134,10 +132,8 @@ class TasksFragment : Fragment() {
134132
}
135133

136134
private fun setupFab() {
137-
activity?.findViewById<FloatingActionButton>(R.id.add_task_fab)?.let {
138-
it.setOnClickListener {
139-
navigateToAddNewTask()
140-
}
135+
viewDataBinding.addTaskFab.setOnClickListener {
136+
navigateToAddNewTask()
141137
}
142138
}
143139

build.gradle

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
buildscript {
2-
ext.kotlinVersion = '1.5.10'
2+
ext.kotlinVersion = '1.5.31'
33
ext.navigationVersion = '2.3.5'
44
repositories {
55
google()
66
mavenCentral()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:4.2.1'
9+
classpath 'com.android.tools.build:gradle:7.0.3'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
1111
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigationVersion"
1212

@@ -18,7 +18,6 @@ buildscript {
1818
allprojects {
1919
repositories {
2020
google()
21-
jcenter()
2221
mavenCentral()
2322
}
2423
}
@@ -27,34 +26,34 @@ allprojects {
2726
ext {
2827
// Sdk and tools
2928
minSdkVersion = 21
30-
targetSdkVersion = 30
31-
compileSdkVersion = 30
29+
targetSdkVersion = 31
30+
compileSdkVersion = 31
3231

3332
// App dependencies
3433
androidXVersion = '1.0.0'
35-
androidXTestCoreVersion = '1.3.0'
36-
androidXTestExtKotlinRunnerVersion = '1.1.2'
34+
androidXTestCoreVersion = '1.4.0'
35+
androidXTestExtKotlinRunnerVersion = '1.1.3'
3736
androidXTestRulesVersion = '1.2.0'
38-
androidXAnnotations = '1.2.0'
39-
androidXLegacySupport = '1.0.0'
40-
appCompatVersion = '1.3.0'
41-
archLifecycleVersion = '2.3.1'
37+
androidXAnnotations = '1.3.0'
38+
appCompatVersion = '1.4.0'
39+
archLifecycleVersion = '2.4.0'
4240
archTestingVersion = '2.1.0'
41+
coroutinesVersion = '1.5.2'
4342
cardVersion = '1.0.0'
4443
coroutinesVersion = '1.5.0'
45-
dexMakerVersion = '2.12.1'
46-
espressoVersion = '3.3.0'
47-
fragmentVersion = '1.3.4'
48-
fragmentKtxVersion = '1.3.4'
44+
dexMakerVersion = '2.28.1'
45+
espressoVersion = '3.4.0'
46+
fragmentVersion = '1.4.0'
4947
hamcrestVersion = '1.3'
50-
junitVersion = '4.13.1'
51-
materialVersion = '1.3.0'
52-
mockitoVersion = '2.8.9'
48+
junitVersion = '4.13.2'
49+
materialVersion = '1.4.0'
50+
mockitoVersion = '3.4.6'
5351
multiDexVersion = '2.0.1'
54-
recyclerViewVersion = '1.2.0'
52+
recyclerViewVersion = '1.2.1'
5553
robolectricVersion = '4.5.1'
5654
roomVersion = '2.3.0'
5755
rulesVersion = '1.0.1'
56+
swipeRefreshLayoutVersion = '1.1.0'
5857
timberVersion = '4.7.1'
5958
truthVersion = '1.1.2'
6059
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Mon Jun 14 12:47:31 UTC 2021
22
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)