combine post calls in FilterBottomSheet

This commit is contained in:
Jays2Kings 2021-04-19 01:16:21 -04:00
parent 17809d0493
commit 85596ea61d

View File

@ -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() sheetBehavior?.hide()
binding.expandCategories.setOnClickListener { binding.expandCategories.setOnClickListener {
onGroupClicked(ACTION_EXPAND_COLLAPSE_ALL) 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 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() createTags()