├── Chapter01 ├── HelloWorldActivity.kt ├── MainActivity.kt ├── README.txt ├── content_hello_world.xml └── content_main.xml ├── Chapter02 ├── HelloWorldActivity.kt ├── MainActivity.kt ├── content_hello_world.xml └── content_main.xml ├── Chapter03 └── README.txt ├── Chapter04 └── LayoutExploration │ ├── java │ └── MainActivity.kt │ └── layout │ ├── activity_main.xml │ ├── main_menu.xml │ └── my_table_layout.xml ├── Chapter05 └── CardViewLayout │ ├── drawable │ ├── image_1.png │ ├── image_2.png │ └── image_3.png │ ├── java │ └── MainActivity.kt │ ├── layout │ ├── card_contents_1.xml │ ├── card_contents_2.xml │ ├── card_contents_3.xml │ └── main_layout.xml │ └── values │ └── dimens.xml ├── Chapter06 └── Lifecycle Demo │ └── MainActivity.kt ├── Chapter07 └── MainActivity.kt ├── Chapter08 ├── Loops Demo │ └── MainActivity.kt └── When Demo │ └── MainActivity.kt ├── Chapter09 └── MainActivity.kt ├── Chapter10 ├── Basic Classes │ ├── Carrier.kt │ ├── Destroyer.kt │ ├── MainActivity.kt │ └── ShipYard.kt └── Chapter Example Classes │ ├── AccessTester.kt │ ├── Book.kt │ ├── MainActivity.kt │ ├── Meeting.kt │ ├── SatelliteController.kt │ └── Soldier.kt ├── Chapter11 ├── Basic Classes with Inheritance │ ├── Carrier.kt │ ├── Destroyer.kt │ ├── MainActivity.kt │ ├── Ship.kt │ └── ShipYard.kt └── Chapter examples │ ├── MainActivity.kt │ ├── Paratrooper.kt │ ├── Sniper.kt │ ├── Soldier.kt │ └── SpecialForces.kt ├── Chapter12 └── Kotlin meet UI │ ├── MainActivity.kt │ └── activity_main.xml ├── Chapter13 └── Widget Exploration │ ├── MainActivity.kt │ └── exploration_layout.xml ├── Chapter14 ├── Dialog Demo │ ├── MainActivity.kt │ ├── MyDialog.kt │ └── activity_main.xml └── Note to self │ ├── java │ ├── DialogNewNote.kt │ ├── DialogShowNote.kt │ ├── MainActivity.kt │ └── Note.kt │ ├── layout │ ├── activity_main.xml │ ├── content_main.xml │ ├── dialog_new_note.xml │ └── dialog_show_note.xml │ └── values │ └── strings.xml ├── Chapter15 ├── Dynamic Array Example │ └── MainActivity.kt └── Simple Array Example │ └── MainActivity.kt ├── Chapter16 └── Note to self │ ├── java │ ├── DialogNewNote.kt │ ├── DialogShowNote.kt │ ├── MainActivity.kt │ ├── Note.kt │ └── NoteAdapter.kt │ ├── layout │ ├── activity_main.xml │ ├── content_main.xml │ ├── dialog_new_note.xml │ ├── dialog_show_note.xml │ └── listitem.xml │ └── values │ └── strings.xml ├── Chapter17 └── Note to self │ ├── java │ ├── DialogNewNote.kt │ ├── DialogShowNote.kt │ ├── JSONSerializer.kt │ ├── MainActivity.kt │ ├── Note.kt │ ├── NoteAdapter.kt │ └── SettingsActivity.kt │ ├── layout │ ├── activity_main.xml │ ├── activity_settings.xml │ ├── content_main.xml │ ├── dialog_new_note.xml │ ├── dialog_show_note.xml │ └── listitem.xml │ └── values │ └── strings.xml ├── Chapter18 ├── java │ ├── DialogNewNote.kt │ ├── DialogShowNote.kt │ └── readme.txt └── res │ ├── strings.xml │ ├── values-de │ └── strings.xml │ └── values-es │ └── strings.xml ├── Chapter19 ├── MainActivity.kt └── anim │ ├── bounce.xml │ ├── fade_in.xml │ ├── fade_in_out.xml │ ├── fade_out.xml │ ├── flash.xml │ ├── left_right.xml │ ├── right_left.xml │ ├── rotate_left.xml │ ├── rotate_right.xml │ ├── top_bot.xml │ ├── zoom_in.xml │ └── zoom_out.xml ├── Chapter20 ├── Bitmap Manipulation │ ├── MainActivity.kt │ └── drawable │ │ └── bob.png └── Canvas Demo │ └── MainActivity.kt ├── Chapter21 ├── LiveDrawingView.kt ├── MainActivity.kt ├── Particle.kt └── ParticleSystem.kt ├── Chapter22 ├── LiveDrawingView.kt ├── MainActivity.kt ├── Particle.kt └── ParticleSystem.kt ├── Chapter23 └── Sound Demo │ ├── assets │ ├── fx1.ogg │ ├── fx2.ogg │ └── fx3.ogg │ ├── java │ └── MainActivity.kt │ ├── layout │ ├── activity_main.xml │ └── content_main.xml │ └── values │ └── strings.xml ├── Chapter24 ├── Device Detection │ ├── MainActivity.kt │ ├── layout-land │ │ └── activity_main.xml │ └── layout │ │ └── activity_main.xml └── Simple Fragment │ ├── java │ ├── MainActivity.kt │ └── SimpleFragment.kt │ └── layout │ ├── activity_main.xml │ └── fragment_layout.xml ├── Chapter25 ├── Fragment Pager │ ├── java │ │ ├── MainActivity.kt │ │ └── SimpleFragment.kt │ └── layout │ │ ├── activity_main.xml │ │ └── fragment_layout.xml └── Image Pager │ ├── drawable │ ├── ic_launcher_background.xml │ ├── image1.png │ ├── image2.png │ ├── image3.png │ ├── image4.png │ ├── image5.png │ └── image6.png │ ├── java │ ├── ImagePagerAdapter.kt │ └── MainActivity.kt │ └── layout │ ├── activity_main.xml │ └── pager_item.xml ├── Chapter26 ├── java │ ├── DeleteFragment.kt │ ├── InsertFragment.kt │ ├── MainActivity.kt │ ├── ResultsFragment.kt │ └── SearchFragment.kt ├── layout │ ├── activity_main.xml │ ├── app_bar_main.xml │ ├── content_delete.xml │ ├── content_insert.xml │ ├── content_main.xml │ ├── content_results.xml │ ├── content_search.xml │ └── nav_header_main.xml └── menu │ ├── activity_main_drawer.xml │ └── main.xml ├── Chapter27 ├── java │ ├── DataManager.kt │ ├── DeleteFragment.kt │ ├── InsertFragment.kt │ ├── MainActivity.kt │ ├── ResultsFragment.kt │ └── SearchFragment.kt └── layout │ ├── activity_main.xml │ ├── app_bar_main.xml │ ├── content_delete.xml │ ├── content_insert.xml │ ├── content_main.xml │ ├── content_results.xml │ ├── content_search.xml │ └── nav_header_main.xml ├── LICENSE └── README.md /Chapter01/HelloWorldActivity.kt: -------------------------------------------------------------------------------- 1 | package com.gamecodeschool.helloworld 2 | 3 | import android.os.Bundle 4 | import com.google.android.material.snackbar.Snackbar 5 | import androidx.appcompat.app.AppCompatActivity 6 | import android.view.Menu 7 | import android.view.MenuItem 8 | 9 | import kotlinx.android.synthetic.main.activity_hello_world.* 10 | 11 | class HelloWorldActivity : AppCompatActivity() { 12 | 13 | override fun onCreate(savedInstanceState: Bundle?) { 14 | super.onCreate(savedInstanceState) 15 | setContentView(R.layout.activity_hello_world) 16 | setSupportActionBar(toolbar) 17 | 18 | fab.setOnClickListener { view -> 19 | Snackbar.make(view, "Replace with your own action", 20 | Snackbar.LENGTH_LONG) 21 | .setAction("Action", null).show() 22 | } 23 | } 24 | 25 | override fun onCreateOptionsMenu(menu: Menu): Boolean { 26 | // Inflate the menu; this adds items to the action bar if it is present. 27 | menuInflater.inflate(R.menu.menu_hello_world, menu) 28 | return true 29 | } 30 | 31 | override fun onOptionsItemSelected(item: MenuItem): Boolean { 32 | // Handle action bar item clicks here. The action bar will 33 | // automatically handle clicks on the Home/Up button, so long 34 | // as you specify a parent activity in AndroidManifest.xml. 35 | return when (item.itemId) { 36 | R.id.action_settings -> true 37 | else -> super.onOptionsItemSelected(item) 38 | } 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /Chapter01/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.gamecodeschool.helloworld 2 | 3 | import android.os.Bundle 4 | import com.google.android.material.snackbar.Snackbar 5 | import androidx.appcompat.app.AppCompatActivity 6 | import android.view.Menu 7 | import android.view.MenuItem 8 | 9 | import kotlinx.android.synthetic.main.activity_hello_world.* 10 | 11 | class MainActivity : AppCompatActivity() { 12 | 13 | override fun onCreate(savedInstanceState: Bundle?) { 14 | super.onCreate(savedInstanceState) 15 | setContentView(R.layout.activity_main) 16 | setSupportActionBar(toolbar) 17 | 18 | fab.setOnClickListener { view -> 19 | Snackbar.make(view, "Replace with your own action", 20 | Snackbar.LENGTH_LONG) 21 | .setAction("Action", null).show() 22 | } 23 | } 24 | 25 | override fun onCreateOptionsMenu(menu: Menu): Boolean { 26 | // Inflate the menu; this adds items to the action bar if it is present. 27 | menuInflater.inflate(R.menu.menu_hello_world, menu) 28 | return true 29 | } 30 | 31 | override fun onOptionsItemSelected(item: MenuItem): Boolean { 32 | // Handle action bar item clicks here. The action bar will 33 | // automatically handle clicks on the Home/Up button, so long 34 | // as you specify a parent activity in AndroidManifest.xml. 35 | return when (item.itemId) { 36 | R.id.action_settings -> true 37 | else -> super.onOptionsItemSelected(item) 38 | } 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /Chapter01/README.txt: -------------------------------------------------------------------------------- 1 | Copy & pasting this code will not work. It is provided here for reference only -------------------------------------------------------------------------------- /Chapter01/content_hello_world.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 19 | 20 | -------------------------------------------------------------------------------- /Chapter01/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 19 | 20 | -------------------------------------------------------------------------------- /Chapter02/HelloWorldActivity.kt: -------------------------------------------------------------------------------- 1 | package com.gamecodeschool.helloworld 2 | 3 | import android.os.Bundle 4 | import android.util.Log 5 | import com.google.android.material.snackbar.Snackbar 6 | import androidx.appcompat.app.AppCompatActivity 7 | import android.view.Menu 8 | import android.view.MenuItem 9 | import android.view.View 10 | import android.widget.Toast 11 | 12 | import kotlinx.android.synthetic.main.activity_hello_world.* 13 | 14 | class HelloWorldActivity : AppCompatActivity() { 15 | 16 | override fun onCreate(savedInstanceState: Bundle?) { 17 | super.onCreate(savedInstanceState) 18 | setContentView(R.layout.activity_hello_world) 19 | setSupportActionBar(toolbar) 20 | 21 | fab.setOnClickListener { view -> 22 | Snackbar.make(view, "Replace with your own action", 23 | Snackbar.LENGTH_LONG) 24 | .setAction("Action", null).show() 25 | } 26 | 27 | // Your code goes here 28 | Toast.makeText(this, "Can you see me?", 29 | Toast.LENGTH_SHORT).show() 30 | 31 | Log.i("info", "Done creating the app") 32 | 33 | } 34 | 35 | override fun onCreateOptionsMenu(menu: Menu): Boolean { 36 | // Inflate the menu; this adds items to the action bar if it is present. 37 | menuInflater.inflate(R.menu.menu_hello_world, menu) 38 | return true 39 | } 40 | 41 | override fun onOptionsItemSelected(item: MenuItem): Boolean { 42 | // Handle action bar item clicks here. The action bar will 43 | // automatically handle clicks on the Home/Up button, so long 44 | // as you specify a parent activity in AndroidManifest.xml. 45 | return when (item.itemId) { 46 | R.id.action_settings -> true 47 | else -> super.onOptionsItemSelected(item) 48 | } 49 | } 50 | 51 | fun topClick(v: View) { 52 | Toast.makeText(this, "Top button clicked", 53 | Toast.LENGTH_SHORT).show() 54 | 55 | Log.i("info", "The user clicked the top button") 56 | } 57 | 58 | fun bottomClick(v: View) { 59 | Toast.makeText(this, "Bottom button clicked", 60 | Toast.LENGTH_SHORT).show() 61 | 62 | Log.i("info", "The user clicked the bottom button") 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /Chapter02/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.gamecodeschool.helloworld 2 | 3 | import android.os.Bundle 4 | import android.util.Log 5 | import com.google.android.material.snackbar.Snackbar 6 | import androidx.appcompat.app.AppCompatActivity 7 | import android.view.Menu 8 | import android.view.MenuItem 9 | import android.view.View 10 | import android.widget.Toast 11 | 12 | import kotlinx.android.synthetic.main.activity_hello_world.* 13 | 14 | class MainActivity : AppCompatActivity() { 15 | 16 | override fun onCreate(savedInstanceState: Bundle?) { 17 | super.onCreate(savedInstanceState) 18 | setContentView(R.layout.activity_main) 19 | setSupportActionBar(toolbar) 20 | 21 | fab.setOnClickListener { view -> 22 | Snackbar.make(view, "Replace with your own action", 23 | Snackbar.LENGTH_LONG) 24 | .setAction("Action", null).show() 25 | } 26 | 27 | // Your code goes here 28 | Toast.makeText(this, "Can you see me?", 29 | Toast.LENGTH_SHORT).show() 30 | 31 | Log.i("info", "Done creating the app") 32 | 33 | } 34 | 35 | override fun onCreateOptionsMenu(menu: Menu): Boolean { 36 | // Inflate the menu; this adds items to the action bar if it is present. 37 | menuInflater.inflate(R.menu.menu_hello_world, menu) 38 | return true 39 | } 40 | 41 | override fun onOptionsItemSelected(item: MenuItem): Boolean { 42 | // Handle action bar item clicks here. The action bar will 43 | // automatically handle clicks on the Home/Up button, so long 44 | // as you specify a parent activity in AndroidManifest.xml. 45 | return when (item.itemId) { 46 | R.id.action_settings -> true 47 | else -> super.onOptionsItemSelected(item) 48 | } 49 | } 50 | 51 | fun topClick(v: View) { 52 | Toast.makeText(this, "Top button clicked", 53 | Toast.LENGTH_SHORT).show() 54 | 55 | Log.i("info", "The user clicked the top button") 56 | } 57 | 58 | fun bottomClick(v: View) { 59 | Toast.makeText(this, "Bottom button clicked", 60 | Toast.LENGTH_SHORT).show() 61 | 62 | Log.i("info", "The user clicked the bottom button") 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /Chapter02/content_hello_world.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 20 | 21 |