You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A component to help lazy load any view component (using layout resource ID). It inflate the layout when it is shown in the viewport seen by user
1
+
# Android Lazy Load Component
2
+
A component view to help lazy load any view component (using layout resource ID). It inflate the layout when it is shown in the viewport seen by user. Thus, it helps to reduce layout startup time by inflating layout view lazyily.
3
+
4
+
Disclaimer: For better visual purpose, this demo uses 1 second of delay and color to help you to understand how this lazy load component works
3. Include LazyLoadComponent in your XML layout (best recommended to use in `ScrollView`)
26
+
```xml
27
+
<dev.wendyyanto.library.LazyLoadComponent
28
+
android:layout_width="match_parent"
29
+
android:layout_height="10dp" />
30
+
```
31
+
4. Add the required attribute at LazyLoadComponent:
32
+
-`app:layout_id`: The layout that is intended to be loaded lazily at runtime
33
+
-`app:parent_layout_id`: The root layout's ID (it is used for LazyLoadComponent to decide when to load at runtime if only it's already on the viewport or beyond)
0 commit comments