-
Notifications
You must be signed in to change notification settings - Fork 136
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
feat:增加贴边半隐模式的支持 #161
Conversation
@@ -75,6 +75,17 @@ abstract class FxBasisControlImp<F : FxBasisHelper, P : IFxPlatformProvider<F>>( | |||
} | |||
} | |||
|
|||
override fun halfHide(bSet: Boolean) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个命名有点奇怪,方法参数命名使用enable更加合理
There was a problem hiding this comment.
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) | |||
|
|||
/** 启用边缘回弹 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
似乎复制错了文档
There was a problem hiding this 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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
safeCheck的命名也有点怪,这里使用一个scene做type会更合理点
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里添加这个参数是有以下几点考虑:
- 这里是一个private方法,内部调用moveToXY时区分不同的逻辑
- 您原代码中,获取x,y默认使用了safeX(), safeY(), 所以通过添加这个参数,在特殊情况下,不使用您默认函数的safe()方法,所以参数命名为safeCheck
docs: 设置是否支持悬浮窗半隐模式 fun setEnableHalfHide(isEnable: Boolean)
There was a problem hiding this 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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里添加这个参数是有以下几点考虑:
- 这里是一个private方法,内部调用moveToXY时区分不同的逻辑
- 您原代码中,获取x,y默认使用了safeX(), safeY(), 所以通过添加这个参数,在特殊情况下,不使用您默认函数的safe()方法,所以参数命名为safeCheck
@@ -75,6 +75,17 @@ abstract class FxBasisControlImp<F : FxBasisHelper, P : IFxPlatformProvider<F>>( | |||
} | |||
} | |||
|
|||
override fun halfHide(bSet: Boolean) { |
There was a problem hiding this comment.
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,恢复正常状态。
@luckydzp 开源共建,cool ! |
No description provided.