mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
HabitCardListView: Prevent duplicate inset decorations
This commit is contained in:
@@ -60,6 +60,7 @@ class HabitCardListView(
|
||||
) : RecyclerView(context, null, R.attr.scrollableRecyclerViewStyle) {
|
||||
|
||||
var checkmarkCount: Int = 0
|
||||
private var insetDecorationsAdded: Boolean = false
|
||||
|
||||
var dataOffset: Int = 0
|
||||
set(value) {
|
||||
@@ -84,6 +85,8 @@ class HabitCardListView(
|
||||
|
||||
private fun applyBottomInset() {
|
||||
ViewCompat.setOnApplyWindowInsetsListener(this) { _, insets ->
|
||||
if (insetDecorationsAdded) return@setOnApplyWindowInsetsListener insets
|
||||
insetDecorationsAdded = true
|
||||
val systemBarsInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||
addItemDecoration(object : ItemDecoration() {
|
||||
override fun getItemOffsets(
|
||||
|
||||
Reference in New Issue
Block a user