This file contains hidden or 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
struct NoteModel: Equatable { | |
let userName: String | |
let latitude: Double | |
let longitude: Double | |
let text: String | |
let createDateTime: String | |
// compare whether two notes are same | |
static func == (lhs: NoteModel, rhs: NoteModel) -> Bool { | |
return lhs.createDateTime == rhs.createDateTime && |
This file contains hidden or 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
// Struct | |
struct NoteModel { | |
let userName: String | |
let latitude: Double | |
let longitude: Double | |
let text: String | |
let createDateTime: String | |
} |
This file contains hidden or 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
public class PlayerControl : MonoBehaviour { | |
void Update() { | |
Debug.Log("Udpate(): time: "+Time.time); | |
Debug.Log("Udpate(): deltatime: "+Time.deltaTime); | |
} | |
private void FixedUpdate() { | |
Debug.Log("FixedUpdate(): time: "+Time.time); | |
Debug.Log("FixedUpdate(): deltatime: "+Time.deltaTime); |
This file contains hidden or 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
using UnityEngine; | |
using UnityEngine.Audio; | |
using System; | |
[System.Serializable] | |
public class Sound { | |
public string name; | |
public AudioClip clip; |
This file contains hidden or 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
<?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" | |
tools:context=".MainActivity"> | |
<TextView | |
android:layout_width="wrap_content" |
This file contains hidden or 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
package com.flyingbits.kotlinlearn | |
import android.os.Bundle | |
import android.util.Log | |
import android.view.View | |
import android.widget.Button | |
import android.widget.TextView | |
import androidx.appcompat.app.AppCompatActivity | |
import androidx.fragment.app.FragmentManager | |
import androidx.fragment.app.FragmentTransaction |
This file contains hidden or 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
package com.flyingbits.kotlinlearn | |
import androidx.lifecycle.MutableLiveData | |
import androidx.lifecycle.ViewModel | |
class MyViewModel: ViewModel() { | |
private var num: MutableLiveData<Int> = MutableLiveData(0) | |
public fun getNum(): MutableLiveData<Int> { |
This file contains hidden or 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
def lifecycle_version = "2.2.0" | |
// ViewModel | |
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" | |
implementation 'androidx.lifecycle:lifecycle-extensions:$lifecycle_version' | |
// ViewModel | |
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" | |
// LiveData | |
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version" |
This file contains hidden or 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
class MyFragment : Fragment() { | |
private val TAG: String = "Running 2Order" | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
} | |
override fun onCreateView( | |
inflater: LayoutInflater, container: ViewGroup?, |
This file contains hidden or 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
class MainActivity : AppCompatActivity() { | |
private val TAG: String = "Running Order" | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
Log.d(TAG, "onCreate in called") | |
} |