├── .gitignore ├── .idea ├── caches │ └── build_file_checksums.ser ├── codeStyles │ └── Project.xml ├── gradle.xml ├── misc.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── id │ │ └── arieridwan │ │ └── androidjetpack │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── id │ │ │ └── arieridwan │ │ │ └── androidjetpack │ │ │ ├── ui │ │ │ ├── justtext │ │ │ │ ├── JustTextFragment.kt │ │ │ │ └── JustTextViewModel.kt │ │ │ ├── main │ │ │ │ ├── MainActivity.kt │ │ │ │ ├── MainFragment.kt │ │ │ │ └── MainViewModel.kt │ │ │ └── timer │ │ │ │ ├── TimerFragment.kt │ │ │ │ └── TimerViewModel.kt │ │ │ └── utils │ │ │ └── Constants.kt │ └── res │ │ ├── anim │ │ ├── fade_in.xml │ │ ├── fade_out.xml │ │ ├── slide_in_left.xml │ │ ├── slide_in_right.xml │ │ ├── slide_out_left.xml │ │ └── slide_out_right.xml │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ ├── just_text_activity.xml │ │ ├── just_text_fragment.xml │ │ ├── main_activity.xml │ │ ├── main_fragment.xml │ │ ├── timer_activity.xml │ │ └── timer_fragment.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── navigation │ │ └── main_navigation.xml │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── id │ └── arieridwan │ └── androidjetpack │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/libraries 5 | /.idea/modules.xml 6 | /.idea/workspace.xml 7 | .DS_Store 8 | /build 9 | /captures 10 | .externalNativeBuild 11 | -------------------------------------------------------------------------------- /.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arierie/AndroidJetpack/b3f5e3a7ac64a6d5be6690772b016974c4582f73/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 29 | 30 | 31 | 32 | 33 | 34 | 36 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # About this app 2 | Simple application with Android Jetpack, using Kotlin and include Navigation Architecture Component. 3 | 4 | # Android Jetpack 5 | Android Jetpack is a set of components, tools and guidance that gets its basic DNA from the included Support Library & Architecture Components. You can check [official documentation](https://developer.android.com/jetpack/) for more details. 6 | 7 | # Navigation 8 | The Navigation Architecture Component helps you easily implement common, but complex navigation requirements, while also helping you visualize your app's navigation flow. The library provides a number of benefits, including: 9 | - Handling fragment transactions 10 | - Handling up and back correctly by default 11 | - Provides defaults for animations and transitions 12 | - Deep linking is a first class operation 13 | - Navigation UI patterns like navigation drawers and bottom nav with little additional work 14 | - Type safety when passing information while navigating 15 | - Android Studio offers tooling for visualizing and editing the navigation flow of an app 16 | 17 | You can check [official documentation](https://developer.android.com/topic/libraries/architecture/navigation/) for more details. Or you can try the 18 | [codelabs](https://developer.android.com/topic/libraries/architecture/navigation/). 19 | 20 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'androidx.navigation.safeargs' 4 | apply plugin: 'kotlin-android-extensions' 5 | 6 | android { 7 | compileSdkVersion 27 8 | defaultConfig { 9 | applicationId "id.arieridwan.androidjetpack" 10 | minSdkVersion 15 11 | targetSdkVersion 27 12 | versionCode 1 13 | versionName "1.0" 14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 15 | } 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | } 23 | 24 | dependencies { 25 | implementation fileTree(dir: 'libs', include: ['*.jar']) 26 | implementation 'com.android.support:appcompat-v7:27.1.1' 27 | implementation 'com.android.support:design:27.1.1' 28 | implementation 'com.android.support.constraint:constraint-layout:1.1.0' 29 | // LiveData + ViewModel 30 | implementation 'android.arch.lifecycle:extensions:1.1.1' 31 | // Navigation 32 | implementation 'android.arch.navigation:navigation-fragment:1.0.0-alpha01' 33 | implementation 'android.arch.navigation:navigation-ui:1.0.0-alpha01' 34 | // Testing 35 | testImplementation 'junit:junit:4.12' 36 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 37 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 38 | // Kotlin 39 | implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.41' 40 | } 41 | repositories { 42 | mavenCentral() 43 | } 44 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/androidTest/java/id/arieridwan/androidjetpack/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package id.arieridwan.androidjetpack; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("id.arieridwan.androidjetpack", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/java/id/arieridwan/androidjetpack/ui/justtext/JustTextFragment.kt: -------------------------------------------------------------------------------- 1 | package id.arieridwan.androidjetpack.ui.justtext 2 | 3 | import android.arch.lifecycle.Observer 4 | import android.arch.lifecycle.ViewModelProviders 5 | import android.os.Bundle 6 | import android.support.v4.app.Fragment 7 | import android.util.Log 8 | import android.view.LayoutInflater 9 | import android.view.View 10 | import android.view.ViewGroup 11 | import android.widget.Button 12 | import androidx.navigation.Navigation 13 | import id.arieridwan.androidjetpack.R 14 | import kotlinx.android.synthetic.main.just_text_fragment.* 15 | 16 | class JustTextFragment : Fragment() { 17 | 18 | private val TAG = "JustTextFragment" 19 | private lateinit var mViewModel: JustTextViewModel 20 | 21 | companion object { 22 | fun newInstance() = JustTextFragment() 23 | } 24 | 25 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, 26 | savedInstanceState: Bundle?): View { 27 | return inflater.inflate(R.layout.just_text_fragment, container, false) 28 | } 29 | 30 | override fun onActivityCreated(savedInstanceState: Bundle?) { 31 | super.onActivityCreated(savedInstanceState) 32 | mViewModel = ViewModelProviders.of(this).get(JustTextViewModel::class.java) 33 | mViewModel.justText.observe(this, Observer { text -> text?.let { printJustText(it) } }) 34 | view?.findViewById