Skip to content

InfinitumListFragment

tylertreat edited this page Dec 31, 2012 · 2 revisions

InfinitumListFragment is an extension of Android's ListFragment which takes care of framework initialization, provides support for dependency injection, and exposes an InfinitumContext.

When building a ListFragment that relies on Infinitum, it's typically good practice to extend InfinitumListFragment rather than manually configuring the framework through the ContextFactory. InfinitumListFragment also allows you to perform bean autowiring within the ListFragment. Currently, it does not support layout, resource, or view injection, nor does it support event binding. However, these features are planned for a future release.

Using an InfinitumListFragment requires the Android Support Library for platforms below Android 3.0.

InfinitumListFragment Example

public class MyListFragment extends InfinitumListFragment {

    @Autowired
    private MyBean mMyBean;

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        populateList();
        InfinitumContext context = getInfinitumContext();
        mMyBean.doStuff(context);
    }

    // ...

}

Clone this wiki locally