FloatingX A flexible and powerful permission-free
hover window solution.
"Note: After version 1.3.4, the repository has been migrated to Maven. Make sure to update your dependency accordingly."
- Single instance holding floating window view
- Support for various callback listeners
- Chain calls, senseless insertion
- Support customizing whether to save history position and restore
- Support inserting
ViewGroup
,Fragment
,Activity
- Allow custom hover window indicators, custom hidden display animation
- Support cross-border rebound, multi-finger touch, small screen adaptation, screen rotation
- Support custom position direction, with auxiliary positioning display coordinates
- Perfect
kotlin
build extensions, and friendly compatibility withJava
. - Support display location [force fix], for special models (need to open separately)
- Perfect logging system, open to see different levels of Fx running process, more convenient to find problems
- ...
dependencies {
implementation 'io.github.petterpx:floatingx:2.1.1'
}
全屏,activity,fragment,单view | 小屏展示 | 非正常比例缩放屏幕 |
---|---|---|
![]() |
![]() |
![]() |
屏幕旋转 | 功能演示 | |
---|---|---|
![]() |
![]() |
Open the log viewer, you will see the whole track of Fx, which is easier to find the problem and track the solution. Also support custom log tag。
App | Activity | ViewGroup |
---|---|---|
AndroidManifest
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.SYSTEM_OVERLAY_WINDOW" />
kt
FloatingX.install {
setContext(context)
setLayout(R.layout.item_floating)
setScopeType(FxScopeType.SYSTEM_AUTO)
}.show()
Java
AppHelper helper = AppHelper.builder()
.setContext(context)
.setLayout(R.layout.item_floating)
.setScopeType(FxScopeType.SYSTEM_AUTO)
.build();
FloatingX.install(helper).show();
kt
ScopeHelper.builder {
setLayout(R.layout.item_floating)
}.toControl(activity)
kt && java
ScopeHelper.builder()
.setLayout(R.layout.item_floating)
.build()
.toControl(activity)
.toControl(fragment)
.toControl(viewgroup)
private val activityFx by activityToFx(activity) {
setLayout(R.layout.item_floating)
}
private val fragment by fragmentToFx(fragment) {
setLayout(R.layout.item_floating)
}
private val viewFx by createFx({
init(viewGroup)
}) {
setLayout(R.layout.item_floating)
setEnableLog(true, "main_fx")
}
private val customCreateFx by createFx {
setLayout(R.layout.item_floating)
build().toControl(activity)
build().toControl(fragment)
build().toControl(viewgroup)
Base HoverView sourced from FloatingMagnetView of EnFloatingView implementation with some improvements on top of it.
For the measurement of the navigation bar part of the code from, wenlu, and on top of it added more adaptations, has covered 95% of the market models, can be said to be the only tool that can be searched for accurate measurement.
Welcome to follow my public number, look forward to progress together, if there are any problems in use, you can also add me WeChat.
Wechat: Petterpx