From e102578ebfc95c27aeb13dce13fb82af53a2bead Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 25 二月 2021 17:07:23 +0800
Subject: [PATCH] 1. 新增夜间施工查询界面 2. 新增夜间施工管理统计界面
---
app/src/main/java/cn/flightfeather/thirdapp/module/base/BaseActivity.kt | 13 +++++++++++++
1 files changed, 13 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 739b530..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,7 @@
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
@@ -78,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