FloatWindow
No description available
Install / Use
/learn @limbowangqi/FloatWindowREADME
FloatWindow
应用内悬浮窗,无需悬浮窗权限,业务代码侵入为0
效果预览
<img src="floatWindow.gif" width="250px"/>添加依赖
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.limbowangqi:FloatWindow:1.0.1'
}
初始化
FloatWindow.init()
.setContentView(LayoutInflater.from(this).inflate(R.layout.view_float_window, null))
.setDraggable(MovingDraggable())
.setAbsoluteXY(100,100)
使用
// 展示
FloatWindow.getInstance().show(this)
// 隐藏
FloatWindow.getInstance().hide()
属性介绍
| 属性 |说明 | |:-----------------------|:-------------------------------------------------------| | setContentView(view: View) | 设置悬浮窗布局 | | setGravity(gravity: Int) | 设置相对屏幕的位置 | | setAbsoluteXY(x: Int, y: Int) | 设置在屏幕上的绝对位置 x、y坐标 | | setBackgroundDimAmount(amount: Float) | 设置背景透明度 (0-1)| | setOutsideTouchable(touchable: Boolean)| 设置外部是否可点击 | | setDraggable(draggable: BaseDraggable) | 设置滑动模式 |
Related Skills
node-connect
342.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
85.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
342.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
342.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
