Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
* [android] add pagingEnabled ="true" attribute of list component
Browse files Browse the repository at this point in the history
  • Loading branch information
zshshr committed Aug 3, 2018
1 parent 7dd54bb commit 9fc2cc6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ public interface Name {
String INCLUDE_FONT_PADDING = "includeFontPadding";
String ENABLE_COPY = "enableCopy";

String PAGE_ENABLED = "pagingEnabled";



interface Recycler{
String LIST_DATA = "listData";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.alibaba.fastjson.JSON;

import android.content.Context;
import android.support.v7.widget.PagerSnapHelper;
import android.text.TextUtils;
import com.taobao.weex.WXSDKInstance;
import com.taobao.weex.annotation.Component;
Expand Down Expand Up @@ -81,6 +82,15 @@ protected BounceRecyclerView generateListView(Context context, int orientation)
bounceRecyclerView.getSwipeLayout().setNestedScrollingEnabled(true);
}
}

/**
* enable pagingEnabled attr
*/
if(WXUtils.getBoolean(getAttrs().get(Constants.Name.PAGE_ENABLED),false)){
PagerSnapHelper snapHelper = new PagerSnapHelper();
snapHelper.attachToRecyclerView(bounceRecyclerView.getInnerView());
}

return bounceRecyclerView;
}

Expand Down

0 comments on commit 9fc2cc6

Please sign in to comment.