Skip to content

Commit

Permalink
Merge pull request #3 from Ajantha8/removeUnnecessaryListners
Browse files Browse the repository at this point in the history
Remove Unnecessary Listners
  • Loading branch information
Ajantha8 committed Oct 2, 2020
2 parents d08b47c + 72dceff commit 7a81cc1
Showing 1 changed file with 0 additions and 65 deletions.
65 changes: 0 additions & 65 deletions app/src/main/java/com/amw/dragdrop/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,47 +50,6 @@ protected void onCreate(Bundle savedInstanceState) {
iv7 = (ImageView) findViewById(R.id.iv7);
iv8 = (ImageView) findViewById(R.id.iv8);

/*top.setOnDragListener(new View.OnDragListener() {
@Override
public boolean onDrag(View v, DragEvent event) {
final int action = event.getAction();
switch (action) {
case DragEvent.ACTION_DRAG_STARTED:
break;
case DragEvent.ACTION_DRAG_LOCATION:
break;
case DragEvent.ACTION_DROP: {
fail += 1;
return true;
}
case DragEvent.ACTION_DRAG_ENDED: {
total += 1;
int value = total - fail;
successTV.setText("Success : " + value);
totalTV.setText("Total : " + total);
return true;
}
case DragEvent.ACTION_DRAG_ENTERED:
break;
case DragEvent.ACTION_DRAG_EXITED:
break;
default:
break;
}
return true;
}
});*/

bottom.setOnDragListener(new View.OnDragListener() {
@Override
public boolean onDrag(View v, DragEvent event) {
Expand Down Expand Up @@ -151,30 +110,6 @@ public boolean onDrag(View v, DragEvent event) {

});

/*drag.setOnTouchListener(new View.OnTouchListener() {
@RequiresApi(api = Build.VERSION_CODES.N)
@Override
public boolean onTouch(View v, MotionEvent event) {
ClipData clipData = ClipData.newPlainText("", "");
View.DragShadowBuilder shadow = new View.DragShadowBuilder(drag);
v.startDragAndDrop(clipData, shadow, null, 0);
return false;
}
});*/


/*iv.setOnTouchListener(new View.OnTouchListener() {
@RequiresApi(api = Build.VERSION_CODES.N)
@Override
public boolean onTouch(View v, MotionEvent event) {
ClipData clipData = ClipData.newPlainText("", "");
View.DragShadowBuilder shadow = new View.DragShadowBuilder(iv);
v.startDragAndDrop(clipData, shadow, null, 0);
clicked = R.drawable.as;
return false;
}
});*/

iv1.setOnTouchListener(new View.OnTouchListener() {
@SuppressLint("ClickableViewAccessibility")
@Override
Expand Down

0 comments on commit 7a81cc1

Please sign in to comment.