All Projects → XRecyclerView → Xrecyclerview

XRecyclerView / Xrecyclerview

A RecyclerView that implements pullrefresh and loadingmore featrues.you can use it like a standard RecyclerView

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Xrecyclerview

Parallaxrecyclerview
Parallax effect on every item of your RecyclerView.
Stars: ✭ 237 (-95.5%)
Mutual labels:  custom-view, recyclerview
Codeview Android
Display code with syntax highlighting ✨ in native way.
Stars: ✭ 748 (-85.8%)
Mutual labels:  custom-view, recyclerview
Reel Search Android
Reel Search for Android is a UI/UX design for autocomplete action. It is a beautiful minimalistic addition to any use case.
Stars: ✭ 110 (-97.91%)
Mutual labels:  custom-view, recyclerview
android-thinkmap-treeview
Tree View; Mind map; Think map; tree map; custom view; 自定义;关系图;树状图;思维导图;组织机构图;层次图
Stars: ✭ 314 (-94.04%)
Mutual labels:  recyclerview, custom-view
Android-Code-Demos
📦 Android learning code demos.
Stars: ✭ 41 (-99.22%)
Mutual labels:  recyclerview, custom-view
android-tableview-kotlin
Android's missing TableView component.
Stars: ✭ 40 (-99.24%)
Mutual labels:  recyclerview, custom-view
RecyclerViewAdapter
A RecyclerView Adapter that support load more and add headerview
Stars: ✭ 145 (-97.25%)
Mutual labels:  recyclerview, load-more
Tableview
TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.
Stars: ✭ 2,928 (-44.43%)
Mutual labels:  custom-view, recyclerview
Coder
Android Material Design 风格控件的学习及遇到的问题;Tablayout | 横向布局标签,TextInputLayout | 文字输入布局 ,FloatingActionButton | 悬浮按钮, CoordinatorLayout APPBarLayout CollapsingTabLayout实现折叠头布局,BottomSheetDialog | 底部对话框,Touch Feedback| 触摸反馈,Reveal Effect| 揭示效果,Curved motion | 曲线运动,Animated Vector Drawables | 矢量图片动画
Stars: ✭ 502 (-90.47%)
Mutual labels:  recyclerview
Swiperecyclerview
🍈 RecyclerView侧滑菜单,Item拖拽,滑动删除Item,自动加载更多,HeaderView,FooterView,Item分组黏贴。
Stars: ✭ 5,174 (-1.8%)
Mutual labels:  recyclerview
Yasha
Kotlin-based modern RecyclerView rendering weapon
Stars: ✭ 494 (-90.62%)
Mutual labels:  recyclerview
Androidribbon
🎀 The simple way to implement a beautiful ribbon with the shimmering on Android.
Stars: ✭ 502 (-90.47%)
Mutual labels:  recyclerview
Multitype
Easier and more flexible to create multiple types for Android RecyclerView.
Stars: ✭ 5,298 (+0.55%)
Mutual labels:  recyclerview
Suspensionbar
A RecyclerView suspension bar implementation like Instagram
Stars: ✭ 494 (-90.62%)
Mutual labels:  recyclerview
Awesome Recyclerview Layoutmanager
RecyclerView-LayoutManager Resources
Stars: ✭ 581 (-88.97%)
Mutual labels:  recyclerview
Spannedgridlayoutmanager
Android RecyclerView.LayoutManager that resizes and reorders views based on SpanSize
Stars: ✭ 492 (-90.66%)
Mutual labels:  recyclerview
Indicatordialog
a dialog with arrow indicator in the location where you want
Stars: ✭ 485 (-90.8%)
Mutual labels:  recyclerview
Gameplane
基于Android的仿微信打飞机游戏
Stars: ✭ 592 (-88.76%)
Mutual labels:  custom-view
Views
A collection of cool android custom views
Stars: ✭ 580 (-88.99%)
Mutual labels:  custom-view
Android Zblibrary
🔥Android MVP 快速开发框架,做国内 「示例最全面」「注释最详细」「使用最简单」「代码最严谨」的 Android 开源 UI 框架。 🔥An Android MVP Framework with many demos, detailed documents, simple usages and strict codes.
Stars: ✭ 5,000 (-5.11%)
Mutual labels:  recyclerview

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 .qq 群478803619 Screenshots

demo

on real device it is much more smoother. Usage

gradle

// 1.6.0 is the main
compile 'com.jcodecraeer:xrecyclerview:1.6.0'

just like a standard RecyclerView

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.

 mRecyclerView.setLoadingListener(new XRecyclerView.LoadingListener() {
    @Override
    public void onRefresh() {
       //refresh data here
    }

    @Override
    public void onLoadMore() {
       // load more data here
    }
});

new function of 1.5.7 version.

mRecyclerView
    .getDefaultRefreshHeaderView() // get default refresh header view
    .setRefreshTimeVisible(true);  // make refresh time visible,false means hiding

// if you are not sure that you are 100% going to
// have no data load back from server anymore,do not use this
@Deprecated
public void setEmptyView(View emptyView) {
    ...
}

new function of 1.5.6 version,fixed a memory leak problem,use the code below to release XR's memory

// any time,when you finish your activity or fragment,call this below
if(mRecyclerView != null){
    mRecyclerView.destroy(); // this will totally release XR's memory
    mRecyclerView = null;
}

new function of 1.5.3 version,you can use XR in the sticky scroll model now,like the code below,the demo activity is 'LinearStickyScrollActivity'

final View topView = findViewById(R.id.topView);
final View tabView = findViewById(R.id.tabView);
final View content = findViewById(R.id.contentView);

final StickyScrollLinearLayout s = findViewById(R.id.StickyScrollLinearLayout);
s.addOnLayoutChangeListener(
        new View.OnLayoutChangeListener() {
            @Override
            public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
                if(s.getContentView() != null)
                    return;
                // 放在这里是为了等初始化结束后再添加,防止 height 获取 =0
                // add from here just in case they height==0
                s.setInitInterface(
                        new StickyScrollLinearLayout.StickyScrollInitInterface() {
                            @Override
                            public View setTopView() {
                                return topView;
                            }

                            @Override
                            public View setTabView() {
                                return tabView;
                            }

                            @Override
                            public View setContentView() {
                                return content;
                            }
                        }
                );
            }
        }
);

call notifyItemRemoved or notifyItemInserted, remember to use the functions inside XRecyclerView

listData.remove(pos);
mRecyclerView.notifyItemRemoved(listData,pos);

and of course you have to tell our RecyclerView when the refreshing or loading more work is done. you can use

mRecyclerView.loadMoreComplete();

to control when the item number of the screen is list.size-2,we call the onLoadMore

mRecyclerView.setLimitNumberToCallLoadMore(2); // default is 1

to notify that the loading more work is done. and

 mRecyclerView.refreshComplete();

to notify that the refreshing work is done.

here is what we get:

default

call refresh() manually(I change the previous setRefreshing() method to refresh() )

mRecyclerView.refresh();

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 . 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

mRecyclerView.setRefreshProgressStyle(int style);

and

mRecyclerView.setLaodingMoreProgressStyle(int style);

to set the RefreshProgressStyle and LaodingMoreProgressStyle respectively.

for example

mRecyclerView.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);

refreshloadingballspinfade

mRecyclerView.setLaodingMoreProgressStyle(ProgressStyle.SquareSpin);

loadingmoresquarespin

BallPulse effect

BallPulse

all the effect can be get in the ProgressStyle class

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

but if you don't like it,you can replace it with any other icon you want. just call

mRecyclerView.setArrowImageView(R.drawable.iconfont_downgrey);

customarrow

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

mRecyclerView.setPullRefreshEnabled(false);

and

mRecyclerView.setPullRefreshEnabled(true);

in which false means disabled ,true means enabled. ##Header you can add header to XRecyclerView,just call addHeaderView().

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

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].