replace checklist item editing with renaming

This commit is contained in:
tibbi 2018-12-26 23:17:58 +01:00
parent 451c7bb19f
commit aedf7b7d79
2 changed files with 5 additions and 5 deletions

View File

@ -36,7 +36,7 @@ class ChecklistAdapter(activity: BaseSimpleActivity, var items: ArrayList<Checkl
} }
when (id) { when (id) {
R.id.cab_edit -> editNote() R.id.cab_rename -> renameChecklistItem()
R.id.cab_delete -> deleteSelection() R.id.cab_delete -> deleteSelection()
} }
} }
@ -55,7 +55,7 @@ class ChecklistAdapter(activity: BaseSimpleActivity, var items: ArrayList<Checkl
return return
} }
menu.findItem(R.id.cab_edit).isVisible = isOneItemSelected() menu.findItem(R.id.cab_rename).isVisible = isOneItemSelected()
} }
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(R.layout.item_checklist, parent) override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(R.layout.item_checklist, parent)
@ -76,7 +76,7 @@ class ChecklistAdapter(activity: BaseSimpleActivity, var items: ArrayList<Checkl
checkDrawable = res.getColoredDrawableWithColor(R.drawable.ic_check_big, res.getColor(R.color.md_green_700)) checkDrawable = res.getColoredDrawableWithColor(R.drawable.ic_check_big, res.getColor(R.color.md_green_700))
} }
private fun editNote() { private fun renameChecklistItem() {
} }

View File

@ -2,8 +2,8 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" <menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<item <item
android:id="@+id/cab_edit" android:id="@+id/cab_rename"
android:icon="@drawable/ic_edit" android:icon="@drawable/ic_rename_new"
android:title="@string/rename" android:title="@string/rename"
app:showAsAction="ifRoom"/> app:showAsAction="ifRoom"/>
<item <item