xrecyclerview

所属分类:collect
开发工具:Java
文件大小:0KB
下载次数:0
上传日期:2016-10-27 03:27:25
上 传 者sh-1993
说明:  [https: github.com jianghejie XRecyclerView.git根据此神提供的代码修改成符合自己样式的view](https: github.com jianghejie XRecyclerView.git%E6%A0%B9%E6%8D%AE%E6%AD%A4%E7%A5%9E%E6%8F%90%E4%BE%9B%E7%9A%84%E4%BB%A3%E7%A0%81%E4%BF%AE%E6%94%B9%E6%88%90%E7%AC%A6%E5%90%88%E8%87%AA%E5%B7%B1%E6%A0%B7%E5%BC%8F%E7%9A%84view),
([https: github.com jianghejie XRecyclerView. git According to the code provided by this god, it is modified to a view that conforms to its own style] (https: github.com jianghejie XRecyclerView. git% E6% A0% B9% E6% 8D% AE% E6% AD% A4% E7% A5% 9E% E6% 8F% 90% E4% BE% 9B% E7% 9A% 84% E4% BB% A3% E7% A0% 81% E4% BF% AE% E6% 94% B9% E6% 88% 90% E 7% AC% A6% E5% 90% 88% E8% 87% AA% E5% B7% B1% E6% A0% B7% E5% BC% 8F% E7% 9A% 84view),)

文件列表:
app/ (0, 2016-10-26)
app/app.iml (10909, 2016-10-26)
app/build.gradle (975, 2016-10-26)
app/proguard-rules.pro (668, 2016-10-26)
app/src/ (0, 2016-10-26)
app/src/androidTest/ (0, 2016-10-26)
app/src/androidTest/java/ (0, 2016-10-26)
app/src/androidTest/java/com/ (0, 2016-10-26)
app/src/androidTest/java/com/example/ (0, 2016-10-26)
app/src/androidTest/java/com/example/xrecyclerview/ (0, 2016-10-26)
app/src/androidTest/java/com/example/xrecyclerview/ApplicationTest.java (356, 2016-10-26)
app/src/main/ (0, 2016-10-26)
app/src/main/AndroidManifest.xml (1663, 2016-10-26)
app/src/main/java/ (0, 2016-10-26)
app/src/main/java/com/ (0, 2016-10-26)
app/src/main/java/com/example/ (0, 2016-10-26)
app/src/main/java/com/example/xrecyclerview/ (0, 2016-10-26)
app/src/main/java/com/example/xrecyclerview/CollapsingToolbarLayoutActivity.java (4172, 2016-10-26)
app/src/main/java/com/example/xrecyclerview/DisableExampleActivity.java (1917, 2016-10-26)
app/src/main/java/com/example/xrecyclerview/EmptyViewActivity.java (2086, 2016-10-26)
app/src/main/java/com/example/xrecyclerview/GridActivity.java (4135, 2016-10-26)
app/src/main/java/com/example/xrecyclerview/LinearActivity.java (4116, 2016-10-26)
app/src/main/java/com/example/xrecyclerview/MainActivity.java (1684, 2016-10-26)
app/src/main/java/com/example/xrecyclerview/MultiHeaderActivity.java (4549, 2016-10-26)
app/src/main/java/com/example/xrecyclerview/MyAdapter.java (1455, 2016-10-26)
app/src/main/java/com/example/xrecyclerview/StaggeredGridActivity.java (4529, 2016-10-26)
app/src/main/res/ (0, 2016-10-26)
app/src/main/res/drawable-hdpi/ (0, 2016-10-26)
app/src/main/res/drawable-hdpi/headimg.jpg (28773, 2016-10-26)
app/src/main/res/drawable-hdpi/iconfont_downgrey.png (486, 2016-10-26)
app/src/main/res/layout/ (0, 2016-10-26)
app/src/main/res/layout/activity_collapsing_toolbar_layout.xml (2170, 2016-10-26)
app/src/main/res/layout/activity_disable_example.xml (496, 2016-10-26)
app/src/main/res/layout/activity_emptyview.xml (721, 2016-10-26)
app/src/main/res/layout/activity_main.xml (2043, 2016-10-26)
app/src/main/res/layout/activity_multi_header.xml (1214, 2016-10-26)
app/src/main/res/layout/activity_recyclerview.xml (1191, 2016-10-26)
... ...

# XRecyclerView a RecyclerView that implements pullrefresh , loadingmore and header featrues.you can use it like a standard RecyclerView. you don't need to implement a special adapter . Screenshots ----------- ![demo](https://github.com/jianghejie/XRecyclerView/blob/master/art/demo.gif) on real device it is much more smoother. Usage ----- ##gradle ```groovy compile 'com.jcodecraeer:xrecyclerview:1.2.7' ``` just like a standard RecyclerView ```java LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity()); layoutManager.setOrientation(LinearLayoutManager.VERTICAL); mRecyclerView.setLayoutManager(layoutManager); mRecyclerView.setAdapter(mAdapter); ``` ##pull to refresh and load more the pull to refresh and load more featrue is enabled by default. we provide a callback to trigger the refresh and LoadMore event. ```java mRecyclerView.setLoadingListener(new XRecyclerView.LoadingListener() { @Override public void onRefresh() { //refresh data here } @Override public void onLoadMore() { // load more data here } }); ``` and of course you have to tell our RecyclerView when the refreshing or loading more work is done. you can use ```java mRecyclerView.loadMoreComplete(); ``` to notify that the loading more work is done. and ```java mRecyclerView.refreshComplete(); ``` to notify that the refreshing work is done. here is what we get: ![default](https://github.com/jianghejie/XRecyclerView/blob/master/art/default.gif) ###custom refresh and loading more style pull refresh and loading more style is highly customizable. #### custom loading style the loading effect we use the [AVLoadingIndicatorView](https://github.com/81813780/AVLoadingIndicatorView) . and it is built in(make a little change). we provide all the effect in AVLoadingIndicatorView library besides we add a system style. you can call ```java mRecyclerView.setRefreshProgressStyle(int style); ``` and ```java mRecyclerView.setLaodingMoreProgressStyle(int style); ``` to set the RefreshProgressStyle and LaodingMoreProgressStyle respectively. for example ```java mRecyclerView.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader); ``` ![refreshloadingballspinfade](https://github.com/jianghejie/XRecyclerView/blob/master/art/refreshloadingballspinfade.gif) ```java mRecyclerView.setLaodingMoreProgressStyle(ProgressStyle.SquareSpin); ``` ![loadingmoresquarespin](https://github.com/jianghejie/XRecyclerView/blob/master/art/loadingmoresquarespin.gif) BallPulse effect ![BallPulse](https://github.com/jianghejie/XRecyclerView/blob/master/art/ballpulse.gif) all the effect can be get in the ProgressStyle class ```java public class ProgressStyle { public static final int SysProgress=-1; public static final int BallPulse=0; public static final int BallGridPulse=1; public static final int BallClipRotate=2; public static final int BallClipRotatePulse=3; public static final int SquareSpin=4; public static final int BallClipRotateMultiple=5; public static final int BallPulseRise=6; public static final int BallRotate=7; public static final int CubeTransition=8; public static final int BallZigZag=9; public static final int BallZigZagDeflect=10; public static final int BallTrianglePath=11; public static final int BallScale=12; public static final int LineScale=13; public static final int LineScaleParty=14; public static final int BallScaleMultiple=15; public static final int BallPulseSync=16; public static final int BallBeat=17; public static final int LineScalePulseOut=18; public static final int LineScalePulseOutRapid=19; public static final int BallScaleRipple=20; public static final int BallScaleRippleMultiple=21; public static final int BallSpinFadeLoader=22; public static final int LineSpinFadeLoader=23; public static final int TriangleSkewSpin=24; public static final int Pacman=25; public static final int BallGridBeat=26; public static final int SemiCircleSpin=27; } ``` #### refresh arrow icon we provide a default arrow icon: ![ic_pulltorefresh_arrow](https://github.com/jianghejie/XRecyclerView/blob/master/art/ic_pulltorefresh_arrow.png) but if you don't like it,you can replace it with any other icon you want. just call ```java mRecyclerView.setArrowImageView(R.drawable.iconfont_downgrey); ``` ![customarrow](https://github.com/jianghejie/XRecyclerView/blob/master/art/customarrow.gif) ###disable refresh and load more featrue if you don't want the refresh and load more featrue(in that case,you probably dont'n need the lib neither),you can call ```java mRecyclerView.setPullRefreshEnabled(false); ``` and ```java mRecyclerView.setPullRefreshEnabled(true); ``` in which false means disabled ,true means enabled. ##Header you can add header to XRecyclerView,just call addHeaderView(). ```java View header = LayoutInflater.from(this).inflate(R.layout.recyclerview_header, (ViewGroup)findViewById(android.R.id.content),false); mRecyclerView.addHeaderView(header); ``` if you like ,you can add two header ```java View header = LayoutInflater.from(this).inflate(R.layout.recyclerview_header, (ViewGroup)findViewById(android.R.id.content),false); View header1 = LayoutInflater.from(this).inflate(R.layout.recyclerview_header1, (ViewGroup)findViewById(android.R.id.content),false); mRecyclerView.addHeaderView(header); mRecyclerView.addHeaderView(header1); ``` License ------- Copyright 2015 jianghejie Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

近期下载者

相关文件


收藏者