Manga in Kotlin. Expect some errors yet

This commit is contained in:
len
2016-03-13 22:06:32 +01:00
parent a87c65872c
commit f49577bc77
36 changed files with 1928 additions and 2196 deletions
@@ -66,14 +66,14 @@ open class BaseActivity : AppCompatActivity() {
}
fun snack(text: String?, duration: Int = Snackbar.LENGTH_LONG) {
val snack = Snackbar.make(findViewById(android.R.id.content), text ?: getString(R.string.unknown_error), duration)
val snack = Snackbar.make(findViewById(android.R.id.content)!!, text ?: getString(R.string.unknown_error), duration)
val textView = snack.view.findViewById(android.support.design.R.id.snackbar_text) as TextView
textView.setTextColor(Color.WHITE)
snack.show()
}
fun snack(text: String?, actionRes: Int, actionFunc: () -> Unit,
duration: Int = Snackbar.LENGTH_LONG, view: View = findViewById(android.R.id.content)) {
duration: Int = Snackbar.LENGTH_LONG, view: View = findViewById(android.R.id.content)!!) {
val snack = Snackbar.make(view, text ?: getString(R.string.unknown_error), duration)
.setAction(actionRes, { actionFunc() })