sunjenry / floatwindow Goto Github PK
View Code? Open in Web Editor NEWA project show how to add float window in Android.
License: Apache License 2.0
A project show how to add float window in Android.
License: Apache License 2.0
**厂家定制rom 真的是恶心 .... 这几天因为权限这事 恶心坏了
It is recommended to add blog introduction articles:
https://www.jianshu.com/p/3246f7289704
Thank you.
这个修改显示位置的时候这个方法不准确
`private class FloatingOnTouchListener implements View.OnTouchListener {
private int x;
private int y;
@Override
public boolean onTouch(View view, MotionEvent event) {
LogUtils.i("onTouch: xy: (" + (int) event.getRawX() + "," + (int) event.getRawY() + ") (" + mLayoutParams.x + "," + mLayoutParams.y + ")");
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
x = (int) event.getRawX();
y = (int) event.getRawY();
break;
case MotionEvent.ACTION_MOVE:
int nowX = (int) event.getRawX();
int nowY = (int) event.getRawY();
int movedX = nowX - x;
int movedY = nowY - y;
x = nowX;
y = nowY;
LogUtils.i("Move (" + movedX + "," + movedY + ")");
mLayoutParams.x = mLayoutParams.x + movedX;
mLayoutParams.y = mLayoutParams.y + movedY;
mWindowManager.updateViewLayout(view, mLayoutParams);
break;
default:
break;
}
return true;
}
}`
感谢大佬,很强势,解决了我之前后台服务,后台广播在杀掉APP后保活的情况 。真的太强势了~感谢思路。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.