From 85596ea61d1fa87cb289791cb6572b4f1959a6b2 Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Mon, 19 Apr 2021 01:16:21 -0400 Subject: [PATCH] combine post calls in FilterBottomSheet --- .../ui/library/filter/FilterBottomSheet.kt | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/filter/FilterBottomSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/filter/FilterBottomSheet.kt index ff2af0cbb8..a10ce08259 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/filter/FilterBottomSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/filter/FilterBottomSheet.kt @@ -131,18 +131,6 @@ class FilterBottomSheet @JvmOverloads constructor(context: Context, attrs: Attri } ) - post { - if (binding.secondLayout.width + binding.firstLayout.width + 20.dpToPx < width) { - binding.secondLayout.removeView(binding.viewOptions) - binding.firstLayout.addView(binding.viewOptions) - binding.secondLayout.isVisible = false - } else if (binding.viewOptions.parent == binding.firstLayout) { - binding.firstLayout.removeView(binding.viewOptions) - binding.secondLayout.addView(binding.viewOptions) - binding.secondLayout.isVisible = true - } - } - sheetBehavior?.hide() binding.expandCategories.setOnClickListener { onGroupClicked(ACTION_EXPAND_COLLAPSE_ALL) @@ -169,6 +157,16 @@ class FilterBottomSheet @JvmOverloads constructor(context: Context, attrs: Attri } ) shadow.alpha = if (sheetBehavior.isHidden()) 0f else 1f + + if (binding.secondLayout.width + binding.firstLayout.width + 20.dpToPx < width) { + binding.secondLayout.removeView(binding.viewOptions) + binding.firstLayout.addView(binding.viewOptions) + binding.secondLayout.isVisible = false + } else if (binding.viewOptions.parent == binding.firstLayout) { + binding.firstLayout.removeView(binding.viewOptions) + binding.secondLayout.addView(binding.viewOptions) + binding.secondLayout.isVisible = true + } } createTags()