From 979d9cff22806f213b420452ab4a68fcbaf021b6 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 31 五月 2021 17:43:49 +0800
Subject: [PATCH] 1. 修复多项可能引起空指针崩溃的bug; 2. 新建子任务时默认执行人员从全体人员改为当前用户; 3. 新建子任务时默认执行时间强制固定为总任务对应的时段内,确保子任务执行时间不会超出总任务范围。
---
app/src/main/java/cn/flightfeather/thirdapp/util/DialogUtil2.kt | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/app/src/main/java/cn/flightfeather/thirdapp/util/DialogUtil2.kt b/app/src/main/java/cn/flightfeather/thirdapp/util/DialogUtil2.kt
index a866f6c..4bef372 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/util/DialogUtil2.kt
+++ b/app/src/main/java/cn/flightfeather/thirdapp/util/DialogUtil2.kt
@@ -21,6 +21,29 @@
*/
object DialogUtil2 {
+ fun showLoadingDialog(context: Context, message: CharSequence?, cancelable: Boolean, cancelListener: DialogInterface.OnCancelListener?): Dialog? {
+ val dialog = Dialog(context)
+ val view = LayoutInflater.from(context).inflate(R.layout.layout_loading, null)
+ dialog.setContentView(view)
+ if (message.isNullOrBlank()) {
+ view.findViewById<TextView>(R.id.txt_tip).visibility = View.GONE
+ } else {
+ view.findViewById<TextView>(R.id.txt_tip).apply {
+ visibility = View.VISIBLE
+ text = message
+ }
+ }
+ dialog.setCanceledOnTouchOutside(false)
+ dialog.setCancelable(cancelable)
+ dialog.setOnCancelListener(cancelListener)
+ dialog.window?.attributes?.gravity = Gravity.CENTER
+ val lp = dialog.window?.attributes
+ lp?.dimAmount = 0.2f
+ dialog.window?.attributes = lp
+ dialog.show()
+ return dialog
+ }
+
fun showAlertDialog(
context: Context?,
content: String,
--
Gitblit v1.9.3