From 212914e0b420d15e600e682dc30af1aa3edfafa1 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 18 Sep 2016 11:06:43 +0200 Subject: [PATCH] count the long pressed items cnt --- .../simplemobiletools/calendar/activities/DayActivity.kt | 1 - .../simplemobiletools/calendar/fragments/DayFragment.kt | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/DayActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/DayActivity.kt index 97a6a0a32..07309849e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/DayActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/DayActivity.kt @@ -19,7 +19,6 @@ class DayActivity : SimpleActivity(), NavigationListener { private val PREFILLED_DAYS = 61 private var mDayCode: String? = null private var mEvents: MutableList? = null - private var mSelectedItemsCnt: Int = 0 private var mSnackbar: Snackbar? = null private var mToBeDeleted: MutableList? = null private var mPagerDays: MutableList? = null diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/DayFragment.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/DayFragment.kt index 13bec2a2f..1c92bf912 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/DayFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/DayFragment.kt @@ -26,6 +26,7 @@ class DayFragment : Fragment(), DBHelper.DBOperationsListener, AdapterView.OnIte private val EDIT_EVENT = 1 private var mTextColor: Int = 0 + private var mSelectedItemsCnt: Int = 0 private var mDayCode: String = "" private var mEvents: MutableList? = null private var mListener: NavigationListener? = null @@ -159,18 +160,18 @@ class DayFragment : Fragment(), DBHelper.DBOperationsListener, AdapterView.OnIte } override fun onDestroyActionMode(mode: ActionMode) { - //mSelectedItemsCnt = 0 + mSelectedItemsCnt = 0 } override fun onItemCheckedStateChanged(mode: ActionMode, position: Int, id: Long, checked: Boolean) { - /*if (checked) { + if (checked) { mSelectedItemsCnt++ } else { mSelectedItemsCnt-- } mode.title = mSelectedItemsCnt.toString() - mode.invalidate()*/ + mode.invalidate() } override fun onItemClick(parent: AdapterView<*>, view: View, position: Int, id: Long) {