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