Skip to content

Commit

Permalink
Optimized code
Browse files Browse the repository at this point in the history
  • Loading branch information
ChadCym committed Apr 18, 2016
1 parent c660764 commit cf482c3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.view.View;

import com.chad.baserecyclerviewadapterhelper.adapter.SectionAdapter;
import com.chad.baserecyclerviewadapterhelper.data.DataServer;
Expand All @@ -12,6 +13,9 @@
public class SectionUerActivity extends Activity {
private RecyclerView mRecyclerView;

/**
* @param savedInstanceState
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -21,5 +25,6 @@ protected void onCreate(Bundle savedInstanceState) {
SectionAdapter sectionAdapter = new SectionAdapter(this, R.layout.image_view, R.layout.def_section_head, DataServer.getSampleData());
mRecyclerView.addItemDecoration(new GridItemDecoration(this,R.drawable.list_divider));
mRecyclerView.setAdapter(sectionAdapter);
new View(this).setVisibility(View.GONE);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ public abstract class BaseQuickAdapter<T> extends RecyclerView.Adapter<RecyclerV

private boolean isOpenAnimation = false;

protected static final int HEADER_VIEW = 2;
protected static final int LOADING_VIEW = 1;
protected static final int FOOTER_VIEW = 3;
protected static final int HEADER_VIEW = 0x00000001;
protected static final int LOADING_VIEW = 0x00000002;
protected static final int FOOTER_VIEW = 0x00000003;

private ArrayList<View> mHeaderViews = new ArrayList<>();
private ArrayList<View> mFooterViews = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public abstract class BaseSectionQuickAdapter<T extends SectionEntity> extends B

protected int sectionHeadResId;
protected List<T> data;
protected static final int SECTION_HEADER_VIEW = 4;
protected static final int SECTION_HEADER_VIEW = 0x00000004;

/**
* Same as QuickAdapter#QuickAdapter(Context,int) but with
Expand Down

0 comments on commit cf482c3

Please sign in to comment.