-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
183 changed files
with
7,718 additions
and
1 deletion.
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
...droid Programming With Kotlin For Beginners/Android-Programming-with-Kotlin-for-Beginners
Submodule Android-Programming-with-Kotlin-for-Beginners
deleted from
82edaf
41 changes: 41 additions & 0 deletions
41
...io/LRC Book Android Programming With Kotlin For Beginners/Chapter01/HelloWorldActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.gamecodeschool.helloworld | ||
|
||
import android.os.Bundle | ||
import com.google.android.material.snackbar.Snackbar | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.view.Menu | ||
import android.view.MenuItem | ||
|
||
import kotlinx.android.synthetic.main.activity_hello_world.* | ||
|
||
class HelloWorldActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_hello_world) | ||
setSupportActionBar(toolbar) | ||
|
||
fab.setOnClickListener { view -> | ||
Snackbar.make(view, "Replace with your own action", | ||
Snackbar.LENGTH_LONG) | ||
.setAction("Action", null).show() | ||
} | ||
} | ||
|
||
override fun onCreateOptionsMenu(menu: Menu): Boolean { | ||
// Inflate the menu; this adds items to the action bar if it is present. | ||
menuInflater.inflate(R.menu.menu_hello_world, menu) | ||
return true | ||
} | ||
|
||
override fun onOptionsItemSelected(item: MenuItem): Boolean { | ||
// Handle action bar item clicks here. The action bar will | ||
// automatically handle clicks on the Home/Up button, so long | ||
// as you specify a parent activity in AndroidManifest.xml. | ||
return when (item.itemId) { | ||
R.id.action_settings -> true | ||
else -> super.onOptionsItemSelected(item) | ||
} | ||
} | ||
} | ||
|
41 changes: 41 additions & 0 deletions
41
...d Studio/LRC Book Android Programming With Kotlin For Beginners/Chapter01/MainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.gamecodeschool.helloworld | ||
|
||
import android.os.Bundle | ||
import com.google.android.material.snackbar.Snackbar | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.view.Menu | ||
import android.view.MenuItem | ||
|
||
import kotlinx.android.synthetic.main.activity_hello_world.* | ||
|
||
class MainActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_main) | ||
setSupportActionBar(toolbar) | ||
|
||
fab.setOnClickListener { view -> | ||
Snackbar.make(view, "Replace with your own action", | ||
Snackbar.LENGTH_LONG) | ||
.setAction("Action", null).show() | ||
} | ||
} | ||
|
||
override fun onCreateOptionsMenu(menu: Menu): Boolean { | ||
// Inflate the menu; this adds items to the action bar if it is present. | ||
menuInflater.inflate(R.menu.menu_hello_world, menu) | ||
return true | ||
} | ||
|
||
override fun onOptionsItemSelected(item: MenuItem): Boolean { | ||
// Handle action bar item clicks here. The action bar will | ||
// automatically handle clicks on the Home/Up button, so long | ||
// as you specify a parent activity in AndroidManifest.xml. | ||
return when (item.itemId) { | ||
R.id.action_settings -> true | ||
else -> super.onOptionsItemSelected(item) | ||
} | ||
} | ||
} | ||
|
1 change: 1 addition & 0 deletions
1
Android Studio/LRC Book Android Programming With Kotlin For Beginners/Chapter01/README.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Copy & pasting this code will not work. It is provided here for reference only |
20 changes: 20 additions & 0 deletions
20
.../LRC Book Android Programming With Kotlin For Beginners/Chapter01/content_hello_world.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
app:layout_behavior="@string/appbar_scrolling_view_behavior" | ||
tools:context=".HelloWorldActivity" | ||
tools:showIn="@layout/activity_hello_world"> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Hello World!" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintRight_toRightOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
20 changes: 20 additions & 0 deletions
20
... Studio/LRC Book Android Programming With Kotlin For Beginners/Chapter01/content_main.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
app:layout_behavior="@string/appbar_scrolling_view_behavior" | ||
tools:context=".HelloWorldActivity" | ||
tools:showIn="@layout/activity_hello_world"> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Hello World!" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintRight_toRightOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
4 changes: 4 additions & 0 deletions
4
Android Studio/LRC Book Android Programming With Kotlin For Beginners/Chapter01/desktop.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[ViewState] | ||
Mode= | ||
Vid= | ||
FolderType=Documents |
66 changes: 66 additions & 0 deletions
66
...io/LRC Book Android Programming With Kotlin For Beginners/Chapter02/HelloWorldActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package com.gamecodeschool.helloworld | ||
|
||
import android.os.Bundle | ||
import android.util.Log | ||
import com.google.android.material.snackbar.Snackbar | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.view.Menu | ||
import android.view.MenuItem | ||
import android.view.View | ||
import android.widget.Toast | ||
|
||
import kotlinx.android.synthetic.main.activity_hello_world.* | ||
|
||
class HelloWorldActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_hello_world) | ||
setSupportActionBar(toolbar) | ||
|
||
fab.setOnClickListener { view -> | ||
Snackbar.make(view, "Replace with your own action", | ||
Snackbar.LENGTH_LONG) | ||
.setAction("Action", null).show() | ||
} | ||
|
||
// Your code goes here | ||
Toast.makeText(this, "Can you see me?", | ||
Toast.LENGTH_SHORT).show() | ||
|
||
Log.i("info", "Done creating the app") | ||
|
||
} | ||
|
||
override fun onCreateOptionsMenu(menu: Menu): Boolean { | ||
// Inflate the menu; this adds items to the action bar if it is present. | ||
menuInflater.inflate(R.menu.menu_hello_world, menu) | ||
return true | ||
} | ||
|
||
override fun onOptionsItemSelected(item: MenuItem): Boolean { | ||
// Handle action bar item clicks here. The action bar will | ||
// automatically handle clicks on the Home/Up button, so long | ||
// as you specify a parent activity in AndroidManifest.xml. | ||
return when (item.itemId) { | ||
R.id.action_settings -> true | ||
else -> super.onOptionsItemSelected(item) | ||
} | ||
} | ||
|
||
fun topClick(v: View) { | ||
Toast.makeText(this, "Top button clicked", | ||
Toast.LENGTH_SHORT).show() | ||
|
||
Log.i("info", "The user clicked the top button") | ||
} | ||
|
||
fun bottomClick(v: View) { | ||
Toast.makeText(this, "Bottom button clicked", | ||
Toast.LENGTH_SHORT).show() | ||
|
||
Log.i("info", "The user clicked the bottom button") | ||
} | ||
|
||
} | ||
|
66 changes: 66 additions & 0 deletions
66
...d Studio/LRC Book Android Programming With Kotlin For Beginners/Chapter02/MainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package com.gamecodeschool.helloworld | ||
|
||
import android.os.Bundle | ||
import android.util.Log | ||
import com.google.android.material.snackbar.Snackbar | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.view.Menu | ||
import android.view.MenuItem | ||
import android.view.View | ||
import android.widget.Toast | ||
|
||
import kotlinx.android.synthetic.main.activity_hello_world.* | ||
|
||
class MainActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_main) | ||
setSupportActionBar(toolbar) | ||
|
||
fab.setOnClickListener { view -> | ||
Snackbar.make(view, "Replace with your own action", | ||
Snackbar.LENGTH_LONG) | ||
.setAction("Action", null).show() | ||
} | ||
|
||
// Your code goes here | ||
Toast.makeText(this, "Can you see me?", | ||
Toast.LENGTH_SHORT).show() | ||
|
||
Log.i("info", "Done creating the app") | ||
|
||
} | ||
|
||
override fun onCreateOptionsMenu(menu: Menu): Boolean { | ||
// Inflate the menu; this adds items to the action bar if it is present. | ||
menuInflater.inflate(R.menu.menu_hello_world, menu) | ||
return true | ||
} | ||
|
||
override fun onOptionsItemSelected(item: MenuItem): Boolean { | ||
// Handle action bar item clicks here. The action bar will | ||
// automatically handle clicks on the Home/Up button, so long | ||
// as you specify a parent activity in AndroidManifest.xml. | ||
return when (item.itemId) { | ||
R.id.action_settings -> true | ||
else -> super.onOptionsItemSelected(item) | ||
} | ||
} | ||
|
||
fun topClick(v: View) { | ||
Toast.makeText(this, "Top button clicked", | ||
Toast.LENGTH_SHORT).show() | ||
|
||
Log.i("info", "The user clicked the top button") | ||
} | ||
|
||
fun bottomClick(v: View) { | ||
Toast.makeText(this, "Bottom button clicked", | ||
Toast.LENGTH_SHORT).show() | ||
|
||
Log.i("info", "The user clicked the bottom button") | ||
} | ||
|
||
} | ||
|
43 changes: 43 additions & 0 deletions
43
.../LRC Book Android Programming With Kotlin For Beginners/Chapter02/content_hello_world.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
app:layout_behavior="@string/appbar_scrolling_view_behavior" | ||
tools:context=".HelloWorldActivity" | ||
tools:showIn="@layout/activity_hello_world"> | ||
|
||
<TextView | ||
android:id="@+id/textView" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Hello World!" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintRight_toRightOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<Button | ||
android:id="@+id/buttonTop" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="27dp" | ||
android:onClick="topClick" | ||
android:text="Button" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
|
||
<Button | ||
android:id="@+id/buttonBottom" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="25dp" | ||
android:onClick="bottomClick" | ||
android:text="Button" | ||
app:layout_constraintStart_toStartOf="@+id/buttonTop" | ||
app:layout_constraintTop_toBottomOf="@+id/buttonTop" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
43 changes: 43 additions & 0 deletions
43
... Studio/LRC Book Android Programming With Kotlin For Beginners/Chapter02/content_main.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
app:layout_behavior="@string/appbar_scrolling_view_behavior" | ||
tools:context=".HelloWorldActivity" | ||
tools:showIn="@layout/activity_hello_world"> | ||
|
||
<TextView | ||
android:id="@+id/textView" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Hello World!" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintRight_toRightOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<Button | ||
android:id="@+id/buttonTop" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="27dp" | ||
android:onClick="topClick" | ||
android:text="Button" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
|
||
<Button | ||
android:id="@+id/buttonBottom" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="25dp" | ||
android:onClick="bottomClick" | ||
android:text="Button" | ||
app:layout_constraintStart_toStartOf="@+id/buttonTop" | ||
app:layout_constraintTop_toBottomOf="@+id/buttonTop" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
1 change: 1 addition & 0 deletions
1
Android Studio/LRC Book Android Programming With Kotlin For Beginners/Chapter03/README.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
All the code in chapter 3 is auto-generated in Android Studio |
27 changes: 27 additions & 0 deletions
27
...id Programming With Kotlin For Beginners/Chapter04/LayoutExploration/java/MainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.gamecodeschool.exploringlayouts | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import android.view.View | ||
|
||
class MainActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.main_menu); | ||
} | ||
|
||
fun loadConstraintLayout(v: View) { | ||
setContentView(R.layout.activity_main) | ||
} | ||
|
||
fun loadTableLayout(v: View) { | ||
setContentView(R.layout.my_table_layout) | ||
} | ||
|
||
fun loadMenuLayout(v: View) { | ||
setContentView(R.layout.main_menu) | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.