Skip to content

Commit

Permalink
Fixed HeaderedAdapter showHeaders
Browse files Browse the repository at this point in the history
  • Loading branch information
ackava committed Mar 31, 2017
1 parent 9c89e4c commit ced7ed7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions hypercube/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ android {
defaultConfig {
minSdkVersion 15
targetSdkVersion 25
versionCode 1441
versionName "1.4.41"
versionCode 1442
versionName "1.4.42"
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,12 @@ public void setShowHeaders(boolean v){
notifyDataSetChanged();
}

public HeaderedAdapter(Context context) {
this.context = context;
source = new ArrayList<>();
public HeaderedAdapter(Context context){
this(context,true);
}

public HeaderedAdapter(Context context, boolean showHeaders) {
this(context,new ArrayList<T>(),showHeaders);
}

public HeaderedAdapter(Context context, List<T> source) {
Expand All @@ -57,8 +60,9 @@ public HeaderedAdapter(Context context, List<T> source, boolean showHeaders) {
this.context = context;
this.showHeaders = showHeaders;
this.source = source;

recreate();
if(source!=null && source.size()>0) {
recreate();
}
}

public Context getContext() {
Expand Down

0 comments on commit ced7ed7

Please sign in to comment.