Skip to content

Commit

Permalink
demo gif
Browse files Browse the repository at this point in the history
  • Loading branch information
jianghejie committed Nov 26, 2015
1 parent 4f8d333 commit 9686f3e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions app/src/main/java/com/example/xrecyclerview/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ protected void onCreate(Bundle savedInstanceState) {
mRecyclerView.setLaodingMoreProgressStyle(ProgressStyle.Pacman);
mRecyclerView.setArrowImageView(R.drawable.iconfont_downgrey);

View header = LayoutInflater.from(this).inflate(R.layout.recyclerview_header, null);
View header = LayoutInflater.from(this).inflate(R.layout.recyclerview_header, null,false);
mRecyclerView.addHeaderView(header);
header

mRecyclerView.setLoadingListener(new XRecyclerView.LoadingListener() {
@Override
Expand All @@ -55,15 +56,13 @@ public void run() {
@Override
public void onLoadMore() {
new Handler().postDelayed(new Runnable(){

public void run() {
for(int i = 0; i < 15 ;i++){
listData.add("item" + (i + listData.size()) );
}
mAdapter.notifyDataSetChanged();
mRecyclerView.loadMoreComplete();
}

}, 3000);

}
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/res/layout/recyclerview_header.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="150dip"
android:layout_height="200dip"
android:gravity="center"
android:background="#3CB371"
android:textColor="#ffffff"
android:text="www.jcodecraeer.com"
android:text="this is header"
/>



Binary file added art/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9686f3e

Please sign in to comment.