Ejemplo n.º 1
0
 /** Init Swipelayout */
 private WXSwipeLayout createBounceView(Context context) {
   swipeLayout = new WXSwipeLayout(context);
   swipeLayout.setLayoutParams(
       new FrameLayout.LayoutParams(
           FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
   innerView = setInnerView(context);
   if (innerView == null) return null;
   swipeLayout.addView(
       innerView,
       new FrameLayout.LayoutParams(
           FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
   addView(swipeLayout, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
   return swipeLayout;
 }
Ejemplo n.º 2
0
  /** @param loading should be {@link WXRefreshView} */
  public void setFooterView(WXComponent loading) {
    setLoadmoreEnable(true);
    if (swipeLayout != null) {
      if (swipeLayout.getFooterView() != null) {
        swipeLayout.setLoadingHeight((int) loading.getDomObject().getLayoutHeight());

        String colorStr =
            (String) loading.getDomObject().getStyles().get(Constants.Name.BACKGROUND_COLOR);
        String bgColor = WXUtils.getString(colorStr, null);

        if (bgColor != null) {
          if (!TextUtils.isEmpty(bgColor)) {
            int colorInt = WXResourceUtils.getColor(bgColor);
            if (!(colorInt == Color.TRANSPARENT)) {
              swipeLayout.setLoadingBgColor(colorInt);
            }
          }
        }
        swipeLayout.getFooterView().setRefreshView(loading.getHostView());
      }
    }
  }
Ejemplo n.º 3
0
 public void setLoadmoreEnable(boolean enable) {
   if (swipeLayout != null) swipeLayout.setPullLoadEnable(enable);
 }
Ejemplo n.º 4
0
 public void setRefreshEnable(boolean enable) {
   if (swipeLayout != null) swipeLayout.setPullRefreshEnable(enable);
 }
Ejemplo n.º 5
0
 public void finishPullLoad() {
   if (swipeLayout != null) swipeLayout.finishPullLoad();
 }
Ejemplo n.º 6
0
 public void finishPullRefresh() {
   if (swipeLayout != null) swipeLayout.finishPullRefresh();
 }
Ejemplo n.º 7
0
 public void setOnLoadingListener(WXSwipeLayout.WXOnLoadingListener onLoadingListener) {
   if (swipeLayout != null) swipeLayout.setOnLoadingListener(onLoadingListener);
 }
Ejemplo n.º 8
0
 public void setOnRefreshListener(WXSwipeLayout.WXOnRefreshListener onRefreshListener) {
   if (swipeLayout != null) swipeLayout.setOnRefreshListener(onRefreshListener);
 }