| | |
| | | import com.cazaea.sweetalert.SweetAlertDialog; |
| | | |
| | | import cn.flightfeather.thirdapp.R; |
| | | import cn.flightfeather.thirdapp.module.base.BaseDialog; |
| | | |
| | | /** |
| | | * Created by feiyu on 2018/8/3. |
| | |
| | | |
| | | public class DialogUtil { |
| | | |
| | | public static Dialog createLoadingDialog(Context context, String msg) { |
| | | public static BaseDialog createLoadingDialog(Context context, String msg) { |
| | | LayoutInflater inflater = LayoutInflater.from(context); |
| | | View v = inflater.inflate(R.layout.layout_loading, null);// 得到加载view |
| | | LinearLayout layout = (LinearLayout) v |
| | |
| | | // TextView tipTextView = (TextView) v.findViewById(R.id.tipTextView);// 提示文字 |
| | | // tipTextView.setTitle(msg);// 设置加载信息 |
| | | |
| | | Dialog loadingDialog = new Dialog(context);// 创建自定义样式dialog |
| | | BaseDialog loadingDialog = new BaseDialog(context);// 创建自定义样式dialog |
| | | loadingDialog.setCancelable(false); // 是否可以按“返回键”消失 |
| | | loadingDialog.setCanceledOnTouchOutside(false); // 点击加载框以外的区域 |
| | | loadingDialog.setContentView(layout, new LinearLayout.LayoutParams( |
| | |
| | | return loadingDialog; |
| | | } |
| | | |
| | | public static Dialog create(Context context, @LayoutRes int id) { |
| | | Dialog dialog = new Dialog(context); |
| | | public static BaseDialog create(Context context, @LayoutRes int id) { |
| | | BaseDialog dialog = new BaseDialog(context); |
| | | dialog.setContentView(id); |
| | | //设置dialog宽度 |
| | | Window dialogWindow = dialog.getWindow(); |