Search in sources :

Example 1 with BMLoadingRefresh

use of com.eros.framework.extend.hook.ui.view.refresh.bmrefresh.BMLoadingRefresh in project WeexErosFramework by bmfe.

the class HookWxScroller method setBMRefresh.

@WXComponentProp(name = HookConstants.NAME.SHOW_REFRESH)
public void setBMRefresh(String showRefresh) {
    boolean customerRefresh = WXUtils.getBoolean(showRefresh, false);
    if (customerRefresh && mBMRefresh == null) {
        mBMRefresh = new BMLoadingRefresh(getContext(), this);
        ((HookBounceScrollerView) this.getHostView()).setOnRefreshListener(mBMRefresh);
        Runnable runnable = WXThread.secure(new Runnable() {

            public void run() {
                ((HookBounceScrollerView) getHostView()).setCustomHeaderView(mBMRefresh);
            }
        });
        this.handler.postDelayed(runnable, 100L);
    }
}
Also used : BMLoadingRefresh(com.eros.framework.extend.hook.ui.view.refresh.bmrefresh.BMLoadingRefresh) HookBounceScrollerView(com.eros.framework.extend.hook.ui.view.HookBounceScrollerView) WXComponentProp(com.taobao.weex.ui.component.WXComponentProp)

Example 2 with BMLoadingRefresh

use of com.eros.framework.extend.hook.ui.view.refresh.bmrefresh.BMLoadingRefresh in project WeexErosFramework by bmfe.

the class HookListComponent method addCustomRefresh.

public void addCustomRefresh() {
    if (!mAddCustomRefresh || mBMRefresh != null)
        return;
    mBMRefresh = new BMLoadingRefresh(getContext(), this);
    getHostView().setOnRefreshListener(mBMRefresh);
    getHostView().postDelayed(new Runnable() {

        @Override
        public void run() {
            if (getHostView() instanceof HookBounceRecyclerView) {
                ((HookBounceRecyclerView) getHostView()).setCustomHeaderView(mBMRefresh);
            }
        }
    }, 100);
}
Also used : HookBounceRecyclerView(com.eros.framework.extend.hook.ui.view.HookBounceRecyclerView) BMLoadingRefresh(com.eros.framework.extend.hook.ui.view.refresh.bmrefresh.BMLoadingRefresh)

Aggregations

BMLoadingRefresh (com.eros.framework.extend.hook.ui.view.refresh.bmrefresh.BMLoadingRefresh)2 HookBounceRecyclerView (com.eros.framework.extend.hook.ui.view.HookBounceRecyclerView)1 HookBounceScrollerView (com.eros.framework.extend.hook.ui.view.HookBounceScrollerView)1 WXComponentProp (com.taobao.weex.ui.component.WXComponentProp)1