From a6e38165cb615686c9a4843263ff9e0701727a8f Mon Sep 17 00:00:00 2001 From: Jeff Boek Date: Wed, 13 Feb 2019 15:21:29 -0800 Subject: [PATCH] For #357 - Dont set the checkbox if it already contains the right value --- .../org/mozilla/fenix/library/history/HistoryUIView.kt | 8 +++++++- app/src/main/res/layout/component_history.xml | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/mozilla/fenix/library/history/HistoryUIView.kt b/app/src/main/java/org/mozilla/fenix/library/history/HistoryUIView.kt index dcf4fbfeb..0f818200a 100644 --- a/app/src/main/java/org/mozilla/fenix/library/history/HistoryUIView.kt +++ b/app/src/main/java/org/mozilla/fenix/library/history/HistoryUIView.kt @@ -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) } } diff --git a/app/src/main/res/layout/component_history.xml b/app/src/main/res/layout/component_history.xml index fb88d5452..dc970adc2 100644 --- a/app/src/main/res/layout/component_history.xml +++ b/app/src/main/res/layout/component_history.xml @@ -1,4 +1,8 @@ + +