feat: Hide keyboard on opening ImageViewerScreen

This commit is contained in:
k1ngsterr1
2026-01-29 20:59:12 +05:00
parent 9afd9c1d67
commit 5d1ba8144f

View File

@@ -31,6 +31,8 @@ import androidx.compose.ui.input.pointer.*
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalView
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.IntOffset
@@ -97,6 +99,15 @@ fun ImageViewerScreen(
val scope = rememberCoroutineScope()
val context = LocalContext.current
val view = LocalView.current
val focusManager = LocalFocusManager.current
// Закрываем клавиатуру при открытии
LaunchedEffect(Unit) {
val imm = context.getSystemService(android.content.Context.INPUT_METHOD_SERVICE) as android.view.inputmethod.InputMethodManager
imm.hideSoftInputFromWindow(view.windowToken, 0)
focusManager.clearFocus()
}
// Pager state
val pagerState = rememberPagerState(