Quantcast
Channel: BlogoSfera » events
Viewing all articles
Browse latest Browse all 19

Draggable TextView – Setting offsets dynamically

$
0
0

I have a TextView with the id “tx”. I’ve set an OnTouchListener to allow the user to drag the view. tx.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent event) { float x = event.getRawX(); float y = event.getRawY(); if (event.getAction() == MotionEvent.ACTION_MOVE) { // Offsets center the TextView to the center of the MotionEvent […]

The post Draggable TextView – Setting offsets dynamically appeared first on BlogoSfera.


Viewing all articles
Browse latest Browse all 19

Trending Articles