diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatActivity.kt b/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatActivity.kt index c0b58d567..42a9e6f59 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatActivity.kt +++ b/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatActivity.kt @@ -1,9 +1,12 @@ package com.topjohnwu.magisk.redesign.compat +import android.app.Activity import android.content.Intent import android.os.Bundle import android.view.View import android.view.ViewGroup +import android.view.inputmethod.InputMethodManager +import androidx.core.content.getSystemService import androidx.databinding.OnRebindCallback import androidx.databinding.ViewDataBinding import androidx.fragment.app.Fragment @@ -17,6 +20,7 @@ import com.topjohnwu.magisk.model.navigation.MagiskNavigationEvent import com.topjohnwu.magisk.model.navigation.Navigator import kotlin.reflect.KClass + abstract class CompatActivity : BaseActivity(), CompatView, Navigator { @@ -78,4 +82,11 @@ abstract class CompatActivity() + ?.hideSoftInputFromWindow(view.windowToken, 0) + view.clearFocus() } \ No newline at end of file diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatFragment.kt b/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatFragment.kt index f7eb35d72..6c9c90352 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/redesign/compat/CompatFragment.kt @@ -5,6 +5,7 @@ import android.view.View import android.view.ViewGroup import androidx.databinding.OnRebindCallback import androidx.databinding.ViewDataBinding +import androidx.fragment.app.Fragment import com.topjohnwu.magisk.base.BaseFragment import com.topjohnwu.magisk.extensions.startAnimations import com.topjohnwu.magisk.model.events.ViewEvent @@ -48,4 +49,8 @@ abstract class CompatFragment() { MotionRevealHelper.withViews(binding.hideFilter, binding.hideFilterToggle, true) } binding.hideFilterInclude.hideFilterDone.setOnClickListener { + hideKeyboard() MotionRevealHelper.withViews(binding.hideFilter, binding.hideFilterToggle, false) }