Skip to content

Instantly share code, notes, and snippets.

View Artemius-dev's full-sized avatar
🏠
Working from home

Artemius-dev

🏠
Working from home
View GitHub Profile
@bmc08gt
bmc08gt / 1_Keyboard.kt
Last active May 13, 2025 13:34
KMP Software Keyboard Controller
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.compose.ui.platform.SoftwareKeyboardController
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
public abstract class KeyboardController(
@abd3lraouf
abd3lraouf / KeyboardVisibilityDetector.kt
Last active February 5, 2026 14:33
Android Compose Keyboard Visibility Detector: A Jetpack Compose implementation to detect the visibility of the software keyboard in an Android app. This example demonstrates the use of WindowInsets and isImeVisible in a simple Compose layout
package dev.abd3lraouf.learn.myapplication
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxSize