mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-14 21:18:56 +01:00
Hiding the keyboard (#8160)
* Hiding the keyboard (#8157) * Cleanup * Adding log * cleanup * moving code to ViewExtensions.kt * TrackDialog keyboard fix? * moving code to ContextExtensions.kt * MoreScreen: Remove title (#8158) * MoreScreen: Remove title Also removes the state banners as it's redundant * Add back banners * Allow manual selection of manga description instead of copying to clipboard Closes #6548 Notably missing some "standard" options like "Select all" or "Share": https://issuetracker.google.com/issues/226648919 * Allow marking partially read chapters as unread Closes #3777 * Tablet UI edge-to-edge tweaks (#8159) * LibraryScreen: Tweak content padding application to draw under nav bar * BrowseScreen: Tweak content padding application to draw under nav bar Side note the tab content doesn't actually use its scaffold (bottom) contentPadding so it's definitely will be a headache in the future. * Don't hardcode bottom nav padding * removed unnecessary import * refactoring code * rewriting code * cleanup? * cleanup Co-authored-by: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com> Co-authored-by: arkon <eugcheung94@gmail.com>
This commit is contained in:
@@ -24,6 +24,7 @@ import android.util.TypedValue
|
||||
import android.view.Display
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import androidx.annotation.AttrRes
|
||||
import androidx.annotation.ColorInt
|
||||
import androidx.appcompat.view.ContextThemeWrapper
|
||||
@@ -185,6 +186,9 @@ val Context.powerManager: PowerManager
|
||||
val Context.keyguardManager: KeyguardManager
|
||||
get() = getSystemService()!!
|
||||
|
||||
val Context.inputMethodManager: InputMethodManager
|
||||
get() = getSystemService()!!
|
||||
|
||||
val Context.displayCompat: Display?
|
||||
get() = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
display
|
||||
|
||||
@@ -37,6 +37,7 @@ import com.google.android.material.snackbar.Snackbar
|
||||
import eu.kanade.presentation.theme.TachiyomiTheme
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||
import eu.kanade.tachiyomi.util.system.inputMethodManager
|
||||
|
||||
inline fun ComposeView.setComposeContent(crossinline content: @Composable () -> Unit) {
|
||||
consumeWindowInsets = false
|
||||
@@ -209,3 +210,7 @@ fun View?.isVisibleOnScreen(): Boolean {
|
||||
val screen = Rect(0, 0, Resources.getSystem().displayMetrics.widthPixels, Resources.getSystem().displayMetrics.heightPixels)
|
||||
return actualPosition.intersect(screen)
|
||||
}
|
||||
|
||||
fun View.hideKeyboard() {
|
||||
context.inputMethodManager.hideSoftInputFromWindow(windowToken, 0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user