diff --git a/AndroidTrivia/README.md b/AndroidTrivia/README.md
new file mode 100644
index 0000000..60c9087
--- /dev/null
+++ b/AndroidTrivia/README.md
@@ -0,0 +1,50 @@
+AndroidTrivia - final solution code
+===================================
+
+This app is the solution code for Android Kotlin Fundamentals codelab 3.3:
+Invoke an external activity.
+
+Introduction
+------------
+
+The AndroidTrivia app asks the user trivia questions about Android development.
+It makes use of the navigation component within Jetpack to move the user between
+screens. Each screen is implemented as a fragment.
+
+The app navigates using buttons, the app bar, and a navigation drawer. Because
+students haven't yet learned about saving data or the Android lifecycle, the app
+tries to eliminate bugs caused by configuration changes.
+
+Prerequisites
+-------------
+
+You need to know:
+- The fundamentals of Kotlin.
+- How to create basic Android apps in Kotlin.
+- How to open, build, and run apps with Android Studio.
+- How to work with layouts.
+
+Getting started
+---------------
+
+1. Download and run the app.
+
+License
+-------
+
+Copyright 2019 Google, Inc.
+
+Licensed to the Apache Software Foundation (ASF) under one or more contributor
+license agreements. See the NOTICE file distributed with this work for
+additional information regarding copyright ownership. The ASF licenses this
+file to you under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
\ No newline at end of file
diff --git a/AndroidTrivia/app/.gitignore b/AndroidTrivia/app/.gitignore
new file mode 100755
index 0000000..796b96d
--- /dev/null
+++ b/AndroidTrivia/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/AndroidTrivia/app/build.gradle b/AndroidTrivia/app/build.gradle
new file mode 100755
index 0000000..d150824
--- /dev/null
+++ b/AndroidTrivia/app/build.gradle
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+apply plugin: 'com.android.application'
+
+apply plugin: 'kotlin-android'
+
+apply plugin: 'kotlin-kapt'
+apply plugin: 'kotlin-android-extensions'
+apply plugin: 'androidx.navigation.safeargs'
+
+android {
+ compileSdkVersion 28
+ dataBinding {
+ enabled = true
+ }
+ defaultConfig {
+ applicationId 'com.example.android.navigation'
+ minSdkVersion 19
+ targetSdkVersion 28
+ vectorDrawables.useSupportLibrary = true
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+ productFlavors {
+ }
+}
+
+dependencies {
+ implementation fileTree(include: ['*.jar'], dir: 'libs')
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
+ implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
+ implementation "androidx.appcompat:appcompat:$supportlibVersion"
+ implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha1'
+ implementation 'androidx.legacy:legacy-support-v4:1.0.0-beta01'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
+ implementation "com.google.android.material:material:1.0.0-rc01"
+ implementation"android.arch.navigation:navigation-fragment-ktx:$navigationVersion"
+ implementation "android.arch.navigation:navigation-ui-ktx:$navigationVersion"
+ implementation "com.google.android.material:material:$supportlibVersion"
+}
diff --git a/AndroidTrivia/app/proguard-rules.pro b/AndroidTrivia/app/proguard-rules.pro
new file mode 100755
index 0000000..f1b4245
--- /dev/null
+++ b/AndroidTrivia/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/AndroidTrivia/app/src/main/AndroidManifest.xml b/AndroidTrivia/app/src/main/AndroidManifest.xml
new file mode 100755
index 0000000..eb917a8
--- /dev/null
+++ b/AndroidTrivia/app/src/main/AndroidManifest.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTrivia/app/src/main/java/com/example/android/navigation/AboutFragment.kt b/AndroidTrivia/app/src/main/java/com/example/android/navigation/AboutFragment.kt
new file mode 100755
index 0000000..1d08125
--- /dev/null
+++ b/AndroidTrivia/app/src/main/java/com/example/android/navigation/AboutFragment.kt
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.navigation
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+
+class AboutFragment : Fragment() {
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?): View? {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.fragment_about, container, false)
+ }
+}
diff --git a/AndroidTrivia/app/src/main/java/com/example/android/navigation/GameFragment.kt b/AndroidTrivia/app/src/main/java/com/example/android/navigation/GameFragment.kt
new file mode 100755
index 0000000..b7cd7ca
--- /dev/null
+++ b/AndroidTrivia/app/src/main/java/com/example/android/navigation/GameFragment.kt
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.navigation
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.appcompat.app.AppCompatActivity
+import androidx.databinding.DataBindingUtil
+import androidx.fragment.app.Fragment
+import androidx.navigation.findNavController
+import com.example.android.navigation.databinding.FragmentGameBinding
+
+class GameFragment : Fragment() {
+ data class Question(
+ val text: String,
+ val answers: List)
+
+ // The first answer is the correct one. We randomize the answers before showing the text.
+ // All questions must have four answers. We'd want these to contain references to string
+ // resources so we could internationalize. (Or better yet, don't define the questions in code...)
+ private val questions: MutableList = mutableListOf(
+ Question(text = "What is Android Jetpack?",
+ answers = listOf("All of these", "Tools", "Documentation", "Libraries")),
+ Question(text = "What is the base class for layouts?",
+ answers = listOf("ViewGroup", "ViewSet", "ViewCollection", "ViewRoot")),
+ Question(text = "What layout do you use for complex screens?",
+ answers = listOf("ConstraintLayout", "GridLayout", "LinearLayout", "FrameLayout")),
+ Question(text = "What do you use to push structured data into a layout?",
+ answers = listOf("Data binding", "Data pushing", "Set text", "An OnClick method")),
+ Question(text = "What method do you use to inflate layouts in fragments?",
+ answers = listOf("onCreateView()", "onActivityCreated()", "onCreateLayout()", "onInflateLayout()")),
+ Question(text = "What's the build system for Android?",
+ answers = listOf("Gradle", "Graddle", "Grodle", "Groyle")),
+ Question(text = "Which class do you use to create a vector drawable?",
+ answers = listOf("VectorDrawable", "AndroidVectorDrawable", "DrawableVector", "AndroidVector")),
+ Question(text = "Which one of these is an Android navigation component?",
+ answers = listOf("NavController", "NavCentral", "NavMaster", "NavSwitcher")),
+ Question(text = "Which XML element lets you register an activity with the launcher activity?",
+ answers = listOf("intent-filter", "app-registry", "launcher-registry", "app-launcher")),
+ Question(text = "What do you use to mark a layout for data binding?",
+ answers = listOf("", "", "", ""))
+ )
+
+
+
+ lateinit var currentQuestion: Question
+ lateinit var answers: MutableList
+ private var questionIndex = 0
+ private val numQuestions = Math.min((questions.size + 1) / 2, 3)
+
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?): View? {
+
+ // Inflate the layout for this fragment
+ val binding = DataBindingUtil.inflate(
+ inflater, R.layout.fragment_game, container, false)
+
+ // Shuffles the questions and sets the question index to the first question.
+ randomizeQuestions()
+
+ // Bind this fragment class to the layout
+ binding.game = this
+
+ // Set the onClickListener for the submitButton
+ binding.submitButton.setOnClickListener @Suppress("UNUSED_ANONYMOUS_PARAMETER")
+ { view: View ->
+ val checkedId = binding.questionRadioGroup.checkedRadioButtonId
+ // Do nothing if nothing is checked (id == -1)
+ if (-1 != checkedId) {
+ var answerIndex = 0
+ when (checkedId) {
+ R.id.secondAnswerRadioButton -> answerIndex = 1
+ R.id.thirdAnswerRadioButton -> answerIndex = 2
+ R.id.fourthAnswerRadioButton -> answerIndex = 3
+ }
+ // The first answer in the original question is always the correct one, so if our
+ // answer matches, we have the correct answer.
+ if (answers[answerIndex] == currentQuestion.answers[0]) {
+ questionIndex++
+ // Advance to the next question
+ if (questionIndex < numQuestions) {
+ currentQuestion = questions[questionIndex]
+ setQuestion()
+ binding.invalidateAll()
+ } else {
+ // We've won! Navigate to the gameWonFragment.
+ view.findNavController()
+ .navigate(GameFragmentDirections
+ .actionGameFragmentToGameWonFragment(numQuestions, questionIndex))
+ }
+ } else {
+ // Game over! A wrong answer sends us to the gameOverFragment.
+ view.findNavController()
+ .navigate(GameFragmentDirections.actionGameFragmentToGameOverFragment())
+ }
+ }
+ }
+ return binding.root
+ }
+
+ // randomize the questions and set the first question
+ private fun randomizeQuestions() {
+ questions.shuffle()
+ questionIndex = 0
+ setQuestion()
+ }
+
+ // Sets the question and randomizes the answers. This only changes the data, not the UI.
+ // Calling invalidateAll on the FragmentGameBinding updates the data.
+ private fun setQuestion() {
+ currentQuestion = questions[questionIndex]
+ // randomize the answers into a copy of the array
+ answers = currentQuestion.answers.toMutableList()
+ // and shuffle them
+ answers.shuffle()
+ (activity as AppCompatActivity).supportActionBar?.title = getString(R.string.title_android_trivia_question, questionIndex + 1, numQuestions)
+ }
+}
diff --git a/AndroidTrivia/app/src/main/java/com/example/android/navigation/GameOverFragment.kt b/AndroidTrivia/app/src/main/java/com/example/android/navigation/GameOverFragment.kt
new file mode 100755
index 0000000..4cac930
--- /dev/null
+++ b/AndroidTrivia/app/src/main/java/com/example/android/navigation/GameOverFragment.kt
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.navigation
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.databinding.DataBindingUtil
+import androidx.fragment.app.Fragment
+import androidx.navigation.findNavController
+import com.example.android.navigation.databinding.FragmentGameOverBinding
+
+class GameOverFragment : Fragment() {
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?): View? {
+ // Inflate the layout for this fragment
+ val binding: FragmentGameOverBinding = DataBindingUtil.inflate(
+ inflater, R.layout.fragment_game_over, container, false)
+
+ binding.tryAgainButton.setOnClickListener { view: View ->
+ view.findNavController().navigate(GameOverFragmentDirections.actionGameOverFragmentToGameFragment())
+ }
+ return binding.root
+ }
+}
diff --git a/AndroidTrivia/app/src/main/java/com/example/android/navigation/GameWonFragment.kt b/AndroidTrivia/app/src/main/java/com/example/android/navigation/GameWonFragment.kt
new file mode 100755
index 0000000..c54c7f7
--- /dev/null
+++ b/AndroidTrivia/app/src/main/java/com/example/android/navigation/GameWonFragment.kt
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.navigation
+
+import android.content.Intent
+import android.os.Bundle
+import android.view.*
+import android.widget.Toast
+import androidx.databinding.DataBindingUtil
+import androidx.fragment.app.Fragment
+import androidx.navigation.findNavController
+import com.example.android.navigation.databinding.FragmentGameWonBinding
+
+
+class GameWonFragment : Fragment() {
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?): View? {
+ // Inflate the layout for this fragment
+ val binding: FragmentGameWonBinding = DataBindingUtil.inflate(
+ inflater, R.layout.fragment_game_won, container, false)
+
+ binding.nextMatchButton.setOnClickListener { view: View ->
+ view.findNavController().navigate(GameWonFragmentDirections.actionGameWonFragmentToGameFragment())
+ }
+ val args = GameWonFragmentArgs.fromBundle(arguments!!)
+ Toast.makeText(context, "NumCorrect: ${args.numCorrect}, NumQuestions: ${args.numQuestions}", Toast.LENGTH_LONG).show()
+
+ setHasOptionsMenu(true)
+ return binding.root
+ }
+
+ // Creating our Share Intent
+ private fun getShareIntent() : Intent {
+ val args = GameWonFragmentArgs.fromBundle(arguments!!)
+ val shareIntent = Intent(Intent.ACTION_SEND)
+ shareIntent.setType("text/plain")
+ .putExtra(Intent.EXTRA_TEXT, getString(R.string.share_success_text, args.numCorrect, args.numQuestions))
+ return shareIntent
+ }
+
+ // Starting an Activity with our new Intent
+ private fun shareSuccess() {
+ startActivity(getShareIntent())
+ }
+
+ // Showing the Share Menu Item Dynamically
+ override fun onCreateOptionsMenu(menu: Menu?, inflater: MenuInflater?) {
+ super.onCreateOptionsMenu(menu, inflater)
+ inflater?.inflate(R.menu.winner_menu, menu)
+ // check if the activity resolves
+ if (null == getShareIntent().resolveActivity(activity!!.packageManager)) {
+ // hide the menu item if it doesn't resolve
+ menu?.findItem(R.id.share)?.setVisible(false)
+ }
+ }
+
+ // Sharing from the Menu
+ override fun onOptionsItemSelected(item: MenuItem?): Boolean {
+ when (item!!.itemId) {
+ R.id.share -> shareSuccess()
+ }
+ return super.onOptionsItemSelected(item)
+ }
+}
diff --git a/AndroidTrivia/app/src/main/java/com/example/android/navigation/MainActivity.kt b/AndroidTrivia/app/src/main/java/com/example/android/navigation/MainActivity.kt
new file mode 100755
index 0000000..9df648c
--- /dev/null
+++ b/AndroidTrivia/app/src/main/java/com/example/android/navigation/MainActivity.kt
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.navigation
+
+import android.os.Bundle
+import androidx.appcompat.app.AppCompatActivity
+import androidx.databinding.DataBindingUtil
+import androidx.drawerlayout.widget.DrawerLayout
+import androidx.navigation.findNavController
+import androidx.navigation.ui.NavigationUI
+import com.example.android.navigation.databinding.ActivityMainBinding
+
+class MainActivity : AppCompatActivity() {
+ private lateinit var drawerLayout: DrawerLayout
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ @Suppress("UNUSED_VARIABLE")
+ val binding = DataBindingUtil.setContentView(this, R.layout.activity_main)
+
+ drawerLayout = binding.drawerLayout
+
+ val navController = this.findNavController(R.id.myNavHostFragment)
+
+ NavigationUI.setupActionBarWithNavController(this,navController, drawerLayout)
+
+ NavigationUI.setupWithNavController(binding.navView, navController)
+
+ }
+
+ override fun onSupportNavigateUp(): Boolean {
+ val navController = this.findNavController(R.id.myNavHostFragment)
+ return NavigationUI.navigateUp(navController, drawerLayout)
+ }
+
+}
diff --git a/AndroidTrivia/app/src/main/java/com/example/android/navigation/RulesFragment.kt b/AndroidTrivia/app/src/main/java/com/example/android/navigation/RulesFragment.kt
new file mode 100755
index 0000000..11e0926
--- /dev/null
+++ b/AndroidTrivia/app/src/main/java/com/example/android/navigation/RulesFragment.kt
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.navigation
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+
+class RulesFragment : Fragment() {
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?): View? {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.fragment_rules, container, false)
+ }
+}
diff --git a/AndroidTrivia/app/src/main/java/com/example/android/navigation/TitleFragment.kt b/AndroidTrivia/app/src/main/java/com/example/android/navigation/TitleFragment.kt
new file mode 100644
index 0000000..7b0a62f
--- /dev/null
+++ b/AndroidTrivia/app/src/main/java/com/example/android/navigation/TitleFragment.kt
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ package com.example.android.navigation
+
+
+import android.os.Bundle
+import android.view.*
+import androidx.fragment.app.Fragment
+import androidx.databinding.DataBindingUtil
+import androidx.navigation.findNavController
+import androidx.navigation.ui.NavigationUI
+import com.example.android.navigation.databinding.FragmentTitleBinding
+
+
+// TODO: Rename parameter arguments, choose names that match
+// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
+private const val ARG_PARAM1 = "param1"
+private const val ARG_PARAM2 = "param2"
+
+/**
+ * A simple [Fragment] subclass.
+ *
+ */
+class TitleFragment : Fragment() {
+
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?): View? {
+ val binding = DataBindingUtil.inflate(inflater,
+ R.layout.fragment_title,container,false)
+
+ binding.playButton.setOnClickListener { view : View ->
+ view.findNavController().navigate(TitleFragmentDirections.actionTitleFragmentToGameFragment())
+ }
+ setHasOptionsMenu(true)
+ return binding.root
+ }
+
+
+ override fun onCreateOptionsMenu(menu: Menu?, inflater: MenuInflater?) {
+ super.onCreateOptionsMenu(menu, inflater)
+ inflater?.inflate(R.menu.options_menu,menu)
+ }
+
+ override fun onOptionsItemSelected(item: MenuItem?): Boolean {
+ return NavigationUI.onNavDestinationSelected(item!!,view!!.findNavController())
+ ||super.onOptionsItemSelected(item)
+ }
+
+}
diff --git a/AndroidTrivia/app/src/main/res/anim/fade_out.xml b/AndroidTrivia/app/src/main/res/anim/fade_out.xml
new file mode 100755
index 0000000..b47add9
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/anim/fade_out.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTrivia/app/src/main/res/anim/slide_in_right.xml b/AndroidTrivia/app/src/main/res/anim/slide_in_right.xml
new file mode 100755
index 0000000..48d7c66
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/anim/slide_in_right.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
diff --git a/AndroidTrivia/app/src/main/res/anim/slide_out_left.xml b/AndroidTrivia/app/src/main/res/anim/slide_out_left.xml
new file mode 100755
index 0000000..c7c9c19
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/anim/slide_out_left.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
diff --git a/AndroidTrivia/app/src/main/res/anim/slide_out_right.xml b/AndroidTrivia/app/src/main/res/anim/slide_out_right.xml
new file mode 100755
index 0000000..41cdc83
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/anim/slide_out_right.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTrivia/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/AndroidTrivia/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100755
index 0000000..188a517
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
diff --git a/AndroidTrivia/app/src/main/res/drawable/about_android_trivia.xml b/AndroidTrivia/app/src/main/res/drawable/about_android_trivia.xml
new file mode 100755
index 0000000..9628656
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/drawable/about_android_trivia.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTrivia/app/src/main/res/drawable/android.xml b/AndroidTrivia/app/src/main/res/drawable/android.xml
new file mode 100755
index 0000000..5bfbc23
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/drawable/android.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
diff --git a/AndroidTrivia/app/src/main/res/drawable/android_category_simple.xml b/AndroidTrivia/app/src/main/res/drawable/android_category_simple.xml
new file mode 100755
index 0000000..73d9a0a
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/drawable/android_category_simple.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
diff --git a/AndroidTrivia/app/src/main/res/drawable/android_trivia.xml b/AndroidTrivia/app/src/main/res/drawable/android_trivia.xml
new file mode 100755
index 0000000..5f76212
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/drawable/android_trivia.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTrivia/app/src/main/res/drawable/ic_launcher_background.xml b/AndroidTrivia/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100755
index 0000000..82ef050
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTrivia/app/src/main/res/drawable/nav_header.xml b/AndroidTrivia/app/src/main/res/drawable/nav_header.xml
new file mode 100755
index 0000000..c589432
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/drawable/nav_header.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTrivia/app/src/main/res/drawable/rules.xml b/AndroidTrivia/app/src/main/res/drawable/rules.xml
new file mode 100755
index 0000000..8d35602
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/drawable/rules.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
diff --git a/AndroidTrivia/app/src/main/res/drawable/settings.xml b/AndroidTrivia/app/src/main/res/drawable/settings.xml
new file mode 100755
index 0000000..fbfe778
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/drawable/settings.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
diff --git a/AndroidTrivia/app/src/main/res/drawable/share.xml b/AndroidTrivia/app/src/main/res/drawable/share.xml
new file mode 100755
index 0000000..f8db3ee
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/drawable/share.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
diff --git a/AndroidTrivia/app/src/main/res/drawable/trivia_rules.xml b/AndroidTrivia/app/src/main/res/drawable/trivia_rules.xml
new file mode 100755
index 0000000..857416a
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/drawable/trivia_rules.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTrivia/app/src/main/res/drawable/try_again.xml b/AndroidTrivia/app/src/main/res/drawable/try_again.xml
new file mode 100755
index 0000000..bc50889
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/drawable/try_again.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTrivia/app/src/main/res/drawable/you_win.xml b/AndroidTrivia/app/src/main/res/drawable/you_win.xml
new file mode 100755
index 0000000..4fe59ee
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/drawable/you_win.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTrivia/app/src/main/res/layout/activity_main.xml b/AndroidTrivia/app/src/main/res/layout/activity_main.xml
new file mode 100755
index 0000000..56a1d78
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTrivia/app/src/main/res/layout/fragment_about.xml b/AndroidTrivia/app/src/main/res/layout/fragment_about.xml
new file mode 100755
index 0000000..0bd9fd8
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/layout/fragment_about.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTrivia/app/src/main/res/layout/fragment_game.xml b/AndroidTrivia/app/src/main/res/layout/fragment_game.xml
new file mode 100755
index 0000000..4c0a4e3
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/layout/fragment_game.xml
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTrivia/app/src/main/res/layout/fragment_game_over.xml b/AndroidTrivia/app/src/main/res/layout/fragment_game_over.xml
new file mode 100755
index 0000000..bedc949
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/layout/fragment_game_over.xml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTrivia/app/src/main/res/layout/fragment_game_won.xml b/AndroidTrivia/app/src/main/res/layout/fragment_game_won.xml
new file mode 100755
index 0000000..c2c42f1
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/layout/fragment_game_won.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTrivia/app/src/main/res/layout/fragment_rules.xml b/AndroidTrivia/app/src/main/res/layout/fragment_rules.xml
new file mode 100755
index 0000000..12d844d
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/layout/fragment_rules.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTrivia/app/src/main/res/layout/fragment_title.xml b/AndroidTrivia/app/src/main/res/layout/fragment_title.xml
new file mode 100755
index 0000000..279dbd6
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/layout/fragment_title.xml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTrivia/app/src/main/res/layout/nav_header.xml b/AndroidTrivia/app/src/main/res/layout/nav_header.xml
new file mode 100755
index 0000000..0e623b3
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/layout/nav_header.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTrivia/app/src/main/res/menu/navdrawer_menu.xml b/AndroidTrivia/app/src/main/res/menu/navdrawer_menu.xml
new file mode 100644
index 0000000..8b833b8
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/menu/navdrawer_menu.xml
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/AndroidTrivia/app/src/main/res/menu/options_menu.xml b/AndroidTrivia/app/src/main/res/menu/options_menu.xml
new file mode 100644
index 0000000..7ff2f4b
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/menu/options_menu.xml
@@ -0,0 +1,8 @@
+
+
\ No newline at end of file
diff --git a/AndroidTrivia/app/src/main/res/menu/winner_menu.xml b/AndroidTrivia/app/src/main/res/menu/winner_menu.xml
new file mode 100755
index 0000000..8527ea9
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/menu/winner_menu.xml
@@ -0,0 +1,28 @@
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTrivia/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/AndroidTrivia/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100755
index 0000000..b5a0928
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTrivia/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/AndroidTrivia/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100755
index 0000000..b5a0928
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTrivia/app/src/main/res/mipmap-hdpi/ic_launcher.png b/AndroidTrivia/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100755
index 0000000..a58850d
Binary files /dev/null and b/AndroidTrivia/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/AndroidTrivia/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/AndroidTrivia/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100755
index 0000000..f84827f
Binary files /dev/null and b/AndroidTrivia/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/AndroidTrivia/app/src/main/res/mipmap-mdpi/ic_launcher.png b/AndroidTrivia/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100755
index 0000000..ba43df7
Binary files /dev/null and b/AndroidTrivia/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/AndroidTrivia/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/AndroidTrivia/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100755
index 0000000..7be1258
Binary files /dev/null and b/AndroidTrivia/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/AndroidTrivia/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/AndroidTrivia/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100755
index 0000000..4acc984
Binary files /dev/null and b/AndroidTrivia/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/AndroidTrivia/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/AndroidTrivia/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100755
index 0000000..948f7d8
Binary files /dev/null and b/AndroidTrivia/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/AndroidTrivia/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/AndroidTrivia/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100755
index 0000000..3664ab7
Binary files /dev/null and b/AndroidTrivia/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/AndroidTrivia/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/AndroidTrivia/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100755
index 0000000..cc1e2f0
Binary files /dev/null and b/AndroidTrivia/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/AndroidTrivia/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/AndroidTrivia/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100755
index 0000000..00c38e3
Binary files /dev/null and b/AndroidTrivia/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/AndroidTrivia/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/AndroidTrivia/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100755
index 0000000..011c27c
Binary files /dev/null and b/AndroidTrivia/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/AndroidTrivia/app/src/main/res/navigation/navigation.xml b/AndroidTrivia/app/src/main/res/navigation/navigation.xml
new file mode 100644
index 0000000..a38edad
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/navigation/navigation.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTrivia/app/src/main/res/values/colors.xml b/AndroidTrivia/app/src/main/res/values/colors.xml
new file mode 100755
index 0000000..b30fbb7
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/values/colors.xml
@@ -0,0 +1,25 @@
+
+
+
+
+ #008577
+ #00574B
+ #7e53c5
+ #35A571
+ #B7F8C9
+ #f8bbd0
+
diff --git a/AndroidTrivia/app/src/main/res/values/dimens.xml b/AndroidTrivia/app/src/main/res/values/dimens.xml
new file mode 100755
index 0000000..d254c5c
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/values/dimens.xml
@@ -0,0 +1,29 @@
+
+
+
+
+ 16dp
+ 8dp
+ 16dp
+ 18sp
+ 32dp
+ 8dp
+ 18sp
+ 30sp
+ 192dp
+ 350dp
+
\ No newline at end of file
diff --git a/AndroidTrivia/app/src/main/res/values/strings.xml b/AndroidTrivia/app/src/main/res/values/strings.xml
new file mode 100755
index 0000000..83688be
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/values/strings.xml
@@ -0,0 +1,40 @@
+
+
+
+ Android Trivia
+ Game Over
+ Try Again?
+ Position
+ Select an Avatar
+ Android Trivia
+ Android Trivia will help remind you of important concepts you have learned and will learn in Android development.\n\nConsider modifying the questions and graphics to make this game your own!
+ Select the answer from the options given. Each time you get an answer correct, you advance to the next question.\n\nIf you get the answer wrong, your game ends! You can return to the title screen using up or back from within the game screen, and this will also end your game.
+ Rules
+ About
+ Trivia Hint
+ Android Trivia (%1$d/%2$d)
+ About Trivia
+ Trivia Rules
+ I mastered #UdacityAndroidTrivia with %1$d/%2$d correct questions!
+ Submit
+ Congratulations!
+ Share
+ Sharing Not Available
+
+
+ Hello blank fragment
+
diff --git a/AndroidTrivia/app/src/main/res/values/styles.xml b/AndroidTrivia/app/src/main/res/values/styles.xml
new file mode 100755
index 0000000..4a8ec2f
--- /dev/null
+++ b/AndroidTrivia/app/src/main/res/values/styles.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
diff --git a/AndroidTrivia/build.gradle b/AndroidTrivia/build.gradle
new file mode 100755
index 0000000..fbb78c4
--- /dev/null
+++ b/AndroidTrivia/build.gradle
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+buildscript {
+ ext {
+ kotlin_version = '1.3.11'
+ archLifecycleVersion = '1.1.1'
+ gradleVersion = '3.3.1'
+ supportlibVersion = '1.0.0-rc03'
+ dataBindingCompilerVersion = gradleVersion // Always need to be the same.
+ navigationVersion = '1.0.0-rc02'
+ }
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath "com.android.tools.build:gradle:$gradleVersion"
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+ classpath "android.arch.navigation:navigation-safe-args-gradle-plugin:$navigationVersion"
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/AndroidTrivia/gradle.properties b/AndroidTrivia/gradle.properties
new file mode 100755
index 0000000..15120a8
--- /dev/null
+++ b/AndroidTrivia/gradle.properties
@@ -0,0 +1,31 @@
+#
+# Copyright 2018, The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+android.enableJetifier=true
+android.useAndroidX=true
+org.gradle.jvmargs=-Xmx1536m
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
diff --git a/AndroidTrivia/gradle/wrapper/gradle-wrapper.jar b/AndroidTrivia/gradle/wrapper/gradle-wrapper.jar
new file mode 100755
index 0000000..7a3265e
Binary files /dev/null and b/AndroidTrivia/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/AndroidTrivia/gradle/wrapper/gradle-wrapper.properties b/AndroidTrivia/gradle/wrapper/gradle-wrapper.properties
new file mode 100755
index 0000000..e57fefc
--- /dev/null
+++ b/AndroidTrivia/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,7 @@
+#Mon Jan 14 23:13:44 IST 2019
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+android.databinding.enableV2=true
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
diff --git a/AndroidTrivia/gradlew b/AndroidTrivia/gradlew
new file mode 100755
index 0000000..cccdd3d
--- /dev/null
+++ b/AndroidTrivia/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/AndroidTrivia/gradlew.bat b/AndroidTrivia/gradlew.bat
new file mode 100755
index 0000000..e95643d
--- /dev/null
+++ b/AndroidTrivia/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/AndroidTrivia/settings.gradle b/AndroidTrivia/settings.gradle
new file mode 100755
index 0000000..41688c6
--- /dev/null
+++ b/AndroidTrivia/settings.gradle
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+include ':app'
diff --git a/AndroidTriviaFragment/README.md b/AndroidTriviaFragment/README.md
new file mode 100644
index 0000000..18055c3
--- /dev/null
+++ b/AndroidTriviaFragment/README.md
@@ -0,0 +1,51 @@
+AndroidTriviaFragment - solution code
+=====================================
+
+This app is the solution code for Android Kotlin Fundamentals codelab 3.1:
+Create and add a fragment. The app is also the starter code for Android Kotlin
+Fundamentals codelab 3.2: Define navigation paths.
+
+Introduction
+------------
+
+The AndroidTrivia app asks the user trivia questions about Android development.
+It makes use of the navigation component within Jetpack to move the user between
+screens. Each screen is implemented as a fragment.
+
+The app navigates using buttons, the app bar, and a navigation drawer. Because
+students haven't yet learned about saving data or the Android lifecycle, the app
+tries to eliminate bugs caused by configuration changes.
+
+Prerequisites
+-------------
+
+You need to know:
+- The fundamentals of Kotlin.
+- How to create basic Android apps in Kotlin.
+- How to open, build, and run apps with Android Studio.
+- How to work with layouts.
+
+Getting started
+---------------
+
+1. Download and run the app.
+
+License
+-------
+
+Copyright 2019 Google, Inc.
+
+Licensed to the Apache Software Foundation (ASF) under one or more contributor
+license agreements. See the NOTICE file distributed with this work for
+additional information regarding copyright ownership. The ASF licenses this
+file to you under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
\ No newline at end of file
diff --git a/AndroidTriviaFragment/app/.gitignore b/AndroidTriviaFragment/app/.gitignore
new file mode 100755
index 0000000..796b96d
--- /dev/null
+++ b/AndroidTriviaFragment/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/AndroidTriviaFragment/app/build.gradle b/AndroidTriviaFragment/app/build.gradle
new file mode 100755
index 0000000..4a9a4d3
--- /dev/null
+++ b/AndroidTriviaFragment/app/build.gradle
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+apply plugin: 'com.android.application'
+
+apply plugin: 'kotlin-android'
+
+apply plugin: 'kotlin-kapt'
+apply plugin: 'kotlin-android-extensions'
+
+android {
+ compileSdkVersion 28
+ dataBinding {
+ enabled = true
+ }
+ defaultConfig {
+ applicationId 'com.example.android.navigation'
+ minSdkVersion 19
+ targetSdkVersion 28
+ vectorDrawables.useSupportLibrary = true
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+ productFlavors {
+ }
+}
+
+dependencies {
+ implementation fileTree(include: ['*.jar'], dir: 'libs')
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
+ implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
+ implementation "androidx.appcompat:appcompat:$supportlibVersion"
+ implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha1'
+ implementation 'androidx.legacy:legacy-support-v4:1.0.0-beta01'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
+ implementation "com.google.android.material:material:1.0.0-rc01"
+}
diff --git a/AndroidTriviaFragment/app/proguard-rules.pro b/AndroidTriviaFragment/app/proguard-rules.pro
new file mode 100755
index 0000000..f1b4245
--- /dev/null
+++ b/AndroidTriviaFragment/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/AndroidTriviaFragment/app/src/main/AndroidManifest.xml b/AndroidTriviaFragment/app/src/main/AndroidManifest.xml
new file mode 100755
index 0000000..eb917a8
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/AndroidManifest.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaFragment/app/src/main/java/com/example/android/navigation/AboutFragment.kt b/AndroidTriviaFragment/app/src/main/java/com/example/android/navigation/AboutFragment.kt
new file mode 100755
index 0000000..1d08125
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/java/com/example/android/navigation/AboutFragment.kt
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.navigation
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+
+class AboutFragment : Fragment() {
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?): View? {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.fragment_about, container, false)
+ }
+}
diff --git a/AndroidTriviaFragment/app/src/main/java/com/example/android/navigation/GameFragment.kt b/AndroidTriviaFragment/app/src/main/java/com/example/android/navigation/GameFragment.kt
new file mode 100755
index 0000000..c9476cd
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/java/com/example/android/navigation/GameFragment.kt
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.navigation
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.appcompat.app.AppCompatActivity
+import androidx.databinding.DataBindingUtil
+import androidx.fragment.app.Fragment
+import com.example.android.navigation.databinding.FragmentGameBinding
+
+class GameFragment : Fragment() {
+ data class Question(
+ val text: String,
+ val answers: List)
+
+ // The first answer is the correct one. We randomize the answers before showing the text.
+ // All questions must have four answers. We'd want these to contain references to string
+ // resources so we could internationalize. (Or better yet, don't define the questions in code...)
+ private val questions: MutableList = mutableListOf(
+ Question(text = "What is Android Jetpack?",
+ answers = listOf("All of these", "Tools", "Documentation", "Libraries")),
+ Question(text = "What is the base class for layouts?",
+ answers = listOf("ViewGroup", "ViewSet", "ViewCollection", "ViewRoot")),
+ Question(text = "What layout do you use for complex screens?",
+ answers = listOf("ConstraintLayout", "GridLayout", "LinearLayout", "FrameLayout")),
+ Question(text = "What do you use to push structured data into a layout?",
+ answers = listOf("Data binding", "Data pushing", "Set text", "An OnClick method")),
+ Question(text = "What method do you use to inflate layouts in fragments?",
+ answers = listOf("onCreateView()", "onActivityCreated()", "onCreateLayout()", "onInflateLayout()")),
+ Question(text = "What's the build system for Android?",
+ answers = listOf("Gradle", "Graddle", "Grodle", "Groyle")),
+ Question(text = "Which class do you use to create a vector drawable?",
+ answers = listOf("VectorDrawable", "AndroidVectorDrawable", "DrawableVector", "AndroidVector")),
+ Question(text = "Which one of these is an Android navigation component?",
+ answers = listOf("NavController", "NavCentral", "NavMaster", "NavSwitcher")),
+ Question(text = "Which XML element lets you register an activity with the launcher activity?",
+ answers = listOf("intent-filter", "app-registry", "launcher-registry", "app-launcher")),
+ Question(text = "What do you use to mark a layout for data binding?",
+ answers = listOf("", "", "", ""))
+ )
+
+
+
+ lateinit var currentQuestion: Question
+ lateinit var answers: MutableList
+ private var questionIndex = 0
+ private val numQuestions = Math.min((questions.size + 1) / 2, 3)
+
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?): View? {
+
+ // Inflate the layout for this fragment
+ val binding = DataBindingUtil.inflate(
+ inflater, R.layout.fragment_game, container, false)
+
+ // Shuffles the questions and sets the question index to the first question.
+ randomizeQuestions()
+
+ // Bind this fragment class to the layout
+ binding.game = this
+
+ // Set the onClickListener for the submitButton
+ binding.submitButton.setOnClickListener @Suppress("UNUSED_ANONYMOUS_PARAMETER")
+ { view: View ->
+ val checkedId = binding.questionRadioGroup.checkedRadioButtonId
+ // Do nothing if nothing is checked (id == -1)
+ if (-1 != checkedId) {
+ var answerIndex = 0
+ when (checkedId) {
+ R.id.secondAnswerRadioButton -> answerIndex = 1
+ R.id.thirdAnswerRadioButton -> answerIndex = 2
+ R.id.fourthAnswerRadioButton -> answerIndex = 3
+ }
+ // The first answer in the original question is always the correct one, so if our
+ // answer matches, we have the correct answer.
+ if (answers[answerIndex] == currentQuestion.answers[0]) {
+ questionIndex++
+ // Advance to the next question
+ if (questionIndex < numQuestions) {
+ currentQuestion = questions[questionIndex]
+ setQuestion()
+ binding.invalidateAll()
+ } else {
+ // We've won! Navigate to the gameWonFragment.
+ }
+ } else {
+ // Game over! A wrong answer sends us to the gameOverFragment.
+ }
+ }
+ }
+ return binding.root
+ }
+
+ // randomize the questions and set the first question
+ private fun randomizeQuestions() {
+ questions.shuffle()
+ questionIndex = 0
+ setQuestion()
+ }
+
+ // Sets the question and randomizes the answers. This only changes the data, not the UI.
+ // Calling invalidateAll on the FragmentGameBinding updates the data.
+ private fun setQuestion() {
+ currentQuestion = questions[questionIndex]
+ // randomize the answers into a copy of the array
+ answers = currentQuestion.answers.toMutableList()
+ // and shuffle them
+ answers.shuffle()
+ (activity as AppCompatActivity).supportActionBar?.title = getString(R.string.title_android_trivia_question, questionIndex + 1, numQuestions)
+ }
+}
diff --git a/AndroidTriviaFragment/app/src/main/java/com/example/android/navigation/GameOverFragment.kt b/AndroidTriviaFragment/app/src/main/java/com/example/android/navigation/GameOverFragment.kt
new file mode 100755
index 0000000..c40fc7a
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/java/com/example/android/navigation/GameOverFragment.kt
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.navigation
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.databinding.DataBindingUtil
+import androidx.fragment.app.Fragment
+import com.example.android.navigation.databinding.FragmentGameOverBinding
+
+class GameOverFragment : Fragment() {
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?): View? {
+ // Inflate the layout for this fragment
+ val binding: FragmentGameOverBinding = DataBindingUtil.inflate(
+ inflater, R.layout.fragment_game_over, container, false)
+ return binding.root
+ }
+}
diff --git a/AndroidTriviaFragment/app/src/main/java/com/example/android/navigation/GameWonFragment.kt b/AndroidTriviaFragment/app/src/main/java/com/example/android/navigation/GameWonFragment.kt
new file mode 100755
index 0000000..525a57a
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/java/com/example/android/navigation/GameWonFragment.kt
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.navigation
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.databinding.DataBindingUtil
+import androidx.fragment.app.Fragment
+import com.example.android.navigation.databinding.FragmentGameWonBinding
+
+
+class GameWonFragment : Fragment() {
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?): View? {
+ // Inflate the layout for this fragment
+ val binding: FragmentGameWonBinding = DataBindingUtil.inflate(
+ inflater, R.layout.fragment_game_won, container, false)
+ return binding.root
+ }
+}
diff --git a/AndroidTriviaFragment/app/src/main/java/com/example/android/navigation/MainActivity.kt b/AndroidTriviaFragment/app/src/main/java/com/example/android/navigation/MainActivity.kt
new file mode 100755
index 0000000..ead670f
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/java/com/example/android/navigation/MainActivity.kt
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.navigation
+
+import android.os.Bundle
+import androidx.appcompat.app.AppCompatActivity
+import androidx.databinding.DataBindingUtil
+import com.example.android.navigation.databinding.ActivityMainBinding
+
+class MainActivity : AppCompatActivity() {
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ @Suppress("UNUSED_VARIABLE")
+ val binding = DataBindingUtil.setContentView(this, R.layout.activity_main)
+ }
+
+ // TODO (01) Create the new TitleFragment
+ // Select File->New->Fragment->Fragment (Blank)
+
+ // TODO (02) Clean up the new TitleFragment
+ // In our new TitleFragment
+
+ // TODO (03) Use DataBindingUtil.inflate to inflate and return the titleFragment in onCreateView
+ // In our new TitleFragment
+ // R.layout.fragment_title
+}
diff --git a/AndroidTriviaFragment/app/src/main/java/com/example/android/navigation/RulesFragment.kt b/AndroidTriviaFragment/app/src/main/java/com/example/android/navigation/RulesFragment.kt
new file mode 100755
index 0000000..11e0926
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/java/com/example/android/navigation/RulesFragment.kt
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.navigation
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+
+class RulesFragment : Fragment() {
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?): View? {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.fragment_rules, container, false)
+ }
+}
diff --git a/AndroidTriviaFragment/app/src/main/java/com/example/android/navigation/TitleFragment.kt b/AndroidTriviaFragment/app/src/main/java/com/example/android/navigation/TitleFragment.kt
new file mode 100644
index 0000000..0a3ab0c
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/java/com/example/android/navigation/TitleFragment.kt
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ package com.example.android.navigation
+
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.databinding.DataBindingUtil
+import com.example.android.navigation.databinding.FragmentTitleBinding
+
+
+// TODO: Rename parameter arguments, choose names that match
+// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
+private const val ARG_PARAM1 = "param1"
+private const val ARG_PARAM2 = "param2"
+
+/**
+ * A simple [Fragment] subclass.
+ *
+ */
+class TitleFragment : Fragment() {
+
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?): View? {
+ val binding = DataBindingUtil.inflate(inflater,
+ R.layout.fragment_title,container,false)
+ return binding.root
+ }
+
+
+}
diff --git a/AndroidTriviaFragment/app/src/main/res/anim/fade_out.xml b/AndroidTriviaFragment/app/src/main/res/anim/fade_out.xml
new file mode 100755
index 0000000..b47add9
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/anim/fade_out.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaFragment/app/src/main/res/anim/slide_in_right.xml b/AndroidTriviaFragment/app/src/main/res/anim/slide_in_right.xml
new file mode 100755
index 0000000..48d7c66
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/anim/slide_in_right.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
diff --git a/AndroidTriviaFragment/app/src/main/res/anim/slide_out_left.xml b/AndroidTriviaFragment/app/src/main/res/anim/slide_out_left.xml
new file mode 100755
index 0000000..c7c9c19
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/anim/slide_out_left.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
diff --git a/AndroidTriviaFragment/app/src/main/res/anim/slide_out_right.xml b/AndroidTriviaFragment/app/src/main/res/anim/slide_out_right.xml
new file mode 100755
index 0000000..41cdc83
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/anim/slide_out_right.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaFragment/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/AndroidTriviaFragment/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100755
index 0000000..188a517
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
diff --git a/AndroidTriviaFragment/app/src/main/res/drawable/about_android_trivia.xml b/AndroidTriviaFragment/app/src/main/res/drawable/about_android_trivia.xml
new file mode 100755
index 0000000..9628656
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/drawable/about_android_trivia.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTriviaFragment/app/src/main/res/drawable/android.xml b/AndroidTriviaFragment/app/src/main/res/drawable/android.xml
new file mode 100755
index 0000000..5bfbc23
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/drawable/android.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
diff --git a/AndroidTriviaFragment/app/src/main/res/drawable/android_category_simple.xml b/AndroidTriviaFragment/app/src/main/res/drawable/android_category_simple.xml
new file mode 100755
index 0000000..73d9a0a
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/drawable/android_category_simple.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
diff --git a/AndroidTriviaFragment/app/src/main/res/drawable/android_trivia.xml b/AndroidTriviaFragment/app/src/main/res/drawable/android_trivia.xml
new file mode 100755
index 0000000..5f76212
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/drawable/android_trivia.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTriviaFragment/app/src/main/res/drawable/ic_launcher_background.xml b/AndroidTriviaFragment/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100755
index 0000000..82ef050
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTriviaFragment/app/src/main/res/drawable/nav_header.xml b/AndroidTriviaFragment/app/src/main/res/drawable/nav_header.xml
new file mode 100755
index 0000000..c589432
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/drawable/nav_header.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTriviaFragment/app/src/main/res/drawable/rules.xml b/AndroidTriviaFragment/app/src/main/res/drawable/rules.xml
new file mode 100755
index 0000000..8d35602
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/drawable/rules.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
diff --git a/AndroidTriviaFragment/app/src/main/res/drawable/settings.xml b/AndroidTriviaFragment/app/src/main/res/drawable/settings.xml
new file mode 100755
index 0000000..fbfe778
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/drawable/settings.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
diff --git a/AndroidTriviaFragment/app/src/main/res/drawable/share.xml b/AndroidTriviaFragment/app/src/main/res/drawable/share.xml
new file mode 100755
index 0000000..f8db3ee
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/drawable/share.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
diff --git a/AndroidTriviaFragment/app/src/main/res/drawable/trivia_rules.xml b/AndroidTriviaFragment/app/src/main/res/drawable/trivia_rules.xml
new file mode 100755
index 0000000..857416a
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/drawable/trivia_rules.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTriviaFragment/app/src/main/res/drawable/try_again.xml b/AndroidTriviaFragment/app/src/main/res/drawable/try_again.xml
new file mode 100755
index 0000000..bc50889
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/drawable/try_again.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTriviaFragment/app/src/main/res/drawable/you_win.xml b/AndroidTriviaFragment/app/src/main/res/drawable/you_win.xml
new file mode 100755
index 0000000..4fe59ee
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/drawable/you_win.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTriviaFragment/app/src/main/res/layout/activity_main.xml b/AndroidTriviaFragment/app/src/main/res/layout/activity_main.xml
new file mode 100755
index 0000000..9a6e402
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTriviaFragment/app/src/main/res/layout/fragment_about.xml b/AndroidTriviaFragment/app/src/main/res/layout/fragment_about.xml
new file mode 100755
index 0000000..0bd9fd8
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/layout/fragment_about.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaFragment/app/src/main/res/layout/fragment_game.xml b/AndroidTriviaFragment/app/src/main/res/layout/fragment_game.xml
new file mode 100755
index 0000000..4c0a4e3
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/layout/fragment_game.xml
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaFragment/app/src/main/res/layout/fragment_game_over.xml b/AndroidTriviaFragment/app/src/main/res/layout/fragment_game_over.xml
new file mode 100755
index 0000000..bedc949
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/layout/fragment_game_over.xml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaFragment/app/src/main/res/layout/fragment_game_won.xml b/AndroidTriviaFragment/app/src/main/res/layout/fragment_game_won.xml
new file mode 100755
index 0000000..c2c42f1
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/layout/fragment_game_won.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaFragment/app/src/main/res/layout/fragment_rules.xml b/AndroidTriviaFragment/app/src/main/res/layout/fragment_rules.xml
new file mode 100755
index 0000000..12d844d
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/layout/fragment_rules.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTriviaFragment/app/src/main/res/layout/fragment_title.xml b/AndroidTriviaFragment/app/src/main/res/layout/fragment_title.xml
new file mode 100755
index 0000000..279dbd6
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/layout/fragment_title.xml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaFragment/app/src/main/res/layout/nav_header.xml b/AndroidTriviaFragment/app/src/main/res/layout/nav_header.xml
new file mode 100755
index 0000000..0e623b3
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/layout/nav_header.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaFragment/app/src/main/res/menu/winner_menu.xml b/AndroidTriviaFragment/app/src/main/res/menu/winner_menu.xml
new file mode 100755
index 0000000..8527ea9
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/menu/winner_menu.xml
@@ -0,0 +1,28 @@
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaFragment/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/AndroidTriviaFragment/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100755
index 0000000..b5a0928
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaFragment/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/AndroidTriviaFragment/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100755
index 0000000..b5a0928
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaFragment/app/src/main/res/mipmap-hdpi/ic_launcher.png b/AndroidTriviaFragment/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100755
index 0000000..a58850d
Binary files /dev/null and b/AndroidTriviaFragment/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/AndroidTriviaFragment/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/AndroidTriviaFragment/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100755
index 0000000..f84827f
Binary files /dev/null and b/AndroidTriviaFragment/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/AndroidTriviaFragment/app/src/main/res/mipmap-mdpi/ic_launcher.png b/AndroidTriviaFragment/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100755
index 0000000..ba43df7
Binary files /dev/null and b/AndroidTriviaFragment/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/AndroidTriviaFragment/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/AndroidTriviaFragment/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100755
index 0000000..7be1258
Binary files /dev/null and b/AndroidTriviaFragment/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/AndroidTriviaFragment/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/AndroidTriviaFragment/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100755
index 0000000..4acc984
Binary files /dev/null and b/AndroidTriviaFragment/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/AndroidTriviaFragment/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/AndroidTriviaFragment/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100755
index 0000000..948f7d8
Binary files /dev/null and b/AndroidTriviaFragment/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/AndroidTriviaFragment/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/AndroidTriviaFragment/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100755
index 0000000..3664ab7
Binary files /dev/null and b/AndroidTriviaFragment/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/AndroidTriviaFragment/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/AndroidTriviaFragment/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100755
index 0000000..cc1e2f0
Binary files /dev/null and b/AndroidTriviaFragment/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/AndroidTriviaFragment/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/AndroidTriviaFragment/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100755
index 0000000..00c38e3
Binary files /dev/null and b/AndroidTriviaFragment/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/AndroidTriviaFragment/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/AndroidTriviaFragment/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100755
index 0000000..011c27c
Binary files /dev/null and b/AndroidTriviaFragment/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/AndroidTriviaFragment/app/src/main/res/values/colors.xml b/AndroidTriviaFragment/app/src/main/res/values/colors.xml
new file mode 100755
index 0000000..b30fbb7
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/values/colors.xml
@@ -0,0 +1,25 @@
+
+
+
+
+ #008577
+ #00574B
+ #7e53c5
+ #35A571
+ #B7F8C9
+ #f8bbd0
+
diff --git a/AndroidTriviaFragment/app/src/main/res/values/dimens.xml b/AndroidTriviaFragment/app/src/main/res/values/dimens.xml
new file mode 100755
index 0000000..d254c5c
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/values/dimens.xml
@@ -0,0 +1,29 @@
+
+
+
+
+ 16dp
+ 8dp
+ 16dp
+ 18sp
+ 32dp
+ 8dp
+ 18sp
+ 30sp
+ 192dp
+ 350dp
+
\ No newline at end of file
diff --git a/AndroidTriviaFragment/app/src/main/res/values/strings.xml b/AndroidTriviaFragment/app/src/main/res/values/strings.xml
new file mode 100755
index 0000000..83688be
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/values/strings.xml
@@ -0,0 +1,40 @@
+
+
+
+ Android Trivia
+ Game Over
+ Try Again?
+ Position
+ Select an Avatar
+ Android Trivia
+ Android Trivia will help remind you of important concepts you have learned and will learn in Android development.\n\nConsider modifying the questions and graphics to make this game your own!
+ Select the answer from the options given. Each time you get an answer correct, you advance to the next question.\n\nIf you get the answer wrong, your game ends! You can return to the title screen using up or back from within the game screen, and this will also end your game.
+ Rules
+ About
+ Trivia Hint
+ Android Trivia (%1$d/%2$d)
+ About Trivia
+ Trivia Rules
+ I mastered #UdacityAndroidTrivia with %1$d/%2$d correct questions!
+ Submit
+ Congratulations!
+ Share
+ Sharing Not Available
+
+
+ Hello blank fragment
+
diff --git a/AndroidTriviaFragment/app/src/main/res/values/styles.xml b/AndroidTriviaFragment/app/src/main/res/values/styles.xml
new file mode 100755
index 0000000..4a8ec2f
--- /dev/null
+++ b/AndroidTriviaFragment/app/src/main/res/values/styles.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
diff --git a/AndroidTriviaFragment/build.gradle b/AndroidTriviaFragment/build.gradle
new file mode 100755
index 0000000..b28ba67
--- /dev/null
+++ b/AndroidTriviaFragment/build.gradle
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+buildscript {
+ ext {
+ kotlin_version = '1.3.11'
+ archLifecycleVersion = '1.1.1'
+ gradleVersion = '3.3.1'
+ supportlibVersion = '1.0.0-rc03'
+ dataBindingCompilerVersion = gradleVersion // Always need to be the same.
+ navigationVersion = '1.0.0-rc02'
+ }
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath "com.android.tools.build:gradle:$gradleVersion"
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/AndroidTriviaFragment/gradle.properties b/AndroidTriviaFragment/gradle.properties
new file mode 100755
index 0000000..15120a8
--- /dev/null
+++ b/AndroidTriviaFragment/gradle.properties
@@ -0,0 +1,31 @@
+#
+# Copyright 2018, The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+android.enableJetifier=true
+android.useAndroidX=true
+org.gradle.jvmargs=-Xmx1536m
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
diff --git a/AndroidTriviaFragment/gradle/wrapper/gradle-wrapper.jar b/AndroidTriviaFragment/gradle/wrapper/gradle-wrapper.jar
new file mode 100755
index 0000000..7a3265e
Binary files /dev/null and b/AndroidTriviaFragment/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/AndroidTriviaFragment/gradle/wrapper/gradle-wrapper.properties b/AndroidTriviaFragment/gradle/wrapper/gradle-wrapper.properties
new file mode 100755
index 0000000..e57fefc
--- /dev/null
+++ b/AndroidTriviaFragment/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,7 @@
+#Mon Jan 14 23:13:44 IST 2019
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+android.databinding.enableV2=true
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
diff --git a/AndroidTriviaFragment/gradlew b/AndroidTriviaFragment/gradlew
new file mode 100755
index 0000000..cccdd3d
--- /dev/null
+++ b/AndroidTriviaFragment/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/AndroidTriviaFragment/gradlew.bat b/AndroidTriviaFragment/gradlew.bat
new file mode 100755
index 0000000..e95643d
--- /dev/null
+++ b/AndroidTriviaFragment/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/AndroidTriviaFragment/settings.gradle b/AndroidTriviaFragment/settings.gradle
new file mode 100755
index 0000000..41688c6
--- /dev/null
+++ b/AndroidTriviaFragment/settings.gradle
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+include ':app'
diff --git a/AndroidTriviaNavigation/README.md b/AndroidTriviaNavigation/README.md
new file mode 100644
index 0000000..5d3a4be
--- /dev/null
+++ b/AndroidTriviaNavigation/README.md
@@ -0,0 +1,51 @@
+AndroidTriviaNavigation - solution code
+=======================================
+
+This app is the solution code for Android Kotlin Fundamentals codelab 3.2:
+Define navigation paths. The app is also the starter code for Android Kotlin
+Fundamentals codelab 3.3: Invoke an external activity.
+
+Introduction
+------------
+
+The AndroidTrivia app asks the user trivia questions about Android development.
+It makes use of the navigation component within Jetpack to move the user between
+screens. Each screen is implemented as a fragment.
+
+The app navigates using buttons, the app bar, and a navigation drawer. Because
+students haven't yet learned about saving data or the Android lifecycle, the app
+tries to eliminate bugs caused by configuration changes.
+
+Prerequisites
+-------------
+
+You need to know:
+- The fundamentals of Kotlin.
+- How to create basic Android apps in Kotlin.
+- How to open, build, and run apps with Android Studio.
+- How to work with layouts.
+
+Getting started
+---------------
+
+1. Download and run the app.
+
+License
+-------
+
+Copyright 2019 Google, Inc.
+
+Licensed to the Apache Software Foundation (ASF) under one or more contributor
+license agreements. See the NOTICE file distributed with this work for
+additional information regarding copyright ownership. The ASF licenses this
+file to you under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
\ No newline at end of file
diff --git a/AndroidTriviaNavigation/app/.gitignore b/AndroidTriviaNavigation/app/.gitignore
new file mode 100755
index 0000000..796b96d
--- /dev/null
+++ b/AndroidTriviaNavigation/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/AndroidTriviaNavigation/app/build.gradle b/AndroidTriviaNavigation/app/build.gradle
new file mode 100755
index 0000000..0a39d4f
--- /dev/null
+++ b/AndroidTriviaNavigation/app/build.gradle
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+apply plugin: 'com.android.application'
+
+apply plugin: 'kotlin-android'
+
+apply plugin: 'kotlin-kapt'
+apply plugin: 'kotlin-android-extensions'
+
+android {
+ compileSdkVersion 28
+ dataBinding {
+ enabled = true
+ }
+ defaultConfig {
+ applicationId 'com.example.android.navigation'
+ minSdkVersion 19
+ targetSdkVersion 28
+ vectorDrawables.useSupportLibrary = true
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+ productFlavors {
+ }
+}
+
+dependencies {
+ implementation fileTree(include: ['*.jar'], dir: 'libs')
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
+ implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
+ implementation "androidx.appcompat:appcompat:$supportlibVersion"
+ implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha1'
+ implementation 'androidx.legacy:legacy-support-v4:1.0.0-beta01'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
+ implementation "com.google.android.material:material:1.0.0-rc01"
+ implementation"android.arch.navigation:navigation-fragment-ktx:$navigationVersion"
+ implementation "android.arch.navigation:navigation-ui-ktx:$navigationVersion"
+ implementation "com.google.android.material:material:$supportlibVersion"
+}
diff --git a/AndroidTriviaNavigation/app/proguard-rules.pro b/AndroidTriviaNavigation/app/proguard-rules.pro
new file mode 100755
index 0000000..f1b4245
--- /dev/null
+++ b/AndroidTriviaNavigation/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/AndroidTriviaNavigation/app/src/main/AndroidManifest.xml b/AndroidTriviaNavigation/app/src/main/AndroidManifest.xml
new file mode 100755
index 0000000..eb917a8
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/AndroidManifest.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaNavigation/app/src/main/java/com/example/android/navigation/AboutFragment.kt b/AndroidTriviaNavigation/app/src/main/java/com/example/android/navigation/AboutFragment.kt
new file mode 100755
index 0000000..1d08125
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/java/com/example/android/navigation/AboutFragment.kt
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.navigation
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+
+class AboutFragment : Fragment() {
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?): View? {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.fragment_about, container, false)
+ }
+}
diff --git a/AndroidTriviaNavigation/app/src/main/java/com/example/android/navigation/GameFragment.kt b/AndroidTriviaNavigation/app/src/main/java/com/example/android/navigation/GameFragment.kt
new file mode 100755
index 0000000..e8b657e
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/java/com/example/android/navigation/GameFragment.kt
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.navigation
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.appcompat.app.AppCompatActivity
+import androidx.databinding.DataBindingUtil
+import androidx.fragment.app.Fragment
+import androidx.navigation.findNavController
+import com.example.android.navigation.databinding.FragmentGameBinding
+
+class GameFragment : Fragment() {
+ data class Question(
+ val text: String,
+ val answers: List)
+
+ // The first answer is the correct one. We randomize the answers before showing the text.
+ // All questions must have four answers. We'd want these to contain references to string
+ // resources so we could internationalize. (Or better yet, don't define the questions in code...)
+ private val questions: MutableList = mutableListOf(
+ Question(text = "What is Android Jetpack?",
+ answers = listOf("All of these", "Tools", "Documentation", "Libraries")),
+ Question(text = "What is the base class for layouts?",
+ answers = listOf("ViewGroup", "ViewSet", "ViewCollection", "ViewRoot")),
+ Question(text = "What layout do you use for complex screens?",
+ answers = listOf("ConstraintLayout", "GridLayout", "LinearLayout", "FrameLayout")),
+ Question(text = "What do you use to push structured data into a layout?",
+ answers = listOf("Data binding", "Data pushing", "Set text", "An OnClick method")),
+ Question(text = "What method do you use to inflate layouts in fragments?",
+ answers = listOf("onCreateView()", "onActivityCreated()", "onCreateLayout()", "onInflateLayout()")),
+ Question(text = "What's the build system for Android?",
+ answers = listOf("Gradle", "Graddle", "Grodle", "Groyle")),
+ Question(text = "Which class do you use to create a vector drawable?",
+ answers = listOf("VectorDrawable", "AndroidVectorDrawable", "DrawableVector", "AndroidVector")),
+ Question(text = "Which one of these is an Android navigation component?",
+ answers = listOf("NavController", "NavCentral", "NavMaster", "NavSwitcher")),
+ Question(text = "Which XML element lets you register an activity with the launcher activity?",
+ answers = listOf("intent-filter", "app-registry", "launcher-registry", "app-launcher")),
+ Question(text = "What do you use to mark a layout for data binding?",
+ answers = listOf("", "", "", ""))
+ )
+
+
+
+ lateinit var currentQuestion: Question
+ lateinit var answers: MutableList
+ private var questionIndex = 0
+ private val numQuestions = Math.min((questions.size + 1) / 2, 3)
+
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?): View? {
+
+ // Inflate the layout for this fragment
+ val binding = DataBindingUtil.inflate(
+ inflater, R.layout.fragment_game, container, false)
+
+ // Shuffles the questions and sets the question index to the first question.
+ randomizeQuestions()
+
+ // Bind this fragment class to the layout
+ binding.game = this
+
+ // Set the onClickListener for the submitButton
+ binding.submitButton.setOnClickListener @Suppress("UNUSED_ANONYMOUS_PARAMETER")
+ { view: View ->
+ val checkedId = binding.questionRadioGroup.checkedRadioButtonId
+ // Do nothing if nothing is checked (id == -1)
+ if (-1 != checkedId) {
+ var answerIndex = 0
+ when (checkedId) {
+ R.id.secondAnswerRadioButton -> answerIndex = 1
+ R.id.thirdAnswerRadioButton -> answerIndex = 2
+ R.id.fourthAnswerRadioButton -> answerIndex = 3
+ }
+ // The first answer in the original question is always the correct one, so if our
+ // answer matches, we have the correct answer.
+ if (answers[answerIndex] == currentQuestion.answers[0]) {
+ questionIndex++
+ // Advance to the next question
+ if (questionIndex < numQuestions) {
+ currentQuestion = questions[questionIndex]
+ setQuestion()
+ binding.invalidateAll()
+ } else {
+ // We've won! Navigate to the gameWonFragment.
+ view.findNavController()
+ .navigate(R.id.action_gameFragment_to_gameWonFragment)
+ }
+ } else {
+ // Game over! A wrong answer sends us to the gameOverFragment.
+ view.findNavController()
+ .navigate(R.id.action_gameFragment_to_gameOverFragment)
+ }
+ }
+ }
+ return binding.root
+ }
+
+ // randomize the questions and set the first question
+ private fun randomizeQuestions() {
+ questions.shuffle()
+ questionIndex = 0
+ setQuestion()
+ }
+
+ // Sets the question and randomizes the answers. This only changes the data, not the UI.
+ // Calling invalidateAll on the FragmentGameBinding updates the data.
+ private fun setQuestion() {
+ currentQuestion = questions[questionIndex]
+ // randomize the answers into a copy of the array
+ answers = currentQuestion.answers.toMutableList()
+ // and shuffle them
+ answers.shuffle()
+ (activity as AppCompatActivity).supportActionBar?.title = getString(R.string.title_android_trivia_question, questionIndex + 1, numQuestions)
+ }
+}
diff --git a/AndroidTriviaNavigation/app/src/main/java/com/example/android/navigation/GameOverFragment.kt b/AndroidTriviaNavigation/app/src/main/java/com/example/android/navigation/GameOverFragment.kt
new file mode 100755
index 0000000..f513899
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/java/com/example/android/navigation/GameOverFragment.kt
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.navigation
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.databinding.DataBindingUtil
+import androidx.fragment.app.Fragment
+import androidx.navigation.findNavController
+import com.example.android.navigation.databinding.FragmentGameOverBinding
+
+class GameOverFragment : Fragment() {
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?): View? {
+ // Inflate the layout for this fragment
+ val binding: FragmentGameOverBinding = DataBindingUtil.inflate(
+ inflater, R.layout.fragment_game_over, container, false)
+
+ binding.tryAgainButton.setOnClickListener { view: View ->
+ view.findNavController().navigate(R.id.action_gameOverFragment_to_gameFragment)
+ }
+ return binding.root
+ }
+}
diff --git a/AndroidTriviaNavigation/app/src/main/java/com/example/android/navigation/GameWonFragment.kt b/AndroidTriviaNavigation/app/src/main/java/com/example/android/navigation/GameWonFragment.kt
new file mode 100755
index 0000000..b867190
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/java/com/example/android/navigation/GameWonFragment.kt
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.navigation
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.databinding.DataBindingUtil
+import androidx.fragment.app.Fragment
+import androidx.navigation.findNavController
+import com.example.android.navigation.databinding.FragmentGameWonBinding
+
+
+class GameWonFragment : Fragment() {
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?): View? {
+ // Inflate the layout for this fragment
+ val binding: FragmentGameWonBinding = DataBindingUtil.inflate(
+ inflater, R.layout.fragment_game_won, container, false)
+
+ binding.nextMatchButton.setOnClickListener { view: View ->
+ view.findNavController().navigate(R.id.action_gameWonFragment_to_gameFragment)
+ }
+ return binding.root
+ }
+}
diff --git a/AndroidTriviaNavigation/app/src/main/java/com/example/android/navigation/MainActivity.kt b/AndroidTriviaNavigation/app/src/main/java/com/example/android/navigation/MainActivity.kt
new file mode 100755
index 0000000..9df648c
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/java/com/example/android/navigation/MainActivity.kt
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.navigation
+
+import android.os.Bundle
+import androidx.appcompat.app.AppCompatActivity
+import androidx.databinding.DataBindingUtil
+import androidx.drawerlayout.widget.DrawerLayout
+import androidx.navigation.findNavController
+import androidx.navigation.ui.NavigationUI
+import com.example.android.navigation.databinding.ActivityMainBinding
+
+class MainActivity : AppCompatActivity() {
+ private lateinit var drawerLayout: DrawerLayout
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ @Suppress("UNUSED_VARIABLE")
+ val binding = DataBindingUtil.setContentView(this, R.layout.activity_main)
+
+ drawerLayout = binding.drawerLayout
+
+ val navController = this.findNavController(R.id.myNavHostFragment)
+
+ NavigationUI.setupActionBarWithNavController(this,navController, drawerLayout)
+
+ NavigationUI.setupWithNavController(binding.navView, navController)
+
+ }
+
+ override fun onSupportNavigateUp(): Boolean {
+ val navController = this.findNavController(R.id.myNavHostFragment)
+ return NavigationUI.navigateUp(navController, drawerLayout)
+ }
+
+}
diff --git a/AndroidTriviaNavigation/app/src/main/java/com/example/android/navigation/RulesFragment.kt b/AndroidTriviaNavigation/app/src/main/java/com/example/android/navigation/RulesFragment.kt
new file mode 100755
index 0000000..11e0926
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/java/com/example/android/navigation/RulesFragment.kt
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.navigation
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+
+class RulesFragment : Fragment() {
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?): View? {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.fragment_rules, container, false)
+ }
+}
diff --git a/AndroidTriviaNavigation/app/src/main/java/com/example/android/navigation/TitleFragment.kt b/AndroidTriviaNavigation/app/src/main/java/com/example/android/navigation/TitleFragment.kt
new file mode 100644
index 0000000..8fa58d9
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/java/com/example/android/navigation/TitleFragment.kt
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ package com.example.android.navigation
+
+
+import android.os.Bundle
+import android.view.*
+import androidx.fragment.app.Fragment
+import androidx.databinding.DataBindingUtil
+import androidx.navigation.findNavController
+import androidx.navigation.ui.NavigationUI
+import com.example.android.navigation.databinding.FragmentTitleBinding
+
+
+// TODO: Rename parameter arguments, choose names that match
+// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
+private const val ARG_PARAM1 = "param1"
+private const val ARG_PARAM2 = "param2"
+
+/**
+ * A simple [Fragment] subclass.
+ *
+ */
+class TitleFragment : Fragment() {
+
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?): View? {
+ val binding = DataBindingUtil.inflate(inflater,
+ R.layout.fragment_title,container,false)
+
+ binding.playButton.setOnClickListener { view : View ->
+ view.findNavController().navigate(R.id.action_titleFragment_to_gameFragment)
+ }
+ setHasOptionsMenu(true)
+ return binding.root
+ }
+
+
+ override fun onCreateOptionsMenu(menu: Menu?, inflater: MenuInflater?) {
+ super.onCreateOptionsMenu(menu, inflater)
+ inflater?.inflate(R.menu.options_menu,menu)
+ }
+
+ override fun onOptionsItemSelected(item: MenuItem?): Boolean {
+ return NavigationUI.onNavDestinationSelected(item!!,view!!.findNavController())
+ ||super.onOptionsItemSelected(item)
+ }
+
+}
diff --git a/AndroidTriviaNavigation/app/src/main/res/anim/fade_out.xml b/AndroidTriviaNavigation/app/src/main/res/anim/fade_out.xml
new file mode 100755
index 0000000..b47add9
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/anim/fade_out.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaNavigation/app/src/main/res/anim/slide_in_right.xml b/AndroidTriviaNavigation/app/src/main/res/anim/slide_in_right.xml
new file mode 100755
index 0000000..48d7c66
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/anim/slide_in_right.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
diff --git a/AndroidTriviaNavigation/app/src/main/res/anim/slide_out_left.xml b/AndroidTriviaNavigation/app/src/main/res/anim/slide_out_left.xml
new file mode 100755
index 0000000..c7c9c19
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/anim/slide_out_left.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
diff --git a/AndroidTriviaNavigation/app/src/main/res/anim/slide_out_right.xml b/AndroidTriviaNavigation/app/src/main/res/anim/slide_out_right.xml
new file mode 100755
index 0000000..41cdc83
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/anim/slide_out_right.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaNavigation/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/AndroidTriviaNavigation/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100755
index 0000000..188a517
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
diff --git a/AndroidTriviaNavigation/app/src/main/res/drawable/about_android_trivia.xml b/AndroidTriviaNavigation/app/src/main/res/drawable/about_android_trivia.xml
new file mode 100755
index 0000000..9628656
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/drawable/about_android_trivia.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTriviaNavigation/app/src/main/res/drawable/android.xml b/AndroidTriviaNavigation/app/src/main/res/drawable/android.xml
new file mode 100755
index 0000000..5bfbc23
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/drawable/android.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
diff --git a/AndroidTriviaNavigation/app/src/main/res/drawable/android_category_simple.xml b/AndroidTriviaNavigation/app/src/main/res/drawable/android_category_simple.xml
new file mode 100755
index 0000000..73d9a0a
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/drawable/android_category_simple.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
diff --git a/AndroidTriviaNavigation/app/src/main/res/drawable/android_trivia.xml b/AndroidTriviaNavigation/app/src/main/res/drawable/android_trivia.xml
new file mode 100755
index 0000000..5f76212
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/drawable/android_trivia.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTriviaNavigation/app/src/main/res/drawable/ic_launcher_background.xml b/AndroidTriviaNavigation/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100755
index 0000000..82ef050
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTriviaNavigation/app/src/main/res/drawable/nav_header.xml b/AndroidTriviaNavigation/app/src/main/res/drawable/nav_header.xml
new file mode 100755
index 0000000..c589432
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/drawable/nav_header.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTriviaNavigation/app/src/main/res/drawable/rules.xml b/AndroidTriviaNavigation/app/src/main/res/drawable/rules.xml
new file mode 100755
index 0000000..8d35602
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/drawable/rules.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
diff --git a/AndroidTriviaNavigation/app/src/main/res/drawable/settings.xml b/AndroidTriviaNavigation/app/src/main/res/drawable/settings.xml
new file mode 100755
index 0000000..fbfe778
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/drawable/settings.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
diff --git a/AndroidTriviaNavigation/app/src/main/res/drawable/share.xml b/AndroidTriviaNavigation/app/src/main/res/drawable/share.xml
new file mode 100755
index 0000000..f8db3ee
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/drawable/share.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
diff --git a/AndroidTriviaNavigation/app/src/main/res/drawable/trivia_rules.xml b/AndroidTriviaNavigation/app/src/main/res/drawable/trivia_rules.xml
new file mode 100755
index 0000000..857416a
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/drawable/trivia_rules.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTriviaNavigation/app/src/main/res/drawable/try_again.xml b/AndroidTriviaNavigation/app/src/main/res/drawable/try_again.xml
new file mode 100755
index 0000000..bc50889
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/drawable/try_again.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTriviaNavigation/app/src/main/res/drawable/you_win.xml b/AndroidTriviaNavigation/app/src/main/res/drawable/you_win.xml
new file mode 100755
index 0000000..4fe59ee
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/drawable/you_win.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTriviaNavigation/app/src/main/res/layout/activity_main.xml b/AndroidTriviaNavigation/app/src/main/res/layout/activity_main.xml
new file mode 100755
index 0000000..56a1d78
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTriviaNavigation/app/src/main/res/layout/fragment_about.xml b/AndroidTriviaNavigation/app/src/main/res/layout/fragment_about.xml
new file mode 100755
index 0000000..0bd9fd8
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/layout/fragment_about.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaNavigation/app/src/main/res/layout/fragment_game.xml b/AndroidTriviaNavigation/app/src/main/res/layout/fragment_game.xml
new file mode 100755
index 0000000..4c0a4e3
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/layout/fragment_game.xml
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaNavigation/app/src/main/res/layout/fragment_game_over.xml b/AndroidTriviaNavigation/app/src/main/res/layout/fragment_game_over.xml
new file mode 100755
index 0000000..bedc949
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/layout/fragment_game_over.xml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaNavigation/app/src/main/res/layout/fragment_game_won.xml b/AndroidTriviaNavigation/app/src/main/res/layout/fragment_game_won.xml
new file mode 100755
index 0000000..c2c42f1
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/layout/fragment_game_won.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaNavigation/app/src/main/res/layout/fragment_rules.xml b/AndroidTriviaNavigation/app/src/main/res/layout/fragment_rules.xml
new file mode 100755
index 0000000..12d844d
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/layout/fragment_rules.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/AndroidTriviaNavigation/app/src/main/res/layout/fragment_title.xml b/AndroidTriviaNavigation/app/src/main/res/layout/fragment_title.xml
new file mode 100755
index 0000000..279dbd6
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/layout/fragment_title.xml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaNavigation/app/src/main/res/layout/nav_header.xml b/AndroidTriviaNavigation/app/src/main/res/layout/nav_header.xml
new file mode 100755
index 0000000..0e623b3
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/layout/nav_header.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaNavigation/app/src/main/res/menu/navdrawer_menu.xml b/AndroidTriviaNavigation/app/src/main/res/menu/navdrawer_menu.xml
new file mode 100644
index 0000000..8b833b8
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/menu/navdrawer_menu.xml
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/AndroidTriviaNavigation/app/src/main/res/menu/options_menu.xml b/AndroidTriviaNavigation/app/src/main/res/menu/options_menu.xml
new file mode 100644
index 0000000..7ff2f4b
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/menu/options_menu.xml
@@ -0,0 +1,8 @@
+
+
\ No newline at end of file
diff --git a/AndroidTriviaNavigation/app/src/main/res/menu/winner_menu.xml b/AndroidTriviaNavigation/app/src/main/res/menu/winner_menu.xml
new file mode 100755
index 0000000..8527ea9
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/menu/winner_menu.xml
@@ -0,0 +1,28 @@
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaNavigation/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/AndroidTriviaNavigation/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100755
index 0000000..b5a0928
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaNavigation/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/AndroidTriviaNavigation/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100755
index 0000000..b5a0928
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaNavigation/app/src/main/res/mipmap-hdpi/ic_launcher.png b/AndroidTriviaNavigation/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100755
index 0000000..a58850d
Binary files /dev/null and b/AndroidTriviaNavigation/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/AndroidTriviaNavigation/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/AndroidTriviaNavigation/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100755
index 0000000..f84827f
Binary files /dev/null and b/AndroidTriviaNavigation/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/AndroidTriviaNavigation/app/src/main/res/mipmap-mdpi/ic_launcher.png b/AndroidTriviaNavigation/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100755
index 0000000..ba43df7
Binary files /dev/null and b/AndroidTriviaNavigation/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/AndroidTriviaNavigation/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/AndroidTriviaNavigation/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100755
index 0000000..7be1258
Binary files /dev/null and b/AndroidTriviaNavigation/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/AndroidTriviaNavigation/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/AndroidTriviaNavigation/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100755
index 0000000..4acc984
Binary files /dev/null and b/AndroidTriviaNavigation/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/AndroidTriviaNavigation/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/AndroidTriviaNavigation/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100755
index 0000000..948f7d8
Binary files /dev/null and b/AndroidTriviaNavigation/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/AndroidTriviaNavigation/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/AndroidTriviaNavigation/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100755
index 0000000..3664ab7
Binary files /dev/null and b/AndroidTriviaNavigation/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/AndroidTriviaNavigation/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/AndroidTriviaNavigation/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100755
index 0000000..cc1e2f0
Binary files /dev/null and b/AndroidTriviaNavigation/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/AndroidTriviaNavigation/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/AndroidTriviaNavigation/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100755
index 0000000..00c38e3
Binary files /dev/null and b/AndroidTriviaNavigation/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/AndroidTriviaNavigation/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/AndroidTriviaNavigation/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100755
index 0000000..011c27c
Binary files /dev/null and b/AndroidTriviaNavigation/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/AndroidTriviaNavigation/app/src/main/res/navigation/navigation.xml b/AndroidTriviaNavigation/app/src/main/res/navigation/navigation.xml
new file mode 100644
index 0000000..bfd29b6
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/navigation/navigation.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidTriviaNavigation/app/src/main/res/values/colors.xml b/AndroidTriviaNavigation/app/src/main/res/values/colors.xml
new file mode 100755
index 0000000..b30fbb7
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/values/colors.xml
@@ -0,0 +1,25 @@
+
+
+
+
+ #008577
+ #00574B
+ #7e53c5
+ #35A571
+ #B7F8C9
+ #f8bbd0
+
diff --git a/AndroidTriviaNavigation/app/src/main/res/values/dimens.xml b/AndroidTriviaNavigation/app/src/main/res/values/dimens.xml
new file mode 100755
index 0000000..d254c5c
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/values/dimens.xml
@@ -0,0 +1,29 @@
+
+
+
+
+ 16dp
+ 8dp
+ 16dp
+ 18sp
+ 32dp
+ 8dp
+ 18sp
+ 30sp
+ 192dp
+ 350dp
+
\ No newline at end of file
diff --git a/AndroidTriviaNavigation/app/src/main/res/values/strings.xml b/AndroidTriviaNavigation/app/src/main/res/values/strings.xml
new file mode 100755
index 0000000..83688be
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/values/strings.xml
@@ -0,0 +1,40 @@
+
+
+
+ Android Trivia
+ Game Over
+ Try Again?
+ Position
+ Select an Avatar
+ Android Trivia
+ Android Trivia will help remind you of important concepts you have learned and will learn in Android development.\n\nConsider modifying the questions and graphics to make this game your own!
+ Select the answer from the options given. Each time you get an answer correct, you advance to the next question.\n\nIf you get the answer wrong, your game ends! You can return to the title screen using up or back from within the game screen, and this will also end your game.
+ Rules
+ About
+ Trivia Hint
+ Android Trivia (%1$d/%2$d)
+ About Trivia
+ Trivia Rules
+ I mastered #UdacityAndroidTrivia with %1$d/%2$d correct questions!
+ Submit
+ Congratulations!
+ Share
+ Sharing Not Available
+
+
+ Hello blank fragment
+
diff --git a/AndroidTriviaNavigation/app/src/main/res/values/styles.xml b/AndroidTriviaNavigation/app/src/main/res/values/styles.xml
new file mode 100755
index 0000000..4a8ec2f
--- /dev/null
+++ b/AndroidTriviaNavigation/app/src/main/res/values/styles.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
diff --git a/AndroidTriviaNavigation/build.gradle b/AndroidTriviaNavigation/build.gradle
new file mode 100755
index 0000000..b28ba67
--- /dev/null
+++ b/AndroidTriviaNavigation/build.gradle
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+buildscript {
+ ext {
+ kotlin_version = '1.3.11'
+ archLifecycleVersion = '1.1.1'
+ gradleVersion = '3.3.1'
+ supportlibVersion = '1.0.0-rc03'
+ dataBindingCompilerVersion = gradleVersion // Always need to be the same.
+ navigationVersion = '1.0.0-rc02'
+ }
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath "com.android.tools.build:gradle:$gradleVersion"
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/AndroidTriviaNavigation/gradle.properties b/AndroidTriviaNavigation/gradle.properties
new file mode 100755
index 0000000..15120a8
--- /dev/null
+++ b/AndroidTriviaNavigation/gradle.properties
@@ -0,0 +1,31 @@
+#
+# Copyright 2018, The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+android.enableJetifier=true
+android.useAndroidX=true
+org.gradle.jvmargs=-Xmx1536m
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
diff --git a/AndroidTriviaNavigation/gradle/wrapper/gradle-wrapper.jar b/AndroidTriviaNavigation/gradle/wrapper/gradle-wrapper.jar
new file mode 100755
index 0000000..7a3265e
Binary files /dev/null and b/AndroidTriviaNavigation/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/AndroidTriviaNavigation/gradle/wrapper/gradle-wrapper.properties b/AndroidTriviaNavigation/gradle/wrapper/gradle-wrapper.properties
new file mode 100755
index 0000000..e57fefc
--- /dev/null
+++ b/AndroidTriviaNavigation/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,7 @@
+#Mon Jan 14 23:13:44 IST 2019
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+android.databinding.enableV2=true
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
diff --git a/AndroidTriviaNavigation/gradlew b/AndroidTriviaNavigation/gradlew
new file mode 100755
index 0000000..cccdd3d
--- /dev/null
+++ b/AndroidTriviaNavigation/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/AndroidTriviaNavigation/gradlew.bat b/AndroidTriviaNavigation/gradlew.bat
new file mode 100755
index 0000000..e95643d
--- /dev/null
+++ b/AndroidTriviaNavigation/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/AndroidTriviaNavigation/settings.gradle b/AndroidTriviaNavigation/settings.gradle
new file mode 100755
index 0000000..41688c6
--- /dev/null
+++ b/AndroidTriviaNavigation/settings.gradle
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+include ':app'