-
Notifications
You must be signed in to change notification settings - Fork 266
Lazy loading
JingYeoh edited this page Dec 18, 2017
·
5 revisions
May be you found that
ViewPager
usesPreloading
when you are usingViewPager+Fragment
,But sometimes we don't need load before theFragment
is visible,so this library provides Lazy Loading.
First: Add @LazyLoad in the Fragment
need to uses lazy loading
.This annotation can be extended,so if you don't want use lazy loading
you can set this annotation's value false.
Second: Add a public method onLazyLoadViewCreated
with one parameter Bundle
.
Note: this method must be public and the name must be onLazyLoadViewCreated
and have one parameter Bundle
.
@Lazyload(true)
@Puppet
public class ContainerFragment extend Fragment{
public void onLazyLoadViewCreated(Bundle savedInstanceState) {
//do something in here
}
}
- Installation
- Using start
- Fragment usage
- Custom fragment tag
- Lazy loading
- Transition animations
- Intercept onBackPressed
- startFragmentForResult
- Swipe edge to exit
- How to use in library module