瀏覽代碼

进度条优化

zengjiebin 7 年之前
父節點
當前提交
2a8ee0ad96

+ 5 - 3
app/build.gradle

@@ -245,8 +245,6 @@ dependencies {
 
     annotationProcessor 'com.arialyy.aria:aria-compiler:3.3.16'
     compile 'com.sunfusheng:marqueeview:1.3.3'
-    compile(name: 'compresshelper-release', ext: 'aar')
-//    compile 'com.github.nanchen2251:CompressHelper:1.0.5'
     compile files('libs/alipaySdk-20170922.jar')
     //极光
     compile files('libs/jcore-android-1.2.0.jar')
@@ -259,7 +257,11 @@ dependencies {
     compile files('libs/mdsdk.jar')
     //轮播图
     compile 'com.youth.banner:banner:1.4.10'  //最新版本
-
+    //loading
+    compile 'com.github.ybq:Android-SpinKit:1.1.0'
+//    compile 'com.github.nanchen2251:CompressHelper:1.0.5'
+//    compile(name: 'compresshelper-release', ext: 'aar')
+    compile files('libs/compresshelper-release.jar')
 }
 static def releaseTime() {
     return new Date().format("MMddHHmm", TimeZone.getDefault())

二進制
app/libs/compresshelper-release.aar


二進制
app/libs/compresshelper-release.jar


+ 4 - 4
app/src/main/java/com/sheep/gamegroup/absBase/AbsChooseImageActivity.java

@@ -10,7 +10,7 @@ import com.kfzs.duanduan.react.upfile.UpFileListener;
 import com.kfzs.duanduan.react.upfile.UpFileUtils;
 import com.sheep.gamegroup.model.entity.UploadResult;
 import com.sheep.gamegroup.util.ListUtil;
-import com.sheep.gamegroup.view.dialog.DialogShowLoading;
+import com.sheep.gamegroup.view.dialog.DialogProgress;
 import com.sheep.jiuyan.samllsheep.utils.G;
 import com.yalantis.ucrop.UCrop;
 
@@ -35,7 +35,7 @@ public abstract class AbsChooseImageActivity extends BaseActivity implements UpF
     protected String path;
     protected List<String> urls = new ArrayList<>();
 
-    private DialogShowLoading dialogShowLoading;
+    private DialogProgress dialogShowLoading;
     public static final int DEFAULT_MAX_COUNT = 7;//上传任务截图的最大个数
 
     public void showChooseDialog() {
@@ -131,7 +131,7 @@ public abstract class AbsChooseImageActivity extends BaseActivity implements UpF
         if(photoCount == 1) {
             onGetImage(path);
             if (isUpload) {
-                AbsChooseImageActivity.this.dialogShowLoading = DialogShowLoading.showDialog(AbsChooseImageActivity.this);
+                AbsChooseImageActivity.this.dialogShowLoading = DialogProgress.showDialog(AbsChooseImageActivity.this);
                 UpFileUtils.upImage(new File(path), AbsChooseImageActivity.this);
             }
         } else if(photos != null && !photos.isEmpty()){
@@ -144,7 +144,7 @@ public abstract class AbsChooseImageActivity extends BaseActivity implements UpF
             path = sb.toString();
             onGetImage(path);
             if (isUpload) {
-                AbsChooseImageActivity.this.dialogShowLoading = DialogShowLoading.showDialog(AbsChooseImageActivity.this);
+                AbsChooseImageActivity.this.dialogShowLoading = DialogProgress.showDialog(AbsChooseImageActivity.this);
                 UpFileUtils.upImages(photos, AbsChooseImageActivity.this);
             }
         } else {

+ 16 - 39
app/src/main/java/com/sheep/gamegroup/absBase/BaseActivity.java

@@ -1,11 +1,12 @@
 package com.sheep.gamegroup.absBase;
 
-import android.app.ProgressDialog;
 import android.os.Bundle;
 import android.support.annotation.Nullable;
 import android.support.v7.app.AppCompatActivity;
 import android.view.KeyEvent;
 
+import com.sheep.gamegroup.view.dialog.DialogLoading;
+
 import butterknife.ButterKnife;
 
 /**
@@ -14,7 +15,7 @@ import butterknife.ButterKnife;
 
 public abstract class BaseActivity extends AppCompatActivity {
 
-    protected ProgressDialog  mPd;
+    protected DialogLoading dialogLoading;
 
 
     @Override
@@ -26,51 +27,27 @@ public abstract class BaseActivity extends AppCompatActivity {
         initListener();
         initData();
     }
-
+    public boolean isShowing(){
+        return dialogLoading != null && dialogLoading.getAlertDialog() != null && dialogLoading.getAlertDialog().isShowing();
+    }
     public void  showProgress(){
-        try {
-            if(mPd!=null){
-                hideProgress();
-            }
-            mPd = new ProgressDialog(this);
-//        View view= LayoutInflater.from(this).inflate(R.layout.dialog_layout,null);
-//        mPd.setContentView(view);//自己定义布局
-            mPd.setMessage("数据加载中...");
-            mPd.setCancelable(true);//能否够被取消
-//        mPd.setProgressStyle(ProgressDialog.STYLE_SPINNER);//圆环风格
-            mPd.show();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
+        hideProgress();
+        dialogLoading = DialogLoading.showDialog(this);
     }
     protected void  showProgress(boolean cancel){
-        try {
-            if(mPd!=null){
-                hideProgress();
-            }
-            mPd = new ProgressDialog(this);
-//        View view= LayoutInflater.from(this).inflate(R.layout.dialog_layout,null);
-//        mPd.setContentView(view);//自己定义布局
-            mPd.setMessage("数据加载中...");
-            mPd.setCancelable(cancel);//能否够被取消
-//        mPd.setProgressStyle(ProgressDialog.STYLE_SPINNER);//圆环风格
-            mPd.show();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
+        hideProgress();
+        dialogLoading = DialogLoading.showDialog(this, cancel);
     }
 
 
     public void  hideProgress(){
-        this.runOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                if(mPd!=null){
-                    mPd.dismiss();
-                }
+        if(isShowing()){
+            try {
+                dialogLoading.getAlertDialog().dismiss();
+            } catch (Exception e) {
+                e.printStackTrace();
             }
-        });
-
+        }
     }
 
 

+ 9 - 1
app/src/main/java/com/sheep/gamegroup/util/TestUtil.java

@@ -30,8 +30,10 @@ import com.sheep.gamegroup.usage.AppUsageManager;
 import com.sheep.gamegroup.view.activity.ActInstallApkList;
 import com.sheep.gamegroup.view.activity.ActSheepApkList;
 import com.sheep.gamegroup.view.activity.ActWeb;
+import com.sheep.gamegroup.view.dialog.DialogLoading;
 import com.sheep.gamegroup.view.dialog.DialogNewbieTaskList;
 import com.sheep.gamegroup.view.dialog.DialogShare;
+import com.sheep.gamegroup.view.dialog.DialogProgress;
 import com.sheep.jiuyan.samllsheep.BuildConfig;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
@@ -283,7 +285,7 @@ public class TestUtil {
      * @param activity
      */
     public static void test(final Activity activity) {
-        final String[] items = {"复制token","复制打点数据","查看截图","复制imsi","小米游戏","测试可用金额","测试定位信息","测试apk的渠道","幂动科技","游戏搜索",
+        final String[] items = {"复制token","复制打点数据","loading","progress","查看截图","复制imsi","小米游戏","测试可用金额","测试定位信息","测试apk的渠道","幂动科技","游戏搜索",
                 "游戏帐号","游戏代充","尝试开启第三方应用使用情况","测试代理页面","第三方应用使用情况",
                 "开启第三方应用使用情况","h5跳转","新手对话框","md5","空间不足提示框",
                 "显示已经安装应用列表","复制faq地址","复制代理地址","复制世界杯地址","任务游戏列表","世界杯活动","交通银行信用卡测试",
@@ -295,6 +297,12 @@ public class TestUtil {
                     @Override
                     public void onClick(DialogInterface dialog, int which) {
                         switch (items[which]) {
+                            case "loading":
+                                DialogLoading.showDialog(activity);
+                                break;
+                            case "progress":
+                                DialogProgress.showDialog(activity);
+                                break;
                             case "查看截图":
                                 File root = DataUtil.getInstance().getScreenShotsDir();
                                 if(!root.exists() || root.listFiles().length <= 0){

+ 4 - 4
app/src/main/java/com/sheep/gamegroup/util/ViewUtil.java

@@ -810,10 +810,10 @@ public class ViewUtil {
             }
             mPd = new ProgressDialog(activity);
 //        View view= LayoutInflater.from(this).inflate(R.layout.dialog_layout,null);
-//        mPd.setContentView(view);//自己定义布局
+//        dialogShowLoading.setContentView(view);//自己定义布局
             mPd.setMessage("数据加载中...");
             mPd.setCancelable(true);//能否够被取消
-//        mPd.setProgressStyle(ProgressDialog.STYLE_SPINNER);//圆环风格
+//        dialogShowLoading.setProgressStyle(ProgressDialog.STYLE_SPINNER);//圆环风格
             mPd.show();
         } catch (Exception e) {
             e.printStackTrace();
@@ -826,10 +826,10 @@ public class ViewUtil {
             }
             mPd = new ProgressDialog(activity);
 //        View view= LayoutInflater.from(this).inflate(R.layout.dialog_layout,null);
-//        mPd.setContentView(view);//自己定义布局
+//        dialogShowLoading.setContentView(view);//自己定义布局
             mPd.setMessage("数据加载中...");
             mPd.setCancelable(cancel);//能否够被取消
-//        mPd.setProgressStyle(ProgressDialog.STYLE_SPINNER);//圆环风格
+//        dialogShowLoading.setProgressStyle(ProgressDialog.STYLE_SPINNER);//圆环风格
             mPd.show();
         } catch (Exception e) {
             e.printStackTrace();

+ 1 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/TaskDetailCreditCardAct.java

@@ -191,9 +191,8 @@ public class TaskDetailCreditCardAct extends AbsChooseImageActivity {
     }
 
     private void netTaskSchedule() {
-        if (mPd == null || !mPd.isShowing())
+        if (!isShowing())
             showProgress();
-
         getDetail();
     }
 

+ 13 - 4
app/src/main/java/com/sheep/gamegroup/view/dialog/DialogShowLoading.java

@@ -8,18 +8,27 @@ import android.widget.TextView;
 import com.kfzs.duanduan.utils.dlg.ViewFindUtils;
 import com.sheep.jiuyan.samllsheep.R;
 
-public class DialogShowLoading {
+/**
+ * 用于加载中对话框
+ * Created by realicing on 2018/08/09.
+ * realicing@sina.com
+ */
+public class DialogLoading {
     private TextView textView;
     private AlertDialog alertDialog;
 
-    public static DialogShowLoading showDialog(final Activity activity) {
-        DialogShowLoading dialogShowLoading= new DialogShowLoading();
-        View view = View.inflate(activity, R.layout.dialog_show_loading, null);
+    public static DialogLoading showDialog(final Activity activity) {
+        return showDialog(activity, true);
+    }
+    public static DialogLoading showDialog(Activity activity, boolean cancelable) {
+        DialogLoading dialogShowLoading= new DialogLoading();
+        View view = View.inflate(activity, R.layout.dialog_loading, null);
         TextView dialog_loading = ViewFindUtils.find(view, R.id.dialog_loading);
         AlertDialog mAlertDialog = new AlertDialog.Builder(activity, R.style.MyDialogActivityTheme)
                 .setView(view)
                 .create();
         dialogShowLoading.setAlertDialog(mAlertDialog);
+        mAlertDialog.setCancelable(cancelable);
         try {
             mAlertDialog.show();
         } catch (Exception e) {

+ 56 - 0
app/src/main/java/com/sheep/gamegroup/view/dialog/DialogProgress.java

@@ -0,0 +1,56 @@
+package com.sheep.gamegroup.view.dialog;
+
+import android.app.Activity;
+import android.support.v7.app.AlertDialog;
+import android.view.View;
+import android.widget.TextView;
+
+import com.kfzs.duanduan.utils.dlg.ViewFindUtils;
+import com.sheep.jiuyan.samllsheep.R;
+
+/**
+ * 用于百分比对话框(文字在图片中间)
+ * Created by realicing on 2018/08/09.
+ * realicing@sina.com
+ */
+public class DialogProgress {
+    private TextView textView;
+    private AlertDialog alertDialog;
+
+    public static DialogProgress showDialog(final Activity activity) {
+        return showDialog(activity, true);
+    }
+    public static DialogProgress showDialog(Activity activity, boolean cancelable) {
+        DialogProgress dialogShowLoading= new DialogProgress();
+        View view = View.inflate(activity, R.layout.dialog_progress, null);
+        TextView dialog_loading = ViewFindUtils.find(view, R.id.dialog_progress);
+        AlertDialog mAlertDialog = new AlertDialog.Builder(activity, R.style.MyDialogActivityTheme)
+                .setView(view)
+                .create();
+        mAlertDialog.setCancelable(cancelable);
+        dialogShowLoading.setAlertDialog(mAlertDialog);
+        try {
+            mAlertDialog.show();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        dialogShowLoading.setTextView(dialog_loading);
+        return dialogShowLoading;
+    }
+
+    public TextView getTextView() {
+        return textView;
+    }
+
+    public void setTextView(TextView textView) {
+        this.textView = textView;
+    }
+
+    public AlertDialog getAlertDialog() {
+        return alertDialog;
+    }
+
+    public void setAlertDialog(AlertDialog alertDialog) {
+        this.alertDialog = alertDialog;
+    }
+}

+ 16 - 24
app/src/main/java/com/sheep/jiuyan/samllsheep/base/BaseFragment.java

@@ -1,6 +1,5 @@
 package com.sheep.jiuyan.samllsheep.base;
 
-import android.app.ProgressDialog;
 import android.os.Bundle;
 import android.support.annotation.IdRes;
 import android.support.annotation.Nullable;
@@ -9,6 +8,8 @@ import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 
+import com.sheep.gamegroup.view.dialog.DialogLoading;
+
 /**
  * @ Created by Dlg
  * @ <p>TiTle:  BaseFragment</p>
@@ -25,40 +26,31 @@ public abstract class BaseFragment extends Fragment {
      */
     protected boolean mIsFirstInit = true;
 
-    protected ProgressDialog mPd;
+    protected DialogLoading dialogLoading;
 
 
 
     protected void  showProgress(){
-        if(mPd!=null){
-            hideProgress();
-        }
-        mPd = new ProgressDialog(getActivity());
-//        View view= LayoutInflater.from(this).inflate(R.layout.dialog_layout,null);
-//        mPd.setContentView(view);//自己定义布局
-        mPd.setMessage("数据加载中...");
-        mPd.setCancelable(true);//能否够被取消
-//        mPd.setProgressStyle(ProgressDialog.STYLE_SPINNER);//圆环风格
-        mPd.show();
+        hideProgress();
+        dialogLoading = DialogLoading.showDialog(getActivity());
     }
 
     protected void  showProgress(boolean cancel){
-        if(mPd!=null){
-            hideProgress();
-        }
-        mPd = new ProgressDialog(getActivity());
-//        View view= LayoutInflater.from(this).inflate(R.layout.dialog_layout,null);
-//        mPd.setContentView(view);//自己定义布局
-        mPd.setMessage("数据加载中...");
-        mPd.setCancelable(cancel);//能否够被取消
-//        mPd.setProgressStyle(ProgressDialog.STYLE_SPINNER);//圆环风格
-        mPd.show();
+        hideProgress();
+        dialogLoading = DialogLoading.showDialog(getActivity(), cancel);
     }
 
+    public boolean isShowing(){
+        return dialogLoading != null && dialogLoading.getAlertDialog() != null && dialogLoading.getAlertDialog().isShowing();
+    }
 
     protected void  hideProgress(){
-        if(mPd!=null){
-            mPd.dismiss();
+        if(isShowing()){
+            try {
+                dialogLoading.getAlertDialog().dismiss();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
         }
 
     }

+ 31 - 0
app/src/main/res/layout/dialog_loading.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <LinearLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:gravity="center"
+        android:orientation="horizontal">
+
+        <com.github.ybq.android.spinkit.SpinKitView
+            style="@style/SpinKitView.Large.ThreeBounce"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            app:SpinKit_Color="@color/colorAccent" />
+
+        <TextView
+            android:id="@+id/dialog_loading"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="@dimen/content_padding_10"
+            android:gravity="center"
+            android:text="@string/data_loading"
+            android:visibility="gone"
+            android:textColor="@color/theme_app_info_dark"
+            android:textSize="14sp" />
+    </LinearLayout>
+</FrameLayout>

+ 30 - 0
app/src/main/res/layout/dialog_progress.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <RelativeLayout
+        android:layout_width="100dp"
+        android:layout_height="100dp"
+        android:layout_gravity="center"
+        android:orientation="vertical">
+
+        <com.github.ybq.android.spinkit.SpinKitView
+            style="@style/SpinKitView.Large.Circle"
+            android:layout_width="100dp"
+            android:layout_height="100dp"
+            android:layout_centerInParent="true"
+            app:SpinKit_Color="@color/colorAccent" />
+
+        <TextView
+            android:id="@+id/dialog_progress"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerInParent="true"
+            android:gravity="center"
+            android:text="0%"
+            android:textColor="@color/theme_app_info_dark"
+            android:textSize="20sp" />
+    </RelativeLayout>
+</FrameLayout>

+ 0 - 28
app/src/main/res/layout/dialog_show_loading.xml

@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-        <RelativeLayout
-            android:layout_width="100dp"
-            android:layout_height="100dp"
-            android:layout_gravity="center"
-            android:orientation="vertical">
-
-            <ImageView
-                android:layout_width="100dp"
-                android:layout_height="100dp"
-                android:layout_centerInParent="true"
-                android:src="@drawable/loading_01"/>
-
-            <TextView
-                android:id="@+id/dialog_loading"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:textColor="@color/theme_app_info_dark"
-                android:layout_centerInParent="true"
-                android:textSize="20sp"
-                android:gravity="center"
-                android:text="0%"/>
-        </RelativeLayout>
-</FrameLayout>

+ 1 - 1
app/src/main/res/values/common.xml

@@ -3,7 +3,7 @@
     <!--APP的相关主要颜色值-->
     <color name="colorPrimary">@color/white_DEDEDE</color>
     <color name="colorPrimaryDark">@color/blue_FF53BBF2</color>
-    <color name="colorAccent">#FF842C</color>
+    <color name="colorAccent">#29d6fd</color>
     <!--APP中的文本颜色主要值-->
     <color name="black_text_deep">#333333</color>
     <color name="black_text_gray">#898989</color>

+ 1 - 0
app/src/main/res/values/str_network_strings.xml

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
     <string name="coming_soon">敬请期待</string>
+    <string name="data_loading">数据加载中&#8230;</string>
     <string name="loading">加载中</string>
     <string name="loading_data">数据正在加载中,请稍候重试</string>
     <string name="service_data_error">数据配置中,请稍候再试</string>

+ 0 - 276
view/src/main/java/com/kfzs/android/view/UXUtils.java

@@ -1,276 +0,0 @@
-package com.kfzs.android.view;
-
-import android.app.Activity;
-import android.app.ProgressDialog;
-import android.content.Context;
-import android.os.Handler;
-import android.os.Looper;
-import android.support.annotation.StringRes;
-import android.text.TextUtils;
-import android.util.Log;
-import android.widget.Toast;
-
-/**
- * UX Utils for Fast request default time is 3000 ms, you can set custom time and isCustomTime be true
- * <pre>
- *     sinlov
- *
- *     /\__/\
- *    /`    '\
- *  ≈≈≈ 0  0 ≈≈≈ Hello world!
- *    \  --  /
- *   /        \
- *  /          \
- * |            |
- *  \  ||  ||  /
- *   \_oo__oo_/≡≡≡≡≡≡≡≡o
- *
- * </pre>
- * Created by sinlov on 17/1/17.
- */
-public final class UXUtils {
-    public static boolean DEBUG = false;
-    public static boolean isShowDefaultUXMessage = true;
-    public static final long DEFAULT_TIME_SHOT = 3000;
-    private static long customTime = 5000;
-    private static String TAG = "UXUtils";
-    private static StringBuffer sb = new StringBuffer();
-
-    private static long lastClickTime;
-    private static long oneTime;
-
-    private static long twoTime;
-    private static String oldMsg;
-    private static Toast toast;
-    private static ProgressDialog pd;
-
-    public static void setIsShowDefaultUXMessage(boolean isShowDefaultUXMessage) {
-        UXUtils.isShowDefaultUXMessage = isShowDefaultUXMessage;
-    }
-
-    /**
-     * default time is 5000 ms
-     *
-     * @param customTime long
-     */
-    public static void setCustomTime(long customTime) {
-        UXUtils.customTime = customTime;
-    }
-
-    public static boolean fastRequest() {
-        return fastRequest(false);
-    }
-
-    public static boolean fastRequest(boolean isCustomTime) {
-        return fastRequest(isCustomTime, null, null);
-    }
-
-    public static boolean fastRequest(Context ctx) {
-        return fastRequest(false, ctx, null);
-    }
-
-    public static boolean fastRequest(Context ctx, String toastMsg) {
-        return fastRequest(false, ctx, toastMsg);
-    }
-
-    public static boolean fastRequest(boolean isCustomTime, Context ctx, String toastMsg) {
-        long checkTime = System.currentTimeMillis() - UXUtils.lastClickTime;
-        printMultiLog("fastRequest", "checkTime: " + checkTime);
-        long betweenTIme = isCustomTime ? customTime : DEFAULT_TIME_SHOT;
-        if (checkTime < betweenTIme) {
-            if (null != ctx) {
-                if (!TextUtils.isEmpty(toastMsg)) {
-                    showSingleToast(ctx.getApplicationContext(), toastMsg);
-                } else {
-                    if (isShowDefaultUXMessage) {
-                        showSingleToast(ctx.getApplicationContext(), R.string.toast_fast_request);
-                    }
-                }
-            }
-            printMultiLog("fastRequest", "true time: " + UXUtils.lastClickTime, "between: " + checkTime);
-            return true;
-        } else {
-            UXUtils.lastClickTime = System.currentTimeMillis();
-            printMultiLog("fastRequest", "false time: " + UXUtils.lastClickTime);
-            return false;
-        }
-    }
-
-    public static boolean fastRequestShowProgressDialog(Context ctx) {
-        return fastRequestShowProgressDialog(ctx, false);
-    }
-
-    public static boolean fastRequestShowProgressDialog(Context ctx, String msg) {
-        return fastRequestShowProgressDialog(ctx, msg, false);
-    }
-
-    public static boolean fastRequestShowProgressDialog(Context ctx, boolean isCustomTime) {
-        return fastRequestShowProgressDialog(ctx, null, isCustomTime);
-    }
-
-    public static boolean fastRequestShowProgressDialog(Context ctx, String msg, boolean isCustomTime) {
-        long checkTime = System.currentTimeMillis() - UXUtils.lastClickTime;
-        printMultiLog("fastRequestShowProgressDialog", "checkTime: " + checkTime);
-        long betweenTIme = isCustomTime ? customTime : DEFAULT_TIME_SHOT;
-        if (checkTime < betweenTIme) {
-            printMultiLog("fastRequestShowProgressDialog", "checkTime: " + checkTime, "betweenTime: " + betweenTIme);
-            try {
-                if (null != ctx) {
-                    if (pd == null) {
-                        pd = new ProgressDialog(ctx);
-                        pd.setProgressStyle(ProgressDialog.STYLE_SPINNER);
-                        if (TextUtils.isEmpty(msg)) {
-                            if (isShowDefaultUXMessage) {
-                                pd.setMessage(ctx.getString(R.string.dialog_fast_request));
-                            }
-                        } else {
-                            pd.setMessage(msg);
-                        }
-                        pd.setCancelable(false);
-                        pd.setCanceledOnTouchOutside(false);
-                        showProgressDialog2AutoClose(betweenTIme);
-                    } else if (pd.isShowing()) {
-                        showProgressDialog2AutoClose(betweenTIme);
-                    }
-                } else {
-                    printMultiLog("show fastRequestShowProgressDialog null context");
-                }
-            } catch (Exception e) {
-                printMultiLog("show fastRequestShowProgressDialog error");
-                e.printStackTrace();
-            }
-            return true;
-        } else {
-            UXUtils.lastClickTime = System.currentTimeMillis();
-            printMultiLog("fastRequestShowProgressDialog", "false time: " + UXUtils.lastClickTime);
-            return false;
-        }
-    }
-
-    /**
-     * this dialog must use {@link UXUtilsAdapter#unLock()} to close or in uxUtilsAdapter close
-     *
-     * @param act            {@link Activity}
-     * @param uxUtilsAdapter {@link UXUtilsAdapter}
-     */
-    public static void showProgressDialog(Activity act, UXUtilsAdapter uxUtilsAdapter) {
-        showProgressDialog(act, uxUtilsAdapter, null);
-    }
-
-    /**
-     * this dialog must use {@link UXUtilsAdapter#unLock()} to close or in uxUtilsAdapter close
-     *
-     * @param act            {@link Activity}
-     * @param uxUtilsAdapter {@link UXUtilsAdapter}
-     * @param msg            {@link String}
-     */
-    public static void showProgressDialog(Activity act, UXUtilsAdapter uxUtilsAdapter, String msg) {
-        try {
-            if (null != act) {
-                ProgressDialog touchPD = new ProgressDialog(act);
-                touchPD.setProgressStyle(ProgressDialog.STYLE_SPINNER);
-                if (TextUtils.isEmpty(msg)) {
-                    if (isShowDefaultUXMessage) {
-                        touchPD.setMessage(act.getString(R.string.dialog_fast_request));
-                    }
-                } else {
-                    touchPD.setMessage(msg);
-                }
-                touchPD.setCancelable(false);
-                touchPD.setCanceledOnTouchOutside(false);
-                touchPD.show();
-                uxUtilsAdapter.lock();
-                uxUtilsAdapter.setPd(touchPD);
-                uxUtilsAdapter.doProgressDialog(touchPD);
-            } else {
-                throw new NullPointerException("show showProgressDialog null Activity");
-            }
-        } catch (Exception e) {
-            Log.e(TAG, "You are use in error showProgressDialog, it can be OOM! please fix!", e);
-        }
-    }
-
-    private static void showProgressDialog2AutoClose(long betweenTIme) {
-        pd.show();
-        new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
-            @Override
-            public void run() {
-                printMultiLog("fastRequestShowProgressDialog", "auto close start");
-                if (pd != null) {
-                    printMultiLog("fastRequestShowProgressDialog", "do auto close");
-                    pd.hide();
-                }
-                printMultiLog("fastRequestShowProgressDialog", "auto close end");
-            }
-        }, betweenTIme);
-    }
-
-    public static void showSingleToast(Context ctx, @StringRes int msgID) {
-        showSingleToast(ctx, msgID, 0);
-    }
-
-    public static void showSingleToast(Context ctx, @StringRes int msgID, int duration) {
-        String msg = ctx.getString(msgID);
-        int showDuration = duration <= Toast.LENGTH_SHORT ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT;
-        if (null == toast) {
-            toast = Toast.makeText(ctx.getApplicationContext(), msgID, showDuration);
-            toast.show();
-            oneTime = System.currentTimeMillis();
-        } else {
-            twoTime = System.currentTimeMillis();
-            if (msg.equals(oldMsg)) {
-                if (twoTime - oneTime > showDuration) {
-                    toast.show();
-                }
-            } else {
-                oldMsg = msg;
-                toast.setText(msg);
-                toast.show();
-            }
-        }
-        oneTime = twoTime;
-    }
-
-    public static void showSingleToast(Context ctx, String msg) {
-        showSingleToast(ctx, msg, 0);
-    }
-
-    public static void showSingleToast(Context ctx, String msg, int duration) {
-        int showDuration = duration <= Toast.LENGTH_SHORT ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT;
-        if (null == toast) {
-            toast = Toast.makeText(ctx.getApplicationContext(), msg, showDuration);
-            toast.show();
-            oneTime = System.currentTimeMillis();
-        } else {
-            twoTime = System.currentTimeMillis();
-            if (msg.equals(oldMsg)) {
-                if (twoTime - oneTime > showDuration) {
-                    toast.show();
-                }
-            } else {
-                oldMsg = msg;
-                toast.setText(msg);
-                toast.show();
-            }
-        }
-        oneTime = twoTime;
-    }
-
-    public static void printMultiLog(String... msg) {
-        if (msg != null && DEBUG) {
-            sb.setLength(0);
-            if (msg.length > 0) {
-                for (String aMsg : msg) {
-                    sb.append(aMsg);
-                    sb.append(" ");
-                }
-            } else {
-                sb.append("empty printMultiLog please check");
-            }
-            Log.d(TAG, sb.toString());
-        }
-    }
-
-    private UXUtils() {
-    }
-}