Skip to content

Commit b7f8043

Browse files
committed
feat:增加位置获取api
1 parent f18a94d commit b7f8043

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

floatingx/src/main/java/com/petterp/floatingx/imp/FxBasisControlImp.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ abstract class FxBasisControlImp<F : FxBasisHelper, P : IFxPlatformProvider<F>>(
2727
get() = platformProvider.internalView
2828

2929
override val configControl: IFxConfigControl get() = _configControl
30+
override fun getX() = getManagerView()?.x ?: 0f
31+
override fun getY() = getManagerView()?.y ?: 0f
3032
override fun getView() = internalView?.childView
3133
override fun getViewHolder() = internalView?.viewHolder
3234
override fun getManagerView() = internalView?.containerView
@@ -41,10 +43,6 @@ abstract class FxBasisControlImp<F : FxBasisHelper, P : IFxPlatformProvider<F>>(
4143
_configControl = createConfigProvider(helper, platformProvider)
4244
}
4345

44-
override fun getX() = getManagerView()?.x ?: -1f
45-
46-
override fun getY() = getManagerView()?.y ?: -1f
47-
4846
override fun show() {
4947
if (isShow()) return
5048
helper.enableFx = true

floatingx/src/main/java/com/petterp/floatingx/listener/control/IFxControl.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ interface IFxControl {
2828
*/
2929
fun cancel()
3030

31-
/** 获取x坐标 */
31+
/** 获取相对浮窗容器的 x坐标 */
3232
fun getX(): Float
3333

34-
/** 获取y坐标 */
34+
/** 获取相对浮窗容器的 y坐标 */
3535
fun getY(): Float
3636

3737
/** 获取正在显示的浮窗内容视图,即通过layoutId或者自定义View传递进来的 View */

0 commit comments

Comments
 (0)