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

1.2.0崩溃 #13

Closed
qiushui95 opened this issue Jul 3, 2024 · 6 comments
Closed

1.2.0崩溃 #13

qiushui95 opened this issue Jul 3, 2024 · 6 comments

Comments

@qiushui95
Copy link

从1.1.3升级到1.2.0 app崩溃,项目中使用的compose版本为1.6.8.
实测将您的compose_bom更新为2024.06.00,demo也会崩溃。
应该是compose从1.5到1.6版本,将OverscrollConfiguration.kt 更名为OverscrollConfiguration.android.kt引起的,也就是1.2.0新增的contentContainer属性引起的崩溃

@jenly1314
Copy link
Owner

你可以通过修改全局配置来暂时解决此问题;配置示例:

UltraSwipeRefreshTheme.config = UltraSwipeRefreshTheme.config.copy(
    contentContainer = { it() },
)

@qiushui95
Copy link
Author

我已经回退版本了,等你发1.2.1

@jenly1314
Copy link
Owner

我已经回退版本了,等你发1.2.1

不用回退,1.1.x版本在某些场景下会有其他问题,提供全局配置就是为了便于管理,就按我上面说的方式修改全局配置即可。(建议在ApplicationonCreate中调用)

@jenly1314
Copy link
Owner

jenly1314 commented Jul 3, 2024

从1.1.3升级到1.2.0 app崩溃,项目中使用的compose版本为1.6.8. 实测将您的compose_bom更新为2024.06.00,demo也会崩溃。 应该是compose从1.5到1.6版本,将OverscrollConfiguration.kt 更名为OverscrollConfiguration.android.kt引起的,也就是1.2.0新增的contentContainer属性引起的崩溃

重新详细的答复下这个问题,你可修改全局配置为与v1.2.0版本预期一致的配置

UltraSwipeRefreshTheme.config = UltraSwipeRefreshTheme.config.copy(
    contentContainer = { NoOverscrollEffect(it) },
)

关于NoOverscrollEffect具体可查看:NoOverscrollEffect

@Composable
@OptIn(ExperimentalFoundationApi::class)
private fun NoOverscrollEffect(content: @Composable () -> Unit) {
    CompositionLocalProvider(LocalOverscrollConfiguration provides null, content = content)
}

关于NoOverscrollEffect 存在的缘由可查看 #7

jenly1314 added a commit that referenced this issue Jul 3, 2024
@jenly1314
Copy link
Owner

已通过更新compose至v1.6.0来解决此问题;如需验证或优先使用可参见 待发布版本

@qiushui95
Copy link
Author

好的

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

2 participants