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

feat:增加贴边半隐模式的支持 #161

Merged
merged 2 commits into from
Jul 5, 2024

Conversation

luckydzp
Copy link
Contributor

No description provided.

@@ -75,6 +75,17 @@ abstract class FxBasisControlImp<F : FxBasisHelper, P : IFxPlatformProvider<F>>(
}
}

override fun halfHide(bSet: Boolean) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个命名有点奇怪,方法参数命名使用enable更加合理

Copy link
Contributor Author

@luckydzp luckydzp Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

谢谢作者回复,但这里用enable似乎不合适,enable是在config中去设置了是否支持半隐,所以在config中使用了override fun setEnableHalfHide(isEnable: Boolean)
但这里想表达的是一个切换控制,bSet表示在已经enable后,切换(也可以说开启和关闭)半隐和正常状态。
比如在列表滑动时set为true开启半隐,列表停止滑动是set为false,恢复正常状态。

@@ -38,6 +38,10 @@ interface IFxConfigControl {
* */
fun setEnableEdgeRebound(isEnable: Boolean)

/** 启用边缘回弹
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

似乎复制错了文档

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注释已修改

private fun moveToXY(x: Float, y: Float, useAnimation: Boolean) {
val endX = locationHelper.safeX(x)
val endY = locationHelper.safeY(y)
private fun moveToXY(x: Float, y: Float, useAnimation: Boolean, safeCheck: Boolean = true) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

safeCheck的命名也有点怪,这里使用一个scene做type会更合理点

Copy link
Contributor Author

@luckydzp luckydzp Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里添加这个参数是有以下几点考虑:

  1. 这里是一个private方法,内部调用moveToXY时区分不同的逻辑
  2. 您原代码中,获取x,y默认使用了safeX(), safeY(), 所以通过添加这个参数,在特殊情况下,不使用您默认函数的safe()方法,所以参数命名为safeCheck

docs: 设置是否支持悬浮窗半隐模式 fun setEnableHalfHide(isEnable: Boolean)
Copy link
Contributor Author

@luckydzp luckydzp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文档复制后未修改已处理,其他两处我做了解释,请您帮忙参考一下。

private fun moveToXY(x: Float, y: Float, useAnimation: Boolean) {
val endX = locationHelper.safeX(x)
val endY = locationHelper.safeY(y)
private fun moveToXY(x: Float, y: Float, useAnimation: Boolean, safeCheck: Boolean = true) {
Copy link
Contributor Author

@luckydzp luckydzp Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里添加这个参数是有以下几点考虑:

  1. 这里是一个private方法,内部调用moveToXY时区分不同的逻辑
  2. 您原代码中,获取x,y默认使用了safeX(), safeY(), 所以通过添加这个参数,在特殊情况下,不使用您默认函数的safe()方法,所以参数命名为safeCheck

@@ -75,6 +75,17 @@ abstract class FxBasisControlImp<F : FxBasisHelper, P : IFxPlatformProvider<F>>(
}
}

override fun halfHide(bSet: Boolean) {
Copy link
Contributor Author

@luckydzp luckydzp Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

谢谢作者回复,但这里用enable似乎不合适,enable是在config中去设置了是否支持半隐,所以在config中使用了override fun setEnableHalfHide(isEnable: Boolean)
但这里想表达的是一个切换控制,bSet表示在已经enable后,切换(也可以说开启和关闭)半隐和正常状态。
比如在列表滑动时set为true开启半隐,列表停止滑动是set为false,恢复正常状态。

@Petterpx Petterpx merged commit 862b049 into Petterpx:main Jul 5, 2024
1 of 2 checks passed
@Petterpx
Copy link
Owner

Petterpx commented Jul 5, 2024

@luckydzp 开源共建,cool !

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

Successfully merging this pull request may close these issues.

2 participants