extends RecyclerView.ViewHolder {
14 |
15 | public TypeAbstractViewHolder(View itemView) {
16 | super(itemView);
17 | }
18 |
19 | public abstract void bindHolder(T entity);
20 | }
21 |
--------------------------------------------------------------------------------
/app/src/main/java/com/easyandroid/sectionadapter/listener/LoadMoreListener.java:
--------------------------------------------------------------------------------
1 | package com.easyandroid.sectionadapter.listener;
2 |
3 | import android.support.v7.widget.GridLayoutManager;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.view.View;
6 |
7 | /**
8 | * package: com.easyandroid.sectionadapter.listener.LoadMoreListener
9 | * author: gyc
10 | * description:继承Recyclerview的滚动事件,实现上拉加载
11 | * time: create at 2017/7/7 22:23
12 | */
13 |
14 | public abstract class LoadMoreListener extends RecyclerView.OnScrollListener {
15 |
16 | public boolean isLoading = false;//记录正在加载的状态,防止多次请求
17 | protected int lastItemPosition;
18 | private int topOffset = 0;//列表顶部容差值
19 | private int bottomOffset = 0;//列表底部容差值
20 |
21 | protected GridLayoutManager gridLayoutManager;
22 |
23 | public LoadMoreListener(GridLayoutManager gridLayoutManager) {
24 | this.gridLayoutManager = gridLayoutManager;
25 | }
26 |
27 | @Override
28 | public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
29 | super.onScrollStateChanged(recyclerView, newState);
30 | if (isFullAScreen(recyclerView)) {
31 | //查找最后一个可见的item的position
32 | lastItemPosition = gridLayoutManager.findLastVisibleItemPosition();
33 | if (newState == RecyclerView.SCROLL_STATE_IDLE && lastItemPosition + 1 ==
34 | gridLayoutManager.getItemCount()) {
35 | if (!isLoading) {
36 | onLoadMore();
37 | }
38 | }
39 | }
40 | }
41 |
42 | @Override
43 | public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
44 | super.onScrolled(recyclerView, dx, dy);
45 | }
46 |
47 | /**
48 | * 检查是否满一屏
49 | *
50 | * @param recyclerView
51 | * @return
52 | */
53 | public boolean isFullAScreen(RecyclerView recyclerView) {
54 | //获取item总个数,一般用mAdapter.getItemCount(),用mRecyclerView.getLayoutManager().getItemCount()也可以
55 | //获取当前可见的item view的个数,这个数字是不固定的,随着recycleview的滑动会改变,
56 | // 比如有的页面显示出了6个view,那这个数字就是6。此时滑一下,第一个view出去了一半,后边又加进来半个view,此时getChildCount()
57 | // 就是7。所以这里可见item view的个数,露出一半也算一个。
58 | int visiableItemCount = recyclerView.getChildCount();
59 | if (visiableItemCount > 0) {
60 | View lastChildView = recyclerView.getChildAt(visiableItemCount - 1);
61 | //获取第一个childView
62 | View firstChildView = recyclerView.getChildAt(0);
63 | int top = firstChildView.getTop();
64 | int bottom = lastChildView.getBottom();
65 | //recycleView显示itemView的有效区域的bottom坐标Y
66 | int bottomEdge = recyclerView.getHeight() - recyclerView.getPaddingBottom() + bottomOffset;
67 | //recycleView显示itemView的有效区域的top坐标Y
68 | int topEdge = recyclerView.getPaddingTop() + topOffset;
69 | //第一个view的顶部小于top边界值,说明第一个view已经部分或者完全移出了界面
70 | //最后一个view的底部小于bottom边界值,说明最后一个view已经完全显示在界面
71 | //若满足这两个条件,说明所有子view已经填充满了recycleView,recycleView可以"真正地"滑动
72 | if (bottom <= bottomEdge && top < topEdge) {
73 | //满屏的recyceView
74 | return true;
75 | }
76 | return false;
77 | } else {
78 | return false;
79 | }
80 | }
81 |
82 | public abstract void onLoadMore();
83 |
84 | public void setTopOffset(int topOffset) {
85 | this.topOffset = topOffset;
86 | }
87 |
88 | public void setBottomOffset(int bottomOffset) {
89 | this.bottomOffset = bottomOffset;
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/app/src/main/java/com/easyandroid/sectionadapter/listener/RecycleViewScrollHelper.java:
--------------------------------------------------------------------------------
1 | package com.easyandroid.sectionadapter.listener;
2 |
3 | import android.support.annotation.IntRange;
4 | import android.support.v7.widget.LinearLayoutManager;
5 | import android.support.v7.widget.RecyclerView;
6 | import android.view.View;
7 |
8 | /**
9 | * package: com.easyandroid.sectionadapter.listener.RecycleViewScrollHelper
10 | * author: gyc
11 | * description:RecyclerView滑动的各种情况的辅助类
12 | * time: create at 2017/7/7 23:13
13 | */
14 |
15 | public class RecycleViewScrollHelper extends RecyclerView.OnScrollListener{
16 |
17 | private RecyclerView mRvScroll = null;
18 | private OnScrollDirectionChangedListener mScrollDirectionChangedListener = null;
19 | //滑动位置变动的监听事件
20 | private OnScrollPositionChangedListener mScrollPositionChangedListener = null;
21 | //是否同时检测滑动到顶部及底部
22 | private boolean mIsCheckTopBottomTogether = false;
23 | //检测滑动顶部/底部的优先顺序,默认先检测滑动到底部
24 | private boolean mIsCheckTopFirstBottomAfter = false;
25 | //检测底部滑动时是否检测满屏状态
26 | private boolean mIsCheckBottomFullRecycle = false;
27 | //检测顶部滑动时是否检测满屏状态
28 | private boolean mIsCheckTopFullRecycle = false;
29 | //顶部满屏检测时允许的容差值
30 | private int mTopOffsetFaultTolerance = 0;
31 | //底部满屏检测时允许的容差值
32 | private int mBottomOffsetFaultTolerance = 0;
33 |
34 | private int mScrollDx = 0;
35 | private int mScrollDy = 0;
36 |
37 | /**
38 | * recycleView的滑动监听事件,用于检测是否滑动到顶部或者滑动到底部.
39 | *
40 | * @param listener {@link OnScrollPositionChangedListener}滑动位置变动监听事件
41 | */
42 | public RecycleViewScrollHelper(OnScrollPositionChangedListener listener) {
43 | mScrollPositionChangedListener = listener;
44 | }
45 |
46 | @Override
47 | public void onScrollStateChanged(RecyclerView recyclerView,
48 | int newState) {
49 | if (mScrollPositionChangedListener == null || recyclerView.getAdapter() == null || recyclerView.getChildCount() <= 0) {
50 | return;
51 | }
52 | RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager();
53 | if (layoutManager instanceof LinearLayoutManager) {
54 | LinearLayoutManager linearManager = (LinearLayoutManager) layoutManager;
55 | int lastItemPosition = linearManager.findLastVisibleItemPosition();
56 | int firstItemPosition = linearManager.findFirstVisibleItemPosition();
57 | RecyclerView.Adapter adapter = recyclerView.getAdapter();
58 | if (newState == RecyclerView.SCROLL_STATE_IDLE) {
59 | //判断顶部/底部检测的优先顺序
60 | if (!mIsCheckTopFirstBottomAfter) {
61 | //先检测底部
62 | if (this.checkIfScrollToBottom(recyclerView, lastItemPosition, adapter.getItemCount())) {
63 | //若检测滑动到底部时,判断是否需要同时检测滑动到顶部
64 | if (mIsCheckTopBottomTogether) {
65 | //检测是否滑动到顶部
66 | this.checkIfScrollToTop(recyclerView, firstItemPosition);
67 | //不管是否滑动到顶部,已经触发了滑动到底部,所以直接返回,否则会调用滑动到未知位置的
68 | return;
69 | } else {
70 | //若不需要同时检测,直接返回
71 | return;
72 | }
73 | } else if (this.checkIfScrollToTop(recyclerView, firstItemPosition)) {
74 | //当未检测滑动到底部时,再检测是否滑动到顶部
75 | return;
76 | }
77 | } else {
78 | //先检测是否滑动到顶部
79 | if (this.checkIfScrollToTop(recyclerView, firstItemPosition)) {
80 | if (mIsCheckTopBottomTogether) {
81 | //检测是否滑动到底部
82 | this.checkIfScrollToBottom(recyclerView, lastItemPosition, adapter.getItemCount());
83 | return;
84 | } else {
85 | //若不需要同时检测,直接返回
86 | return;
87 | }
88 | } else if (this.checkIfScrollToBottom(recyclerView, lastItemPosition, adapter.getItemCount())) {
89 | //当未检测滑动到底部时,再检测是否滑动到底部
90 | return;
91 | }
92 | }
93 | }
94 | }
95 | //其它任何情况
96 | mScrollPositionChangedListener.onScrollToUnknown(false, false);
97 | }
98 |
99 | /**
100 | * 检测是否滑动到了顶部item并回调事件
101 | *
102 | * @param recyclerView
103 | * @param firstItemPosition 第一个可见itemView的position
104 | * @return
105 | */
106 | private boolean checkIfScrollToTop(RecyclerView recyclerView, int firstItemPosition) {
107 | if (firstItemPosition == 0) {
108 | if (mIsCheckTopFullRecycle) {
109 | int childCount = recyclerView.getChildCount();
110 | View firstChild = recyclerView.getChildAt(0);
111 | View lastChild = recyclerView.getChildAt(childCount - 1);
112 | int top = firstChild.getTop();
113 | int bottom = lastChild.getBottom();
114 | //recycleView显示itemView的有效区域的top坐标Y
115 | int topEdge = recyclerView.getPaddingTop() - mTopOffsetFaultTolerance;
116 | //recycleView显示itemView的有效区域的bottom坐标Y
117 | int bottomEdge = recyclerView.getHeight() - recyclerView.getPaddingBottom() - mBottomOffsetFaultTolerance;
118 | //第一个view的顶部大于top边界值,说明第一个view已经完全显示在顶部
119 | //同时最后一个view的底部应该小于bottom边界值,说明最后一个view的底部已经超出显示范围,部分或者完全移出了界面
120 | if (top >= topEdge && bottom > bottomEdge) {
121 | mScrollPositionChangedListener.onScrollToTop();
122 | return true;
123 | } else {
124 | mScrollPositionChangedListener.onScrollToUnknown(true, false);
125 | }
126 | } else {
127 | mScrollPositionChangedListener.onScrollToTop();
128 | return true;
129 | }
130 | }
131 | return false;
132 | }
133 |
134 | /**
135 | * 检测是否滑动到底部item并回调事件
136 | *
137 | * @param recyclerView
138 | * @param lastItemPosition 最后一个可见itemView的position
139 | * @param itemCount adapter的itemCount
140 | * @return
141 | */
142 | private boolean checkIfScrollToBottom(RecyclerView recyclerView, int lastItemPosition, int itemCount) {
143 | if (lastItemPosition + 1 == itemCount) {
144 | //是否进行满屏的判断处理
145 | //未满屏的情况下将永远不会被回调滑动到低部或者顶部
146 | if (mIsCheckBottomFullRecycle) {
147 | int childCount = recyclerView.getChildCount();
148 | //获取最后一个childView
149 | View lastChildView = recyclerView.getChildAt(childCount - 1);
150 | //获取第一个childView
151 | View firstChildView = recyclerView.getChildAt(0);
152 | int top = firstChildView.getTop();
153 | int bottom = lastChildView.getBottom();
154 | //recycleView显示itemView的有效区域的bottom坐标Y
155 | int bottomEdge = recyclerView.getHeight() - recyclerView.getPaddingBottom() + mBottomOffsetFaultTolerance;
156 | //recycleView显示itemView的有效区域的top坐标Y
157 | int topEdge = recyclerView.getPaddingTop() + mTopOffsetFaultTolerance;
158 | //第一个view的顶部小于top边界值,说明第一个view已经部分或者完全移出了界面
159 | //最后一个view的底部小于bottom边界值,说明最后一个view已经完全显示在界面
160 | //若不处理这种情况,可能会存在recycleView高度足够高时,itemView数量很少无法填充一屏,但是滑动到最后一项时依然会发生回调
161 | //此时其实并不需要任何刷新操作的
162 | if (bottom <= bottomEdge && top < topEdge) {
163 | mScrollPositionChangedListener.onScrollToBottom();
164 | return true;
165 | } else {
166 | mScrollPositionChangedListener.onScrollToUnknown(false, true);
167 | }
168 | } else {
169 | mScrollPositionChangedListener.onScrollToBottom();
170 | return true;
171 | }
172 | }
173 | return false;
174 | }
175 |
176 | @Override
177 | public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
178 | if (mScrollDirectionChangedListener != null) {
179 | if (dx == 0 && dy == 0) {
180 | mScrollDirectionChangedListener.onScrollDirectionChanged(0, 0);
181 | } else if (dx == 0) {
182 | boolean isUp = dy > 0;
183 | boolean isBeenUp = mScrollDy > 0;
184 | if (isUp != isBeenUp) {
185 | mScrollDx = dx;
186 | mScrollDy = dy;
187 | mScrollDirectionChangedListener.onScrollDirectionChanged(dx, dy);
188 | }
189 | } else if (dy == 0) {
190 | boolean isLeft = dx > 0;
191 | boolean isBeenLeft = mScrollDx > 0;
192 | if (isLeft != isBeenLeft) {
193 | mScrollDx = dx;
194 | mScrollDy = dy;
195 | mScrollDirectionChangedListener.onScrollDirectionChanged(dx, dy);
196 | }
197 | }
198 | }
199 | }
200 |
201 | //重置数据
202 | private void reset() {
203 | mScrollDx = 0;
204 | mScrollDy = 0;
205 | }
206 |
207 | /**
208 | * 关联recycleView,当关联新的recycleView时,会自动移除上一个关联recycleView
209 | *
210 | * @param recyclerView
211 | */
212 | public void attachToRecycleView(RecyclerView recyclerView) {
213 | if (recyclerView != mRvScroll) {
214 | unAttachToRecycleView();
215 | mRvScroll = recyclerView;
216 | if (recyclerView != null) {
217 | recyclerView.addOnScrollListener(this);
218 | }
219 | }
220 | }
221 |
222 | /**
223 | * 移除与recycleView的绑定
224 | */
225 | public void unAttachToRecycleView() {
226 | if (mRvScroll != null) {
227 | mRvScroll.removeOnScrollListener(this);
228 | }
229 | this.reset();
230 | }
231 |
232 | /**
233 | * 设置滑动方向改变时的回调接口
234 | *
235 | * @param listener
236 | */
237 | public void setScrollDirectionChangedListener(OnScrollDirectionChangedListener listener) {
238 | mScrollDirectionChangedListener = listener;
239 | }
240 |
241 | /**
242 | * 设置顶部允许偏移的容差值,此值仅在允许检测满屏时有效,当{@link #setCheckIfItemViewFullRecycleViewForTop(boolean)}设置为true 或者{@link #setCheckIfItemViewFullRecycleViewForBottom(boolean)}设置为true 时有效.
243 | * 在检测底部滑动时,对顶部的检测会添加此容差值(更容易判断当前第一项childView已超出recycleView的显示范围),用于协助判断是否滑动到底部.
244 | * 在检测顶部滑动时,对顶部的检测会添加此容差值(更容易判断为滑动到了顶部)
245 | *
246 | * @param offset 容差值,此值必须为0或正数
247 | */
248 | public void setTopOffsetFaultTolerance(@IntRange(from = 0) int offset) {
249 | mTopOffsetFaultTolerance = offset;
250 | }
251 |
252 | /**
253 | * 设置顶部允许偏移的容差值,此值仅在允许检测满屏时有效,当{@link #setCheckIfItemViewFullRecycleViewForTop(boolean)}设置为true 或者{@link #setCheckIfItemViewFullRecycleViewForBottom(boolean)}设置为true 时有效.
254 | * 在检测底部滑动时,对底部的检测会添加此容差值(更容易判断当前最后一项childView已超出recycleView的显示范围),用于协助判断是否滑动到顶部.
255 | * 在检测顶部滑动时,对底部的检测会添加此容差值(更容易判断为滑动到了底部)
256 | *
257 | * @param offset 容差值,此值必须为0或正数
258 | */
259 | public void setBottomFaultTolerance(@IntRange(from = 0) int offset) {
260 | mBottomOffsetFaultTolerance = offset;
261 | }
262 |
263 | /**
264 | * 设置是否需要检测recycleView是否为满屏的itemView时才回调事件.
265 | *
266 | * 当RecycleView的childView数量很少时,有可能RecycleView已经显示出所有的itemView,此时不存在向上滑动的可能.
267 | * 若设置当前值为true时,只有在RecycleView无法完全显示所有的itemView时,才会回调滑动到顶部的事件;否则将不处理;
268 | * 若设置为false则反之,不管任何时候只要滑动并顶部item显示时都会回调滑动事件
269 | *
270 | * @param isNeedToCheck true为当检测是否满屏显示;false不检测,直接回调事件
271 | */
272 | public void setCheckIfItemViewFullRecycleViewForTop(boolean isNeedToCheck) {
273 | mIsCheckTopFullRecycle = isNeedToCheck;
274 | }
275 |
276 | /**
277 | * 设置是否需要检测recycleView是否为满屏的itemView时才回调事件.
278 | *
279 | * 当RecycleView的childView数量很少时,有可能RecycleView已经显示o出所有的itemView,此时不存在向下滑动的可能.
280 | * 若设置当前值为true时,只有在RecycleView无法完全显示所有的itemView时,才会回调滑动到底部的事件;否则将不处理;
281 | * 若设置为false则反之,不管任何时候只要滑动到底部都会回调滑动事件
282 | *
283 | * @param isNeedToCheck true为当检测是否满屏显示;false不检测,直接回调事件
284 | */
285 | public void setCheckIfItemViewFullRecycleViewForBottom(boolean isNeedToCheck) {
286 | mIsCheckBottomFullRecycle = isNeedToCheck;
287 | }
288 |
289 | /**
290 | * 设置是否先检测滑动到哪里.默认为false,先检测滑动到底部
291 | *
292 | * @param isTopFirst true为先检测滑动到顶部再检测滑动到底部;false为先检测滑动到底部再滑动到顶部
293 | */
294 | public void setCheckScrollToTopFirstBottomAfter(boolean isTopFirst) {
295 | mIsCheckTopFirstBottomAfter = isTopFirst;
296 | }
297 |
298 | /**
299 | * 设置是否同时检测滑动到顶部及底部,默认为false,先检测到任何一个状态都会直接返回,不会再继续检测其它状态
300 | *
301 | * @param isCheckTogether true为两种状态都检测,即使已经检测到其中某种状态了.false为先检测到任何一种状态时将不再检测另一种状态
302 | */
303 | public void setCheckScrollToTopBottomTogether(boolean isCheckTogether) {
304 | mIsCheckTopBottomTogether = isCheckTogether;
305 | }
306 |
307 | /**
308 | * 滑动位置改变监听事件,滑动到顶部/底部或者非以上两个位置时
309 | */
310 | public interface OnScrollPositionChangedListener {
311 | /**
312 | * 滑动到顶部的回调事件
313 | */
314 | public void onScrollToTop();
315 |
316 | /**
317 | * 滑动到底部的回调事件
318 | */
319 | public void onScrollToBottom();
320 |
321 | /**
322 | * 滑动到未知位置的回调事件
323 | *
324 | * @param isTopViewVisible 当前位置顶部第一个itemView是否可见,这里是指adapter中的最后一个itemView
325 | * @param isBottomViewVisible 当前位置底部最后一个itemView是否可见,这里是指adapter中的最后一个itemView
326 | */
327 | public void onScrollToUnknown(boolean isTopViewVisible, boolean isBottomViewVisible);
328 | }
329 |
330 | /**
331 | * 滑动方向改变时监听事件
332 | */
333 | public interface OnScrollDirectionChangedListener {
334 | /**
335 | * 滑动方向改变时监听事件,当两个参数值都为0时,数据变动重新layout
336 | *
337 | * @param scrollVertical 竖直方向的滑动方向,向上<0,向下>0,不动(水平滑动时)=0
338 | * @param scrollHorizontal 水平方向的滑动方向,向左<0,向右>0,不动(竖直滑动时)=0
339 | */
340 | public void onScrollDirectionChanged(int scrollHorizontal, int scrollVertical);
341 | }
342 | }
343 |
--------------------------------------------------------------------------------
/app/src/main/java/com/easyandroid/sectionadapter/mvp/base/BasePresenter.java:
--------------------------------------------------------------------------------
1 | package com.easyandroid.sectionadapter.mvp.base;
2 |
3 | /**
4 | * package: com.easyandroid.sectionadapter.mvp.base.BasePresenter
5 | * author: gyc
6 | * description:
7 | * time: create at 2017/7/8 9:50
8 | */
9 |
10 | public interface BasePresenter {
11 | }
12 |
--------------------------------------------------------------------------------
/app/src/main/java/com/easyandroid/sectionadapter/mvp/base/BaseView.java:
--------------------------------------------------------------------------------
1 | package com.easyandroid.sectionadapter.mvp.base;
2 |
3 | /**
4 | * package: com.easyandroid.sectionadapter.mvp.base.BaseView
5 | * author: gyc
6 | * description:
7 | * time: create at 2017/7/8 9:50
8 | */
9 |
10 | public interface BaseView {
11 | void showLoading(String msg);
12 | void hideLoading();
13 | void showError(String errorMsg);
14 | }
15 |
--------------------------------------------------------------------------------
/app/src/main/java/com/easyandroid/sectionadapter/mvp/base/Module.java:
--------------------------------------------------------------------------------
1 | package com.easyandroid.sectionadapter.mvp.base;
2 |
3 | import com.easyandroid.sectionadapter.entity.TestEntity;
4 |
5 | import java.util.List;
6 |
7 | /**
8 | * package: com.easyandroid.sectionadapter.mvp.base.Module
9 | * author: gyc
10 | * description:
11 | * time: create at 2017/7/8 9:51
12 | */
13 |
14 | public class Module {
15 |
16 | public interface View extends BaseView{
17 | void updateList(int type, List datas);
18 | }
19 |
20 | public interface Presenter extends BasePresenter{
21 | void loadData(int loadType);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/main/java/com/easyandroid/sectionadapter/mvp/model/TestModel.java:
--------------------------------------------------------------------------------
1 | package com.easyandroid.sectionadapter.mvp.model;
2 |
3 | /**
4 | * package: com.easyandroid.sectionadapter.mvp.model.TestModel
5 | * author: gyc
6 | * description:
7 | * time: create at 2017/7/8 9:46
8 | */
9 |
10 | public class TestModel {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/app/src/main/java/com/easyandroid/sectionadapter/mvp/presenter/TestPresenter.java:
--------------------------------------------------------------------------------
1 | package com.easyandroid.sectionadapter.mvp.presenter;
2 |
3 | import com.easyandroid.sectionadapter.entity.TestEntity;
4 | import com.easyandroid.sectionadapter.mvp.base.Module;
5 | import com.easyandroid.sectionadapter.util.DatasUtil;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * package: com.easyandroid.sectionadapter.mvp.presenter.TestPresenter
11 | * author: gyc
12 | * description:
13 | * time: create at 2017/7/8 9:53
14 | */
15 |
16 | public class TestPresenter implements Module.Presenter{
17 |
18 | private Module.View view;
19 |
20 | public TestPresenter(Module.View view) {
21 | this.view = view;
22 | }
23 |
24 | @Override
25 | public void loadData(int loadType) {
26 | List datas = DatasUtil.createDatas();
27 | if(view!=null){
28 | view.updateList(loadType, datas);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/java/com/easyandroid/sectionadapter/util/DatasUtil.java:
--------------------------------------------------------------------------------
1 | package com.easyandroid.sectionadapter.util;
2 |
3 | import com.easyandroid.sectionadapter.entity.TestEntity;
4 | import com.easytools.tools.TimeUtil;
5 |
6 | import java.util.ArrayList;
7 | import java.util.List;
8 |
9 | /**
10 | * package: com.easyandroid.sectionadapter.util.DatasUtil
11 | * author: gyc
12 | * description:
13 | * time: create at 2017/7/8 9:58
14 | */
15 |
16 | public class DatasUtil {
17 |
18 | static String url1 = "http://g.hiphotos.baidu" +
19 | ".com/image/pic/item/4b90f603738da977c76ab6fab451f8198718e39e.jpg";
20 | static String url2 = "http://www.zjito.com/upload/resources/image/2015/11/21/8577adeb-c075-409d-b910-9d29137f8b84_720x1500.jpg?1483574072000";
21 |
22 |
23 | public static List createDatas() {
24 | List mDatas = new ArrayList<>();
25 | for (int i = 0; i < 6; i++) {
26 | TestEntity.BodyBean.EListBean bean = new TestEntity.BodyBean.EListBean();
27 | List urls = new ArrayList<>();
28 | bean.setPicture(url1);
29 | bean.setContent("炎热的夏日,深深的森林里,据说,有妖怪");
30 | bean.setTime(TimeUtil.getTimeString());
31 | bean.setBrowser("103");
32 | bean.setUserName("WD");
33 | urls.add(url2);
34 | urls.add(url2);
35 | urls.add(url2);
36 | urls.add(url2);
37 | urls.add(url2);
38 | urls.add(url2);
39 | bean.setEPicture(urls);
40 | mDatas.add(bean);
41 | }
42 | return mDatas;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/java/com/easyandroid/sectionadapter/util/ListUtil.java:
--------------------------------------------------------------------------------
1 | package com.easyandroid.sectionadapter.util;
2 |
3 | import java.util.List;
4 |
5 | /**
6 | * package: com.easyandroid.sectionadapter.util.ListUtil
7 | * author: gyc
8 | * description:
9 | * time: create at 2017/7/8 3:24
10 | */
11 |
12 | public class ListUtil {
13 | /**
14 | * 判断list数据是否为空
15 | * @param list
16 | * @param
17 | * @return
18 | */
19 | public static
boolean isEmpty(List
list) {
20 | return list == null || list.isEmpty();
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/java/com/easyandroid/sectionadapter/widgets/SectionedGridDivider.java:
--------------------------------------------------------------------------------
1 | package com.easyandroid.sectionadapter.widgets;
2 |
3 | import android.content.Context;
4 | import android.graphics.Canvas;
5 | import android.graphics.Paint;
6 | import android.graphics.Rect;
7 | import android.graphics.drawable.Drawable;
8 | import android.support.v4.content.ContextCompat;
9 | import android.support.v7.widget.RecyclerView;
10 | import android.view.View;
11 |
12 | import com.easyandroid.sectionadapter.adapter.SectionedRecyclerViewAdapter;
13 |
14 | /**
15 | * package: com.easyandroid.sectionadapter.widgets.SectionedGridDivider
16 | * author: gyc
17 | * description:分组分割线
18 | * time: create at 2017/7/10 20:49
19 | */
20 |
21 | public class SectionedGridDivider extends RecyclerView.ItemDecoration {
22 |
23 | private Drawable mDividerDrawable;
24 | private int mDividerHeight = 1;//分割线的高度,默认为1
25 | private Paint mDividerPaint;//分割线的颜色
26 |
27 | /**
28 | * 使用自定义资源文件
29 | *
30 | * @param context
31 | * @param drawableId
32 | */
33 | public SectionedGridDivider(Context context, int drawableId) {
34 | this.mDividerDrawable = ContextCompat.getDrawable(context, drawableId);
35 | mDividerHeight = mDividerDrawable.getIntrinsicHeight();
36 | }
37 |
38 | /**
39 | * 使用画笔画出分割线
40 | *
41 | * @param context
42 | * @param dividerHeight
43 | * @param dividerColor
44 | */
45 | public SectionedGridDivider(Context context, int dividerHeight, int dividerColor) {
46 | this.mDividerHeight = dividerHeight;
47 | mDividerPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
48 | mDividerPaint.setColor(dividerColor);
49 | mDividerPaint.setStyle(Paint.Style.FILL);
50 | }
51 |
52 |
53 | @Override
54 | public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State
55 | state) {
56 | super.getItemOffsets(outRect, view, parent, state);
57 | int totalCount = parent.getAdapter().getItemCount();
58 | int itemPosition = parent.getChildAdapterPosition(view);
59 | if (isDraw(parent, view, totalCount)) {
60 | if (itemPosition == 0) {
61 | outRect.set(0, 0, 0, 0);
62 | } else {
63 | outRect.set(0, mDividerHeight, 0, 0);
64 | }
65 | }
66 | }
67 |
68 | /**
69 | * 是否可以绘制分割线
70 | * @param parent 当前的RecyclerView
71 | * @param itemView 当前的内容项
72 | * @param totalCount 适配器的item总数,可能大于RecyclerView的item总数
73 | * @return
74 | */
75 | private boolean isDraw(RecyclerView parent, View itemView, int totalCount) {
76 | int itemPosition = parent.getChildAdapterPosition(itemView);
77 | if (totalCount > 1 && itemPosition < totalCount - 1) {//要除去footer占有的一个位置
78 | if (parent.getAdapter() instanceof SectionedRecyclerViewAdapter) {
79 | if (((SectionedRecyclerViewAdapter) parent.getAdapter()).isSectionHeaderPosition
80 | (itemPosition)) {
81 | return true;
82 | }
83 | }
84 | }
85 | return false;
86 | }
87 |
88 | @Override
89 | public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
90 | super.onDraw(c, parent, state);
91 | drawHorizontal(c, parent);
92 | }
93 |
94 | /**
95 | * 绘制水平的分割线
96 | * @param c
97 | * @param parent
98 | */
99 | private void drawHorizontal(Canvas c, RecyclerView parent) {
100 |
101 | int totalCount = parent.getAdapter().getItemCount();
102 |
103 | //获取当前可见的item的数量,半个也算
104 | int childCount = parent.getChildCount();
105 | for (int i = 0; i < childCount; i++) {
106 | //获取当前可见的view
107 | View child = parent.getChildAt(i);
108 | if (isDraw(parent, child, totalCount)) {
109 | RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
110 | int left = child.getLeft() - params.leftMargin;//组件在容器X轴上的起点,需要注意,如果用户设置了left方向的Margin值,需要在取得itemViewleft属性后,将该margin抵消掉,因为,用户设置margin的意图明显不是想让分割线覆盖掉的
111 | int right = child.getRight() + params.rightMargin ;
112 | int top = child.getTop() - mDividerHeight - params.bottomMargin;//组件在容器Y轴上的起点
113 | int bottom = top + mDividerHeight;
114 | if (mDividerDrawable != null) {
115 | mDividerDrawable.setBounds(left, top, right, bottom);
116 | mDividerDrawable.draw(c);
117 | }
118 | if (mDividerPaint != null) {
119 | c.drawRect(left, top, right, bottom, mDividerPaint);
120 | }
121 | }
122 | }
123 | }
124 |
125 | }
126 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_section_body.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_section_footer.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_section_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
16 |
17 |
26 |
27 |
33 |
34 |
35 |
36 |
46 |
47 |
53 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_footer.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
11 |
12 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gycold/SectionRecyclerViewAdapter/ec627c4302b5d5f13656731c02ab30e162ad7f48/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gycold/SectionRecyclerViewAdapter/ec627c4302b5d5f13656731c02ab30e162ad7f48/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gycold/SectionRecyclerViewAdapter/ec627c4302b5d5f13656731c02ab30e162ad7f48/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gycold/SectionRecyclerViewAdapter/ec627c4302b5d5f13656731c02ab30e162ad7f48/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gycold/SectionRecyclerViewAdapter/ec627c4302b5d5f13656731c02ab30e162ad7f48/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gycold/SectionRecyclerViewAdapter/ec627c4302b5d5f13656731c02ab30e162ad7f48/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gycold/SectionRecyclerViewAdapter/ec627c4302b5d5f13656731c02ab30e162ad7f48/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gycold/SectionRecyclerViewAdapter/ec627c4302b5d5f13656731c02ab30e162ad7f48/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gycold/SectionRecyclerViewAdapter/ec627c4302b5d5f13656731c02ab30e162ad7f48/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gycold/SectionRecyclerViewAdapter/ec627c4302b5d5f13656731c02ab30e162ad7f48/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
8 | #FAFAFA
9 | #AAAAAA
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 12sp
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | SectionRecyclerViewAdapter
3 | 浏览 %1$s 人
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/easyandroid/sectionadapter/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.easyandroid.sectionadapter;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.3.2'
9 | classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
21 | task clean(type: Delete) {
22 | delete rootProject.buildDir
23 | }
24 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gycold/SectionRecyclerViewAdapter/ec627c4302b5d5f13656731c02ab30e162ad7f48/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Jul 05 22:03:04 CST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/pictures/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gycold/SectionRecyclerViewAdapter/ec627c4302b5d5f13656731c02ab30e162ad7f48/pictures/1.png
--------------------------------------------------------------------------------
/pictures/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gycold/SectionRecyclerViewAdapter/ec627c4302b5d5f13656731c02ab30e162ad7f48/pictures/2.png
--------------------------------------------------------------------------------
/pictures/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gycold/SectionRecyclerViewAdapter/ec627c4302b5d5f13656731c02ab30e162ad7f48/pictures/3.png
--------------------------------------------------------------------------------
/pictures/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gycold/SectionRecyclerViewAdapter/ec627c4302b5d5f13656731c02ab30e162ad7f48/pictures/4.png
--------------------------------------------------------------------------------
/pictures/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gycold/SectionRecyclerViewAdapter/ec627c4302b5d5f13656731c02ab30e162ad7f48/pictures/5.png
--------------------------------------------------------------------------------
/pictures/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gycold/SectionRecyclerViewAdapter/ec627c4302b5d5f13656731c02ab30e162ad7f48/pictures/6.png
--------------------------------------------------------------------------------
/pictures/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gycold/SectionRecyclerViewAdapter/ec627c4302b5d5f13656731c02ab30e162ad7f48/pictures/7.png
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------