Skip to content

Commit

Permalink
add measureItem and layoutSkeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
rasoulmiri committed May 9, 2019
1 parent e413c69 commit 4bfd6af
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions library/src/main/java/io/rmiri/skeleton/master/SkeletonConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,23 @@ public class SkeletonConfig {
private float recyclerViewHeight, itemHeight;
private int numberItemShow;
private RecyclerView recyclerView;
private int layoutSkeleton;
private int measureItem;

public static final int SKELETON_MESARE_ITEM_MANUAL = 0;
public static final int SKELETON_MESARE_ITEM_AUTOMATIC = 1;

public SkeletonConfig() {
}

public SkeletonConfig(boolean skeletonIsOn, float recyclerViewHeight, float itemHeight, int numberItemShow, RecyclerView recyclerView) {
public SkeletonConfig(boolean skeletonIsOn, float recyclerViewHeight, float itemHeight, int numberItemShow, RecyclerView recyclerView, int layoutSkeleton, int measureItem) {
this.skeletonIsOn = skeletonIsOn;
this.recyclerViewHeight = recyclerViewHeight;
this.itemHeight = itemHeight;
this.numberItemShow = numberItemShow;
this.recyclerView = recyclerView;
this.layoutSkeleton = layoutSkeleton;
this.measureItem = measureItem;
}

public boolean isSkeletonIsOn() {
Expand All @@ -45,6 +52,14 @@ public RecyclerView getRecyclerView() {
return recyclerView;
}

public int getLayoutSkeleton() {
return layoutSkeleton;
}

public int getMeasureItem() {
return measureItem;
}

public SkeletonConfig setSkeletonIsOn(boolean skeletonIsOn) {
this.skeletonIsOn = skeletonIsOn;
return this;
Expand All @@ -70,7 +85,17 @@ public SkeletonConfig setRecyclerView(RecyclerView recyclerView) {
return this;
}

public SkeletonConfig setLayoutSkeleton(int layoutSkeleton) {
this.layoutSkeleton = layoutSkeleton;
return this;
}

public SkeletonConfig setMeasureItem(int measureItem) {
this.measureItem = measureItem;
return this;
}

public SkeletonConfig build() {
return new SkeletonConfig(skeletonIsOn, recyclerViewHeight, itemHeight, numberItemShow, recyclerView);
return new SkeletonConfig(skeletonIsOn, recyclerViewHeight, itemHeight, numberItemShow, recyclerView, layoutSkeleton, measureItem);
}
}

0 comments on commit 4bfd6af

Please sign in to comment.