SoftKeyboardController

Controller for managing soft keyboard operations using InputMethodManager and WindowInsets.

InputMethodManager와 WindowInsets를 사용하여 소프트 키보드 동작을 관리하는 컨트롤러입니다.

Important contract / 핵심 계약:

  • show()/hide() return request-level result only.

  • showDelay()/hideDelay() return queue registration result only.

  • showAwait()/hideAwait() return actual visibility result (Success, Timeout, Failure).

  • showAwaitAsync() returns deferred actual visibility result and never returns null.

  • hideAwaitAsync() returns deferred actual visibility result and may return null on off-main call or scheduling failure.

  • show()/hide()는 요청 전달 수준 결과만 반환합니다.

  • showDelay()/hideDelay()는 큐 등록 성공 여부만 반환합니다.

  • showAwait()/hideAwait()는 실제 가시성 결과(Success, Timeout, Failure)를 반환합니다.

  • showAwaitAsync()는 실제 가시성 결과를 담은 Deferred를 반환하며 null을 반환하지 않습니다.

  • hideAwaitAsync()는 실제 가시성 결과를 담은 Deferred를 반환하며 오프메인 호출 또는 스케줄링 실패 시 null을 반환할 수 있습니다.

Constructors

Link copied to clipboard
constructor(context: Context)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun configureImeResize(window: Window, policy: SoftKeyboardResizePolicy = SoftKeyboardResizePolicy.KEEP_CURRENT_WINDOW): Boolean

Configures resize behavior with explicit policy.

명시적 정책으로 키보드 resize 동작을 설정합니다.

Link copied to clipboard

Gets information about required permissions and their status.

필요한 권한과 그 상태에 대한 정보를 가져옵니다.

Link copied to clipboard
fun hide(v: View, flag: Int = 0): Boolean

Hides the soft keyboard from input-capable views.

입력 가능한 뷰에서 소프트 키보드 숨김을 요청합니다. 실제 가시성 확인이 필요하면 hideAwait*를 사용하세요.

Link copied to clipboard
suspend fun hideAwait(v: View, delayMillis: Long = 0, flag: Int = 0, timeoutMillis: Long = DEFAULT_IME_VISIBILITY_TIMEOUT_MS): SoftKeyboardActionResult

Hides keyboard and waits for actual IME visibility result.

키보드 숨김을 요청하고 실제 IME 가시성 결과까지 대기합니다. Timeout은 제한 시간 내 미관측을 의미하며 영구 실패를 뜻하지는 않습니다.

Link copied to clipboard
fun hideAwaitAsync(v: View, coroutineScope: CoroutineScope, delayMillis: Long = 0, flag: Int = 0, timeoutMillis: Long = DEFAULT_IME_VISIBILITY_TIMEOUT_MS): Deferred<SoftKeyboardActionResult>?

Async wrapper of hideAwait. Returns Deferred result that can be cancelled.

hideAwait의 비동기 래퍼입니다. 취소 가능한 Deferred 결과를 반환합니다.

Link copied to clipboard
fun hideDelay(v: View, delay: Long, flag: Int = 0): Boolean

Schedules delayed keyboard hide and returns queue registration status.

지연 키보드 숨김을 예약하고 메시지 큐 등록 결과를 반환합니다. 실제 숨김 결과는 포함하지 않습니다.

Link copied to clipboard

Checks if a specific permission is granted.

특정 권한이 부여되었는지 확인합니다.

Link copied to clipboard
open fun onDestroy()

Called when the service is being destroyed. Override to perform cleanup.

서비스가 소멸될 때 호출됩니다. 정리 작업을 수행하려면 재정의하세요.

Link copied to clipboard

Refreshes the permission status. Call this after requesting permissions.

권한 상태를 새로고침합니다. 권한 요청 후 이를 호출하세요.

Link copied to clipboard

Sets window soft input mode to adjust pan.

윈도우 소프트 입력 모드를 adjust pan으로 설정합니다.

Link copied to clipboard

Configures keyboard resize behavior with safe default policy.

안전한 기본 정책으로 키보드 resize 동작을 설정합니다.

Link copied to clipboard
fun setSoftInputMode(window: Window, softInputTypes: Int): Boolean

Sets custom soft input mode for the window.

윈도우에 사용자 정의 소프트 입력 모드를 설정합니다.

Link copied to clipboard
fun show(v: View, flag: Int = InputMethodManager.SHOW_IMPLICIT): Boolean

Shows the soft keyboard for input-capable views.

입력 가능한 뷰에 소프트 키보드 표시를 요청합니다. 실제 가시성 확인이 필요하면 showAwait*를 사용하세요.

Link copied to clipboard
suspend fun showAwait(v: View, delayMillis: Long = 0, flag: Int = InputMethodManager.SHOW_IMPLICIT, timeoutMillis: Long = DEFAULT_IME_VISIBILITY_TIMEOUT_MS): SoftKeyboardActionResult

Shows keyboard and waits for actual IME visibility result.

키보드 표시를 요청하고 실제 IME 가시성 결과까지 대기합니다. Timeout은 제한 시간 내 미관측을 의미하며 영구 실패를 뜻하지는 않습니다.

Link copied to clipboard
fun showAwaitAsync(v: View, coroutineScope: CoroutineScope, delayMillis: Long = 0, flag: Int = InputMethodManager.SHOW_IMPLICIT, timeoutMillis: Long = DEFAULT_IME_VISIBILITY_TIMEOUT_MS): Deferred<SoftKeyboardActionResult>

Async wrapper of showAwait. Returns a non-null Deferred result that can be cancelled.

showAwait의 비동기 래퍼입니다. 취소 가능한 non-null Deferred 결과를 반환합니다.

Link copied to clipboard
fun showDelay(v: View, delay: Long, flag: Int = InputMethodManager.SHOW_IMPLICIT): Boolean

Schedules delayed keyboard show and returns queue registration status.

지연 키보드 표시를 예약하고 메시지 큐 등록 결과를 반환합니다. 실제 표시 결과는 포함하지 않습니다.

Link copied to clipboard

Starts stylus handwriting mode for the given view.

지정된 뷰에 대해 스타일러스 필기 모드를 시작합니다.

Starts stylus handwriting mode after a delay.

지연 시간 후 스타일러스 필기 모드를 시작합니다.