Guest User

Untitled

a guest
Dec 17th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. private final class MyTouchListener implements View.OnTouchListener {
  2. //public boolean onTouch(View view, MotionEvent motionEvent) {
  3. public boolean onTouch(View view, MotionEvent motionEvent) {
  4. LinearLayout ship = (LinearLayout)view.getParent();
  5. dragCellIndex = ship.indexOfChild(view);
  6. dragCellTotal = ship.getChildCount();
  7. view = ship;
  8.  
  9. if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
  10. ClipData data = ClipData.newPlainText("", "");
  11. View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(view);
  12. view.startDrag(data, shadowBuilder, view, 0);
  13. view.setVisibility(View.INVISIBLE);
  14. return true;
  15. } else {
  16. return false;
  17. }
  18. }
  19. }
Add Comment
Please, Sign In to add comment