Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private final class MyTouchListener implements View.OnTouchListener {
- //public boolean onTouch(View view, MotionEvent motionEvent) {
- public boolean onTouch(View view, MotionEvent motionEvent) {
- LinearLayout ship = (LinearLayout)view.getParent();
- dragCellIndex = ship.indexOfChild(view);
- dragCellTotal = ship.getChildCount();
- view = ship;
- if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
- ClipData data = ClipData.newPlainText("", "");
- View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(view);
- view.startDrag(data, shadowBuilder, view, 0);
- view.setVisibility(View.INVISIBLE);
- return true;
- } else {
- return false;
- }
- }
- }
Add Comment
Please, Sign In to add comment