B4X:
package com.floor;
import android.content.Context;
import android.view.View;
import android.view.View.OnTouchListener;
import anywheresoftware.b4a.objects.collections.Map;
@BA.Version(1.0F)
@BA.ShortName("Croquis")
@BA.Events(values={"OnTouchListener (Value As Boolean)"})
public class croquis extends ViewWrapper<DrawGrid> implements DesignerCustomView ,OnTouchListener {
DrawGrid cv;
private String eventName;
private BA ba;
public void Initialize(BA paramBA, String paramString)
{
_initialize(paramBA, null, paramString);
}
@BA.Hide
public void _initialize(BA paramBA, Object paramObject, String paramString)
{
this.eventName = paramString.toLowerCase(BA.cul);
this.ba = paramBA;
this.cv = new DrawGrid(paramBA.context);
cv.setOnTouchListener(this); //????
}
@Override
public boolean onTouch(View arg0, MotionEvent arg1) {
//my code
return true;
}
public void DesignerCreateView(PanelWrapper paramPanelWrapper, LabelWrapper paramLabelWrapper, final Map paramMap)
{
this.cv = new DrawGrid(ba.context);
paramPanelWrapper.AddView(this.cv, 0, 0, paramPanelWrapper.getWidth(), paramPanelWrapper.getHeight());
paramPanelWrapper.setColor(Colors.Transparent);
}
//rest of code
}
This is not the complete code because it is long I want some help to start this view That implements OnTouchListener , thanks