Skip to content

Instantly share code, notes, and snippets.

View leesc22's full-sized avatar
🏠
Working from home

leesc22

🏠
Working from home
View GitHub Profile
@leesc22
leesc22 / activity_business_card.xml
Last active May 11, 2018 06:16
Udacity Android Basics UI Practice Set
<?xml version="1.0" encoding="utf-8"?>
<!-- Business Card -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".BusinessCardActivity">
<ImageView
android:id="@+id/business_image_view"
@leesc22
leesc22 / MainActivity.kt
Created June 8, 2018 09:17
Android for Beginners : Cookies Kotlin Code
package com.example.android.cookies
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.ImageView
import android.widget.TextView
class MainActivity : AppCompatActivity() {
@leesc22
leesc22 / Book.java
Created June 19, 2018 01:26
Comparison between Java class and Kotlin class
/* Java */
public class Book {
private String title;
private Long isbn;
public Book(String title, Long isbn) {
this.title = title;
this.isbn = isbn;
}
public String getTitle() {
return title;
@leesc22
leesc22 / ReportCard.kt
Last active June 21, 2018 16:10
Android for Beginners : ReportCard Kotlin Class
class ReportCard constructor(var name: String) {
var englishGrade: Char? = null
var mathGrade: String? = null
var historyGrade: Int? = null
var biologyGrade: Double? = null
constructor(name: String, englishGrade: Char?, mathGrade: String?, historyGrade: Int?, biologyGrade: Double?) : this(name) {
this.englishGrade = englishGrade
this.mathGrade = mathGrade
this.historyGrade = historyGrade
@leesc22
leesc22 / MainActivity.kt
Created June 26, 2018 00:40
MediaPlayer class in Android
package com.example.android.musicplayer
import android.media.MediaPlayer
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.widget.Toast
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : AppCompatActivity() {
@leesc22
leesc22 / MainActivity.kt
Created June 29, 2018 01:11
Android Activity Lifecycle
package com.example.android.lifecycle
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
// When the Activity first time loads the events called are:
// onCreate(), onStart(), onResume()
// When click on home button, the Activity goes to the background
@leesc22
leesc22 / MainActivity.kt
Created July 5, 2018 06:21
Android TextToSpeech in Kotlin
package com.example.android.texttospeech
import android.os.Build
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.speech.tts.TextToSpeech
import android.util.Log
import kotlinx.android.synthetic.main.activity_main.*
import java.util.*
@leesc22
leesc22 / design_checklist.md
Created August 21, 2018 02:34
Design Checklist