Example #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;
 }
Example #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());
      }
    }
  }
Example #3
0
 public void setLoadmoreEnable(boolean enable) {
   if (swipeLayout != null) swipeLayout.setPullLoadEnable(enable);
 }
Example #4
0
 public void setRefreshEnable(boolean enable) {
   if (swipeLayout != null) swipeLayout.setPullRefreshEnable(enable);
 }
Example #5
0
 public void finishPullLoad() {
   if (swipeLayout != null) swipeLayout.finishPullLoad();
 }
Example #6
0
 public void finishPullRefresh() {
   if (swipeLayout != null) swipeLayout.finishPullRefresh();
 }
Example #7
0
 public void setOnLoadingListener(WXSwipeLayout.WXOnLoadingListener onLoadingListener) {
   if (swipeLayout != null) swipeLayout.setOnLoadingListener(onLoadingListener);
 }
Example #8
0
 public void setOnRefreshListener(WXSwipeLayout.WXOnRefreshListener onRefreshListener) {
   if (swipeLayout != null) swipeLayout.setOnRefreshListener(onRefreshListener);
 }