Skip to content

Commit 62d613e

Browse files
committed
Add logic to check if lazyloadcomponent has been shown to UI once rendered
1 parent 9d071cd commit 62d613e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/src/main/java/dev/wendyyanto/library/LazyLoadComponent.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ class LazyLoadComponent @JvmOverloads constructor(
101101
parentView = rootView.findViewById(parentResId)
102102
screenHeight = parentView.measuredHeight
103103
viewTreeObserver.removeOnGlobalLayoutListener(this)
104+
if (!isViewShown()) return
105+
loadComponent()
104106
}
105107
})
106108
}

0 commit comments

Comments
 (0)