aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/views/Keywords.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-08-06 00:49:58 -0700
committerAllan Wang <me@allanwang.ca>2019-08-06 00:49:58 -0700
commit55bf3e4b5b4af5baa3c230ca82f74988608971a3 (patch)
tree3db856e037b70257aaef19e34db6b0856bda6412 /app/src/main/kotlin/com/pitchedapps/frost/views/Keywords.kt
parent99953f087f2c363dad05ae3f86b5bcba22484e43 (diff)
downloadfrost-55bf3e4b5b4af5baa3c230ca82f74988608971a3.tar.gz
frost-55bf3e4b5b4af5baa3c230ca82f74988608971a3.tar.bz2
frost-55bf3e4b5b4af5baa3c230ca82f74988608971a3.zip
Format kotlin
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/views/Keywords.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/views/Keywords.kt13
1 files changed, 10 insertions, 3 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/Keywords.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/Keywords.kt
index e63fcc21..02c60288 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/views/Keywords.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/views/Keywords.kt
@@ -58,7 +58,8 @@ class Keywords @JvmOverloads constructor(
editText.tint(Prefs.textColor)
addIcon.setImageDrawable(GoogleMaterial.Icon.gmd_add.keywordDrawable(context))
addIcon.setOnClickListener {
- if (editText.text.isNullOrEmpty()) editText.error = context.string(R.string.empty_keyword)
+ if (editText.text.isNullOrEmpty()) editText.error =
+ context.string(R.string.empty_keyword)
else {
adapter.add(0, KeywordItem(editText.text.toString()))
editText.text?.clear()
@@ -71,7 +72,12 @@ class Keywords @JvmOverloads constructor(
override fun onBind(viewHolder: RecyclerView.ViewHolder): View? =
(viewHolder as? KeywordItem.ViewHolder)?.delete
- override fun onClick(v: View, position: Int, fastAdapter: FastAdapter<KeywordItem>, item: KeywordItem) {
+ override fun onClick(
+ v: View,
+ position: Int,
+ fastAdapter: FastAdapter<KeywordItem>,
+ item: KeywordItem
+ ) {
adapter.remove(position)
}
})
@@ -82,7 +88,8 @@ class Keywords @JvmOverloads constructor(
}
}
-private fun IIcon.keywordDrawable(context: Context): Drawable = toDrawable(context, 20, Prefs.textColor)
+private fun IIcon.keywordDrawable(context: Context): Drawable =
+ toDrawable(context, 20, Prefs.textColor)
class KeywordItem(val keyword: String) : AbstractItem<KeywordItem, KeywordItem.ViewHolder>() {