Skip to content

Instantly share code, notes, and snippets.

View Lighter955's full-sized avatar

Light Lighter955

  • 中国,云南
  • 00:31 (UTC +08:00)
View GitHub Profile
@KONFeature
KONFeature / ComposeOverlayViewService.kt
Created June 28, 2022 21:34
Service ready to display complete view (with the right context to access the window manager and layout inflater if needed, but also access to a saved state registry and a view model store owner). Then a compose overlay service, that use the first one to push a compose view as system overlay, and also proposing a simple draggable box that can be …
import android.content.Intent
import android.graphics.PixelFormat
import android.os.IBinder
import android.view.Gravity
import android.view.WindowManager
import androidx.compose.foundation.gestures.detectDragGestures
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxScope
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue