| package com.doumee.lib_coremodel.base; | 
|   | 
| import android.app.Dialog; | 
| import android.content.Context; | 
| import android.view.Gravity; | 
|   | 
| import androidx.annotation.NonNull; | 
|   | 
| import com.doumee.lib_coremodel.R; | 
|   | 
|   | 
| /** | 
|  * @author <a href="mailto:jenly1314@gmail.com">Jenly</a> | 
|  */ | 
| public class BaseProgressDialog extends Dialog { | 
|   | 
|     public static BaseProgressDialog newInstance(Context context) { | 
|         return new BaseProgressDialog(context); | 
|     } | 
|   | 
|     public BaseProgressDialog(@NonNull Context context) { | 
|         this(context, R.style.mvvmframe_progress_dialog); | 
|     } | 
|   | 
|     public BaseProgressDialog(@NonNull Context context, int themeResId) { | 
|         super(context, themeResId); | 
|         initUI(); | 
|     } | 
|   | 
|     public BaseProgressDialog(@NonNull Context context, boolean cancelable, OnCancelListener cancelListener) { | 
|         super(context, cancelable, cancelListener); | 
|         initUI(); | 
|     } | 
|   | 
|     private void initUI() { | 
|         getWindow().getAttributes().gravity = Gravity.CENTER; | 
|         setCanceledOnTouchOutside(false); | 
|     } | 
|   | 
| } |