Skip to content

Window width is limited #181

Description

@ElliotAl86

Hi!
I've noticed some strange behavior. Maybe it's a bug, or maybe I'm missing something.
For some reason, the window width gets limited to about 3/4 of the display width.
For a simple repro, I took the service-hilt module from the library and replaced FloatingScreen.kt with this:

package io.github.arthurkun.service.hilt.ui.floating

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import androidx.lifecycle.viewmodel.compose.viewModel
import com.github.only52607.compose.service.dragServiceFloatingWindow
import io.github.arthurkun.service.hilt.ui.theme.ComposeFloatingWindowTheme

@Composable
fun FloatingScreen(
    vm: FloatingViewModel = viewModel(),
) {
    ComposeFloatingWindowTheme(darkTheme = false) {
        Box(
            modifier = Modifier
                .size(500.dp)
                .background(color = Color.Blue)
                .dragServiceFloatingWindow() // this doesn't seem to affect
        )
    }
}

As a result, I get this:

Image

The width is limited, but the height isn't.
I checked this on several devices, and it doesn't seem to depend on the API level or the device manufacturer.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions