Skip to content
This repository has been archived by the owner on Jan 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #17 from mafanwei/master
Browse files Browse the repository at this point in the history
Update LoadingDialog.java
  • Loading branch information
ForgetAll authored Sep 27, 2021
2 parents 87c2cd5 + 3f747cd commit 3df2489
Showing 1 changed file with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public class LoadingDialog implements FinishDrawListener {
public final String TAG = "LoadingDialog";
public static final int STYLE_RING = 0;
public static final int STYLE_LINE = 1;
private Context mContext;

private LVCircularRing mLoadingView;
private Dialog mLoadingDialog;
Expand Down Expand Up @@ -62,7 +61,6 @@ public enum Speed {
private DismissListener d;

public LoadingDialog(Context context) {
mContext = context;
// 首先得到整个View
@SuppressWarnings("all")
View view = LayoutInflater.from(context).inflate(
Expand All @@ -86,7 +84,6 @@ public void onBackPressed() {
mLoadingDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
mContext = null;
if (d != null) d.dimiss();
}
});
Expand Down Expand Up @@ -200,6 +197,14 @@ public void show() {
}
}

/**
* Whether the dialog is currently showing
* 当前dialog是否正在显示
*/
public boolean isShowing() {
return mLoadingDialog != null && mLoadingDialog.isShowing();
}

/**
* set load style
* 设置load的样式,目前支持转圈圈和菊花转圈圈
Expand Down Expand Up @@ -427,6 +432,19 @@ public LoadingDialog setTextSize(float size) {
return this;
}

/**
* set the size of load text size
* 设置加载字体大小
*
* @param size 尺寸,单位px
* @return 这个对象
*/
public LoadingDialog setTextSizeWithPx(float size) {
if (size < 0) return this;
loadingText.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
return this;
}

public static void initStyle(StyleManager style) {
if (style != null)
s = style;
Expand Down

0 comments on commit 3df2489

Please sign in to comment.