diff --git a/README.md b/README.md index 312ae76a6..726de1f45 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,17 @@ Check out the [Additional Resources Wiki page](https://github.com/googlesamples/android-sunflower/wiki/Sunflower-additional-resources) to learn more about Android Sunflower. +Non-Goals +--------- +The focus of this project is on Android Jetpack and the Android framework. +Thus, there are no immediate plans to implement features outside of this scope. + +A note on dependency injection - while many projects (such as +[Plaid](https://github.com/nickbutcher/plaid)) use +[Dagger 2](https://github.com/google/dagger) for DI, there are no plans to +incorporate DI into Sunflower. This allows developers unfamiliar with dependency +injection to better understand Sunflower's code without having to learn DI. + Support ------- diff --git a/app/build.gradle b/app/build.gradle index 2f9f91cb7..1a8483237 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -55,12 +55,12 @@ dependencies { implementation "androidx.appcompat:appcompat:$rootProject.supportLibraryVersion" implementation "androidx.constraintlayout:constraintlayout:$rootProject.constraintLayoutVersion" implementation "androidx.core:core-ktx:$rootProject.ktxVersion" - implementation "androidx.legacy:legacy-support-v4:$rootProject.supportLibraryVersion" + implementation "androidx.legacy:legacy-support-v4:$rootProject.legacySupportVersion" implementation "androidx.lifecycle:lifecycle-extensions:$rootProject.lifecycleVersion" - implementation "androidx.recyclerview:recyclerview:$rootProject.supportLibraryVersion" + implementation "androidx.recyclerview:recyclerview:$rootProject.recyclerViewVersion" implementation "androidx.room:room-runtime:$rootProject.roomVersion" implementation "com.github.bumptech.glide:glide:$rootProject.glideVersion" - implementation "com.google.android.material:material:$rootProject.supportLibraryVersion" + implementation "com.google.android.material:material:$rootProject.materialVersion" implementation "com.google.code.gson:gson:$rootProject.gsonVersion" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$rootProject.kotlinVersion" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$rootProject.coroutinesVersion" diff --git a/app/src/main/java/com/google/samples/apps/sunflower/GardenActivity.kt b/app/src/main/java/com/google/samples/apps/sunflower/GardenActivity.kt index 13fef26b3..0a1bbc37f 100644 --- a/app/src/main/java/com/google/samples/apps/sunflower/GardenActivity.kt +++ b/app/src/main/java/com/google/samples/apps/sunflower/GardenActivity.kt @@ -21,14 +21,19 @@ import androidx.appcompat.app.AppCompatActivity import androidx.core.view.GravityCompat import androidx.databinding.DataBindingUtil import androidx.drawerlayout.widget.DrawerLayout +import androidx.navigation.NavController import androidx.navigation.Navigation -import androidx.navigation.ui.NavigationUI +import androidx.navigation.ui.AppBarConfiguration +import androidx.navigation.ui.navigateUp +import androidx.navigation.ui.setupActionBarWithNavController import androidx.navigation.ui.setupWithNavController import com.google.samples.apps.sunflower.databinding.ActivityGardenBinding class GardenActivity : AppCompatActivity() { private lateinit var drawerLayout: DrawerLayout + private lateinit var appBarConfiguration: AppBarConfiguration + private lateinit var navController: NavController override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -37,19 +42,19 @@ class GardenActivity : AppCompatActivity() { R.layout.activity_garden) drawerLayout = binding.drawerLayout - val navController = Navigation.findNavController(this, R.id.garden_nav_fragment) + navController = Navigation.findNavController(this, R.id.garden_nav_fragment) + appBarConfiguration = AppBarConfiguration(navController.graph, drawerLayout) // Set up ActionBar setSupportActionBar(binding.toolbar) - NavigationUI.setupActionBarWithNavController(this, navController, drawerLayout) + setupActionBarWithNavController(navController, appBarConfiguration) // Set up navigation menu binding.navigationView.setupWithNavController(navController) } override fun onSupportNavigateUp(): Boolean { - return NavigationUI.navigateUp(drawerLayout, - Navigation.findNavController(this, R.id.garden_nav_fragment)) + return navController.navigateUp(appBarConfiguration) || super.onSupportNavigateUp() } override fun onBackPressed() { diff --git a/build.gradle b/build.gradle index e8ee53c4e..904aaec9e 100644 --- a/build.gradle +++ b/build.gradle @@ -31,16 +31,19 @@ buildscript { gradleVersion = '3.2.1' gsonVersion = '2.8.2' junitVersion = '4.12' - kotlinVersion = '1.3.0' + kotlinVersion = '1.3.10' ktlintVersion = '0.29.0' - ktxVersion = '1.0.0' + ktxVersion = '1.0.1' + legacySupportVersion = '1.0.0' lifecycleVersion = '2.0.0' - navigationVersion = '1.0.0-alpha06' - roomVersion = '2.1.0-alpha01' + materialVersion = '1.0.0' + navigationVersion = '1.0.0-alpha07' + recyclerViewVersion = '1.0.0' + roomVersion = '2.1.0-alpha02' runnerVersion = '1.0.1' - supportLibraryVersion = '1.0.0' + supportLibraryVersion = '1.0.2' uiAutomatorVersion = '2.2.0-alpha4' - workVersion = '1.0.0-alpha10' + workVersion = '1.0.0-alpha11' } repositories {