From a209c1e086efd386b4f0d20de7986e5dfcd13b43 Mon Sep 17 00:00:00 2001 From: Volodymyr Buberenko Date: Thu, 2 Apr 2020 08:15:24 +0300 Subject: [PATCH] Add hasFixed size to RecyclerViews (#297) --- .../chucker/internal/ui/throwable/ThrowableListFragment.kt | 1 + .../chucker/internal/ui/transaction/TransactionListFragment.kt | 1 + .../internal/ui/transaction/TransactionPayloadFragment.kt | 1 + 3 files changed, 3 insertions(+) diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/throwable/ThrowableListFragment.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/throwable/ThrowableListFragment.kt index 41d59eb13..6d39be006 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/throwable/ThrowableListFragment.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/throwable/ThrowableListFragment.kt @@ -36,6 +36,7 @@ internal class ThrowableListFragment : Fragment(), ThrowableAdapter.ThrowableCli with(errorsBinding) { tutorialLink.movementMethod = LinkMovementMethod.getInstance() errorsRecyclerView.apply { + setHasFixedSize(true) addItemDecoration(DividerItemDecoration(context, DividerItemDecoration.VERTICAL)) adapter = errorsAdapter } diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionListFragment.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionListFragment.kt index a19448a46..dc918f024 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionListFragment.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionListFragment.kt @@ -44,6 +44,7 @@ internal class TransactionListFragment : with(transactionsBinding) { tutorialLink.movementMethod = LinkMovementMethod.getInstance() transactionsRecyclerView.apply { + setHasFixedSize(true) addItemDecoration(DividerItemDecoration(requireContext(), DividerItemDecoration.VERTICAL)) adapter = transactionsAdapter } diff --git a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadFragment.kt b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadFragment.kt index fd714c1b2..66f28140c 100644 --- a/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadFragment.kt +++ b/library/src/main/java/com/chuckerteam/chucker/internal/ui/transaction/TransactionPayloadFragment.kt @@ -79,6 +79,7 @@ internal class TransactionPayloadFragment : showProgress() val result = processPayload(type, transaction) payloadBinding.responseRecyclerView.adapter = TransactionBodyAdapter(result) + payloadBinding.responseRecyclerView.setHasFixedSize(true) hideProgress() } }