Search in sources :

Example 1 with Scrollable

use of com.taobao.weex.ui.component.Scrollable in project weex-example by KalicyZhou.

the class WXStickyHelper method unbindStickStyle.

public void unbindStickStyle(WXComponent component, Map<String, HashMap<String, WXComponent>> mStickyMap) {
    Scrollable scroller = component.getParentScroller();
    if (scroller == null) {
        return;
    }
    HashMap<String, WXComponent> stickyMap = mStickyMap.get(scroller.getRef());
    if (stickyMap == null) {
        return;
    }
    stickyMap.remove(component.getRef());
}
Also used : WXComponent(com.taobao.weex.ui.component.WXComponent) Scrollable(com.taobao.weex.ui.component.Scrollable)

Example 2 with Scrollable

use of com.taobao.weex.ui.component.Scrollable in project weex-example by KalicyZhou.

the class WXStickyHelper method bindStickStyle.

public void bindStickStyle(WXComponent component, Map<String, HashMap<String, WXComponent>> mStickyMap) {
    Scrollable scroller = component.getParentScroller();
    if (scroller == null) {
        return;
    }
    HashMap<String, WXComponent> stickyMap = mStickyMap.get(scroller.getRef());
    if (stickyMap == null) {
        stickyMap = new HashMap<>();
    }
    if (stickyMap.containsKey(component.getRef())) {
        return;
    }
    stickyMap.put(component.getRef(), component);
    mStickyMap.put(scroller.getRef(), stickyMap);
}
Also used : WXComponent(com.taobao.weex.ui.component.WXComponent) Scrollable(com.taobao.weex.ui.component.Scrollable)

Example 3 with Scrollable

use of com.taobao.weex.ui.component.Scrollable in project weex-example by KalicyZhou.

the class WXRenderStatement method scrollTo.

/**
   * @see com.taobao.weex.dom.WXDomStatement#scrollToDom(String, JSONObject)
   */
void scrollTo(String ref, Map<String, Object> options) {
    WXComponent component = mRegistry.get(ref);
    if (component == null) {
        return;
    }
    Scrollable scroller = component.getParentScroller();
    if (scroller == null) {
        return;
    }
    scroller.scrollTo(component, options);
}
Also used : WXComponent(com.taobao.weex.ui.component.WXComponent) Scrollable(com.taobao.weex.ui.component.Scrollable)

Aggregations

Scrollable (com.taobao.weex.ui.component.Scrollable)3 WXComponent (com.taobao.weex.ui.component.WXComponent)3