Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
…flower into feature/coroutines-app-executors
  • Loading branch information
XinyueZ committed Nov 27, 2018
2 parents 9b5309d + 9d68548 commit d76e7bd
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 14 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------

Expand Down
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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() {
Expand Down
15 changes: 9 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d76e7bd

Please sign in to comment.