Giter VIP home page Giter VIP logo

Comments (2)

Petterpx avatar Petterpx commented on July 20, 2024

悬浮窗能做到初始状态传递一个自定义View和整个屏幕一样大吗?然后在自定义View中去点击变成小窗模式,再点击还原到全屏悬浮窗

现在试验的情况是悬浮窗的初始值必须要给定具体的 px 如果给的是 match_parent 则不会展示

我这样想把悬浮窗

        FloatingX.install {
            setContext(applicationContext)
            setLayoutView(windowView)
            setScopeType(FxScopeType.SYSTEM_AUTO)
        }.show()

FloatingX.control().updateView(fullScreenView(windowView)) 更新到全屏大小是没有作用的

/**
 * 通过 layoutParams 操作试图改变窗体大小
 */
fun fullScreenView(windowView: RenderSmallWindowView): RenderSmallWindowView {
    val layoutParams = windowView.layoutParams
    layoutParams.width = RTCUtils.getDisplayMetrics(this).widthPixels
    layoutParams.height = RTCUtils.getDisplayMetrics(this).heightPixels
    windowView.layoutParams = layoutParams
    return windowView
}

晚点出api支持此功能吧,具体来说需要浮窗容器配合做调整,对于系统浮窗,目前没有api做支持,对于app浮窗,可以使用getManagerView() 同时设置浮窗容器params。
相应的,对于你现在的需求,你可以考虑获取屏幕大小然后进行设置。

from floatingx.

13120241790 avatar 13120241790 commented on July 20, 2024

好的谢谢

from floatingx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.