Skip to content
Snippets Groups Projects
Commit b36c12ff authored by Gersbacher Pirmin's avatar Gersbacher Pirmin
Browse files

*info panel dragable

parent 9ac6703c
No related branches found
No related tags found
No related merge requests found
...@@ -315,6 +315,42 @@ public class MyAccessibilityServiceV2 extends AccessibilityService { ...@@ -315,6 +315,42 @@ public class MyAccessibilityServiceV2 extends AccessibilityService {
lLayout.setLayoutParams(llParameters); lLayout.setLayoutParams(llParameters);
view.setOnTouchListener(new View.OnTouchListener() {
private WindowManager.LayoutParams updateParameters = lp2;
int x, y;
float touchedX, touchedY;
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()){
case MotionEvent.ACTION_DOWN:
y = updateParameters.y;
Toast.makeText(getApplicationContext(), "onTouch", Toast.LENGTH_SHORT).show();
touchedY = event.getRawY();
break;
case MotionEvent.ACTION_MOVE:
updateParameters.y = (int) (y - (event.getRawY() - touchedY));
wm.updateViewLayout(view, updateParameters);
default:
break;
}
return false;
}
});
wm.addView(view,lp2); wm.addView(view,lp2);
viewIsSet = true; viewIsSet = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment