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/module/base/BaseActivity.kt |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/app/src/main/java/cn/flightfeather/thirdapp/module/base/BaseActivity.kt b/app/src/main/java/cn/flightfeather/thirdapp/module/base/BaseActivity.kt
index bcd8e5d..87c3ad2 100644
--- a/app/src/main/java/cn/flightfeather/thirdapp/module/base/BaseActivity.kt
+++ b/app/src/main/java/cn/flightfeather/thirdapp/module/base/BaseActivity.kt
@@ -1,6 +1,7 @@
 package cn.flightfeather.thirdapp.module.base
 
 import android.annotation.SuppressLint
+import android.app.Activity
 import android.content.Context
 import android.content.Intent
 import android.content.pm.ActivityInfo
@@ -12,6 +13,9 @@
 import android.support.v7.widget.Toolbar
 import android.view.MenuItem
 import android.view.ViewGroup
+import android.view.inputmethod.InputMethodManager
+import com.bumptech.glide.Glide
+import com.bumptech.glide.util.Util
 import io.reactivex.disposables.Disposable
 import org.greenrobot.eventbus.EventBus
 
@@ -48,6 +52,7 @@
                 it.dispose()
             }
         }
+                Glide.with(applicationContext).pauseRequests()
         super.onDestroy()
     }
 
@@ -75,3 +80,14 @@
 inline fun FragmentManager.inTransaction(func: FragmentTransaction.() -> FragmentTransaction) {
     beginTransaction().func().commit()
 }
+
+/**
+ * 鎷撳睍fragment涓殣钘忚蒋閿洏鐨勬柟娉�
+ */
+fun Activity.hideKeyboard() {
+    this.window?.peekDecorView()?.let {
+        val inputManager =
+                this.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
+        inputManager.hideSoftInputFromWindow(it.windowToken, 0)
+    }
+}

--
Gitblit v1.9.3