I'm trying to scroll a gridview
when I drag one view, and it works, but in the views from the first row that appears after the scroll, I can't do drop, but in the rest views yes.
Someone knows why.
Thank you very much in advance. please help me I'm desperate.
Drag listener:
public boolean onDrag(View v, DragEvent event) {
int action = event.getAction();
//VistaOrigen>>
View vOrig = (View) event.getLocalState ();
//VistaDestino>>
View vDest = v;
switch (action) {
case DragEvent.ACTION_DRAG_STARTED:
//Realizamos el cambio de posiciones de los pictogramas:
posOrig = losPictos.indexOf(vOrig.getTag());
break;
case DragEvent.ACTION_DRAG_LOCATION:
if (shouldScrollUp(v, event))
vComunicador.getPanelPictogramas().smoothScrollByOffset(-3);
else if (shouldScrollDown(v, event))
vComunicador.getPanelPictogramas().smoothScrollByOffset(3);
break;
case DragEvent.ACTION_DRAG_ENTERED:
v.setAlpha(0.5f);
break;
case DragEvent.ACTION_DRAG_EXITED:
v.setAlpha(1f);
break;
case DragEvent.ACTION_DROP:
//Drop
break;
case DragEvent.ACTION_DRAG_ENDED:
//Ocultamos el m¡panel de Menú Elimiar y Editar:
vComunicador.mMostrarPanelEditar(false, false, false);
default:
break;
}
return true;
}
After smoothScrollByOffset(-3)
, in the first line of the gridview
, drag listener not working.