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
val map = mapOf("á" to "aa", "c" to "ts", "č" to "tch", "é" to "ai", "y" to "i", "ě" to "ye", "í" to "ee", "j" to "y", "ó" to "oo", "ř" to "rg", "š" to "sh", "ú" to "oo", "ů" to "oo", "ý" to "ee", "ž" to "zh") |
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
private var mAdapter: RecyclerAdapter<Transaction>? = null | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
mAdapter = RecyclerAdapter(R.layout.item_transaction) | |
} | |
fun updateTransactions() { | |
mAdapter!!.notifyDataSetChanged() | |
} |
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
private lateinit var mAdapter: RecyclerAdapter<Transaction> | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
mAdapter = RecyclerAdapter(R.layout.item_transaction) | |
} | |
fun updateTransactions() { | |
mAdapter.notifyDataSetChanged() | |
} |
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
private var mPhotoUrl: String? = null | |
fun uploadClicked() { | |
if (mPhotoUrl != null) { | |
uploadPhoto(mPhotoUrl!!) | |
} | |
} |
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
private var mPhotoUrl: String? = null | |
fun uploadClicked() { | |
mPhotoUrl?.let { uploadPhoto(it) } | |
} |
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
if (mUserName != null && mPhotoUrl != null) { | |
uploadPhoto(mUserName!!, mPhotoUrl!!) | |
} |
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
ifNotNull(mUserName, mPhotoUrl) { | |
userName, photoUrl -> | |
uploadPhoto(userName, photoUrl) | |
} |
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
fun <T1, T2> ifNotNull(value1: T1?, value2: T2?, bothNotNull: (T1, T2) -> (Unit)) { | |
if (value1 != null && value2 != null) { | |
bothNotNull(value1, value2) | |
} | |
} |
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
fun getUserName(): String { | |
if (mUserName != null) { | |
return mUserName!! | |
} else { | |
return "Anonymous" | |
} | |
} |
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
fun getUserName(): String { | |
return mUserName ?: "Anonymous" | |
} |
OlderNewer