├── .github └── workflows │ └── manual.yml ├── CODEOWNERS ├── README.md └── starter ├── .gitignore ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── udacity │ │ └── shoestore │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── udacity │ │ │ └── shoestore │ │ │ ├── MainActivity.kt │ │ │ └── models │ │ │ └── Shoe.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ ├── ic_add.xml │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ └── activity_main.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 │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── udacity │ └── shoestore │ └── ExampleUnitTest.kt ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.github/workflows/manual.yml: -------------------------------------------------------------------------------- 1 | # Workflow to ensure whenever a Github PR is submitted, 2 | # a JIRA ticket gets created automatically. 3 | name: Manual Workflow 4 | 5 | # Controls when the action will run. 6 | on: 7 | # Triggers the workflow on pull request events but only for the master branch 8 | pull_request_target: 9 | types: [opened, reopened] 10 | 11 | # Allows you to run this workflow manually from the Actions tab 12 | workflow_dispatch: 13 | 14 | jobs: 15 | test-transition-issue: 16 | name: Convert Github Issue to Jira Issue 17 | runs-on: ubuntu-latest 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@master 21 | 22 | - name: Login 23 | uses: atlassian/gajira-login@master 24 | env: 25 | JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} 26 | JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} 27 | JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} 28 | 29 | - name: Create NEW JIRA ticket 30 | id: create 31 | uses: atlassian/gajira-create@master 32 | with: 33 | project: CONUPDATE 34 | issuetype: Task 35 | summary: | 36 | Github PR [Assign the ND component] | Repo: ${{ github.repository }} | PR# ${{github.event.number}} 37 | description: | 38 | Repo link: https://github.com/${{ github.repository }} 39 | PR no. ${{ github.event.pull_request.number }} 40 | PR title: ${{ github.event.pull_request.title }} 41 | PR description: ${{ github.event.pull_request.description }} 42 | In addition, please resolve other issues, if any. 43 | fields: '{"components": [{"name":"nd940 - Android Kotlin ND"}], "customfield_16449":"https://classroom.udacity.com/", "customfield_16450":"Resolve the PR", "labels": ["github"], "priority":{"id": "4"}}' 44 | 45 | - name: Log created issue 46 | run: echo "Issue ${{ steps.create.outputs.issue }} was created" 47 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @udacity/active-public-content -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # README Template 2 | 3 | Below is a template provided for use when building your README file for students. 4 | 5 | # Project Title 6 | 7 | Project description goes here. 8 | 9 | ## Getting Started 10 | 11 | Instructions for how to get a copy of the project running on your local machine. 12 | 13 | ### Dependencies 14 | 15 | ``` 16 | Examples here 17 | ``` 18 | 19 | ### Installation 20 | 21 | Step by step explanation of how to get a dev environment running. 22 | 23 | List out the steps 24 | 25 | ``` 26 | Give an example here 27 | ``` 28 | 29 | ## Testing 30 | 31 | Explain the steps needed to run any automated tests 32 | 33 | ### Break Down Tests 34 | 35 | Explain what each test does and why 36 | 37 | ``` 38 | Examples here 39 | ``` 40 | ## Project Instructions 41 | 42 | This section should contain all the student deliverables for this project. 43 | 44 | ## Built With 45 | 46 | * [Item1](www.item1.com) - Description of item 47 | * [Item2](www.item2.com) - Description of item 48 | * [Item3](www.item3.com) - Description of item 49 | 50 | Include all items used to build project. 51 | 52 | ## License 53 | -------------------------------------------------------------------------------- /starter/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | -------------------------------------------------------------------------------- /starter/README.md: -------------------------------------------------------------------------------- 1 | # The Shoe Store 2 | 3 | This project will consist of five screens. You don't have to create a shoe store, you can use any other item as long as you create the following screens. You will be creating: 4 | 5 | 1. Login screen: Email and password fields and labels plus create and login buttons 6 | 2. Welcome onboarding screen 7 | 3. Instructions onboarding screen 8 | 4. Shoe Listing screen 9 | 5. Shoe Detail screen for adding a new shoe 10 | 11 | ## Getting Started 12 | 13 | Open the starter project in the latest stable version of Android Studio. 14 | 15 | Open the starter project in Android Studio 16 | 17 | ##Steps 18 | 19 | 1. Open the starter project in Android Studio 20 | 21 | 2. Add the navigation libraries to the app build.gradle file 22 | 23 | 3. Add the safe-arg plugin to the main and app build.gradle file 24 | 25 | 4. Create a new navigation xml file 26 | 27 | 5. Create a new Login destination. 28 | 29 | * Include email and password labels 30 | 31 | - Include email and password fields 32 | - Create buttons for creating a new login and logging in with an existing account 33 | - Clicking either button should navigate to the Welcome Screen. 34 | 35 | 6. Create a new Welcome screen destination that includes: 36 | 37 | * A new layout 38 | * At least 2 textviews 39 | * A navigation button with actions to navigate to the instructions screen 40 | 41 | 7. Create a new Instruction destination that includes: 42 | 43 | * A new layout 44 | * At least 2 textviews 45 | * A navigation button with actions to navigate to the shoe list screen 46 | 47 | 8. Create a class that extends ViewModel 48 | 49 | * Use a LiveData field that returns the list of shoes 50 | 51 | 9. Create a new Shoe List destination that includes: 52 | 53 | * A new layout 54 | * A ScrollView 55 | * A LinearLayout for Shoe Items 56 | * A FloatingActionButton with an action to navigate to the shoe detail screen 57 | 58 | 10. In MainActivity, setup the nav controller with the toolbar and an AppBarConfiguration. 59 | 60 | 11. Create a new Shoe Detail destination that includes: 61 | 62 | * A new layout 63 | * A TextView label and EditView for the 64 | * Shoe Name 65 | * Company 66 | * Shoe Size 67 | * Description 68 | * A Cancel button with an action to navigate back to the shoe list screen 69 | * A Save button with an action to navigate back to the shoe list screen and add a new Shoe to the Shoe View Model 70 | 71 | 12. Make sure you can’t go back to onboarding screens 72 | 73 | 13. In the Shoe List screen: 74 | 75 | * Use an Activity level ViewModel to hold a list of Shoes (use by activityViewModels) 76 | * Observe the shoes variable from the ViewModel 77 | * Use DataBindingUtil to inflate the shoe_list layout 78 | * Add a new layout item into the scrollview for each shoe. -------------------------------------------------------------------------------- /starter/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /starter/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | id 'org.jetbrains.kotlin.android' 4 | id 'kotlin-android' 5 | id 'kotlin-kapt' 6 | id "androidx.navigation.safeargs" 7 | id 'kotlin-parcelize' 8 | } 9 | 10 | android { 11 | namespace 'com.udacity.shoestore' 12 | compileSdk 33 13 | 14 | defaultConfig { 15 | applicationId "com.udacity.shoestore" 16 | minSdk 21 17 | targetSdk 33 18 | versionCode 1 19 | versionName "1.0" 20 | 21 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 22 | } 23 | 24 | buildTypes { 25 | release { 26 | minifyEnabled false 27 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 28 | } 29 | } 30 | buildFeatures { 31 | dataBinding true 32 | } 33 | compileOptions { 34 | sourceCompatibility JavaVersion.VERSION_1_8 35 | targetCompatibility JavaVersion.VERSION_1_8 36 | } 37 | kotlinOptions { 38 | jvmTarget = JavaVersion.VERSION_1_8.toString() 39 | } 40 | } 41 | 42 | dependencies { 43 | 44 | implementation 'androidx.core:core-ktx:1.10.1' 45 | implementation 'androidx.appcompat:appcompat:1.6.1' 46 | implementation 'com.google.android.material:material:1.9.0' 47 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4' 48 | implementation "com.jakewharton.timber:timber:5.0.1" 49 | 50 | // Navigation 51 | implementation "androidx.navigation:navigation-fragment-ktx:2.5.3" 52 | implementation "androidx.navigation:navigation-ui-ktx:2.5.3" 53 | 54 | testImplementation 'junit:junit:4.13.2' 55 | androidTestImplementation 'androidx.test.ext:junit:1.1.5' 56 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' 57 | } 58 | -------------------------------------------------------------------------------- /starter/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 | -------------------------------------------------------------------------------- /starter/app/src/androidTest/java/com/udacity/shoestore/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.udacity.shoestore 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.udacity.shoestore", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /starter/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /starter/app/src/main/java/com/udacity/shoestore/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.udacity.shoestore 2 | 3 | import androidx.appcompat.app.AppCompatActivity 4 | import android.os.Bundle 5 | import timber.log.Timber 6 | 7 | class MainActivity : AppCompatActivity() { 8 | 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | setContentView(R.layout.activity_main) 12 | Timber.plant(Timber.DebugTree()) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /starter/app/src/main/java/com/udacity/shoestore/models/Shoe.kt: -------------------------------------------------------------------------------- 1 | package com.udacity.shoestore.models 2 | 3 | import android.os.Parcelable 4 | import kotlinx.android.parcel.Parcelize 5 | 6 | @Parcelize 7 | data class Shoe(var name: String, var size: Double, var company: String, var description: String, 8 | val images: List = mutableListOf()) : Parcelable -------------------------------------------------------------------------------- /starter/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /starter/app/src/main/res/drawable/ic_add.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /starter/app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /starter/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /starter/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /starter/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /starter/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/udacity/nd940-android-kotlin-course1-starter/1af3aeb59978b5e3e0d3bd6f68c9ea84d170c27b/starter/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /starter/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/udacity/nd940-android-kotlin-course1-starter/1af3aeb59978b5e3e0d3bd6f68c9ea84d170c27b/starter/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /starter/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/udacity/nd940-android-kotlin-course1-starter/1af3aeb59978b5e3e0d3bd6f68c9ea84d170c27b/starter/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /starter/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/udacity/nd940-android-kotlin-course1-starter/1af3aeb59978b5e3e0d3bd6f68c9ea84d170c27b/starter/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /starter/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/udacity/nd940-android-kotlin-course1-starter/1af3aeb59978b5e3e0d3bd6f68c9ea84d170c27b/starter/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /starter/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/udacity/nd940-android-kotlin-course1-starter/1af3aeb59978b5e3e0d3bd6f68c9ea84d170c27b/starter/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /starter/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/udacity/nd940-android-kotlin-course1-starter/1af3aeb59978b5e3e0d3bd6f68c9ea84d170c27b/starter/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /starter/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/udacity/nd940-android-kotlin-course1-starter/1af3aeb59978b5e3e0d3bd6f68c9ea84d170c27b/starter/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /starter/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/udacity/nd940-android-kotlin-course1-starter/1af3aeb59978b5e3e0d3bd6f68c9ea84d170c27b/starter/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /starter/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/udacity/nd940-android-kotlin-course1-starter/1af3aeb59978b5e3e0d3bd6f68c9ea84d170c27b/starter/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /starter/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /starter/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ShoeStore 3 | 4 | -------------------------------------------------------------------------------- /starter/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 14 | 15 |