Search in sources :

Example 1 with IRefreshViewCreator

use of me.dkzwm.widget.srl.IRefreshViewCreator in project SmoothRefreshLayout by dkzwm.

the class DemoApplication method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    LeakCanary.install(this);
    SmoothRefreshLayout.setDefaultCreator(new IRefreshViewCreator() {

        @Override
        public void createHeader(SmoothRefreshLayout layout) {
            ClassicHeader header = new ClassicHeader(layout.getContext());
            header.setLastUpdateTimeKey("header_last_update_time");
            layout.setHeaderView(header);
        }

        @Override
        public void createFooter(SmoothRefreshLayout layout) {
            ClassicFooter footer = new ClassicFooter(layout.getContext());
            footer.setLastUpdateTimeKey("footer_last_update_time");
            layout.setFooterView(footer);
        }
    });
}
Also used : ClassicHeader(me.dkzwm.widget.srl.extra.header.ClassicHeader) IRefreshViewCreator(me.dkzwm.widget.srl.IRefreshViewCreator) ClassicFooter(me.dkzwm.widget.srl.extra.footer.ClassicFooter) SmoothRefreshLayout(me.dkzwm.widget.srl.SmoothRefreshLayout)

Aggregations

IRefreshViewCreator (me.dkzwm.widget.srl.IRefreshViewCreator)1 SmoothRefreshLayout (me.dkzwm.widget.srl.SmoothRefreshLayout)1 ClassicFooter (me.dkzwm.widget.srl.extra.footer.ClassicFooter)1 ClassicHeader (me.dkzwm.widget.srl.extra.header.ClassicHeader)1