1
0
Fork 0

For #357 - Dont set the checkbox if it already contains the right value

master
Jeff Boek 2019-02-13 15:21:29 -08:00
parent 0cc44d1ee2
commit a6e38165cb
2 changed files with 11 additions and 1 deletions

View File

@ -109,7 +109,13 @@ private class HistoryAdapter(
if (mode is HistoryState.Mode.Editing) {
checkbox.setOnCheckedChangeListener(null)
checkbox.isChecked = mode.selectedItems.contains(item)
// Don't set the checkbox if it already contains the right value.
// This prevent us from cutting off the animation
val shouldCheck = mode.selectedItems.contains(item)
if (checkbox.isChecked != shouldCheck) {
checkbox.isChecked = mode.selectedItems.contains(item)
}
checkbox.setOnCheckedChangeListener(checkListener)
}
}

View File

@ -1,4 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<androidx.recyclerview.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/history_list"