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.