Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
HeYongRui committed Mar 26, 2017
1 parent 9e63604 commit 1264aaf
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ public LoadingDialog(Context mcontext, boolean cancelable, float alpha, int type
this.alpha = alpha;
this.type = type;
this.color = color;
init(this.type, this.color);
init();
}

public void init(int type, @ColorInt int color) {
public void init() {
builder = new AlertDialog.Builder(mcontext);
View loading_dialog_ll = LayoutInflater.from(mcontext).inflate(R.layout.laoding_dialog, null);
SpinKitView skv = (SpinKitView) loading_dialog_ll.findViewById(R.id.spin_kit);
skv.setColor(color);
switch (type) {
skv.setColor(this.color);
switch (this.type) {
case 0:
ChasingDots chasingDots = new ChasingDots();
skv.setIndeterminateDrawable(chasingDots);
Expand Down Expand Up @@ -133,7 +133,7 @@ public void init(int type, @ColorInt int color) {
Window window = alertDialog.getWindow();
//loading框透明度
WindowManager.LayoutParams lp = window.getAttributes();
lp.alpha = alpha;
lp.alpha = this.alpha;
window.setAttributes(lp);
}

Expand Down Expand Up @@ -167,17 +167,21 @@ public boolean isShowing() {

public void setColor(@ColorInt int color) {
this.color = color;
init();
}

public void setType(int type) {
this.type = type;
init();
}

public void setCancelable(boolean cancelable) {
this.cancelable = cancelable;
init();
}

public void setAlpha(float alpha) {
this.alpha = alpha;
init();
}
}

0 comments on commit 1264aaf

Please sign in to comment.