For #357 - Dont set the checkbox if it already contains the right value
This commit is contained in:
parent
0cc44d1ee2
commit
a6e38165cb
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue
Block a user