Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

希望增加支持 jetpack compose #1158

Open
jinpengnice opened this issue Jun 30, 2023 · 4 comments
Open

希望增加支持 jetpack compose #1158

jinpengnice opened this issue Jun 30, 2023 · 4 comments

Comments

@jinpengnice
Copy link

希望增加支持 jetpack compose,谢谢。 现在在xml 使用 会崩溃。

@wzgl5533
Copy link

希望大佬哪天可以慢慢推出兼容compose的工具

@yongjie520
Copy link

yongjie520 commented Mar 10, 2024

// 可以混合使用,只需要加两行代码就可以在XpopWindow中直接使用Compose代码了

class XDialog(context:Context):BasePopupView{

      //关注这一行就行了
     init  {
           id=android.R.id.content
           setViewTreeLifecyceOwner(context as AppCompatActivity) // 如果在Compose中使用这里要传Compose的上下文XXX.current
           setViewTreeSavedStateRegisterOwner(context as AppCompatActivity)
       }
}

@yongjie520
Copy link

希望增加支持 jetpack compose,谢谢。 现在在xml 使用 会崩溃。

init {
id=android.R.id.content
setViewTreeLifecyceOwner(context as AppCompatActivity) // 如果在Compose中使用这里要传Compose的上下文XXX.current
setViewTreeSavedStateRegisterOwner(context as AppCompatActivity)
}

@initchen
Copy link

// 可以混合使用,只需要加两行代码就可以在XpopWindow中直接使用Compose代码了

class XDialog(context:Context):BasePopupView{

      //关注这一行就行了
     init  {
           id=android.R.id.content
           setViewTreeLifecyceOwner(context as AppCompatActivity) // 如果在Compose中使用这里要传Compose的上下文XXX.current
           setViewTreeSavedStateRegisterOwner(context as AppCompatActivity)
       }
}

PartShadowPopupView怎么处理atView呢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants