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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +