how to set separate toast message for 2 bitmap in android? - android

public class Sample2 extends Activity {
private SampleView sView;
private static int displayWidth = 100; //movement area
private static int displayHeight = 100;
float angle = 0;
#Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
sView = new SampleView(this);
setContentView(sView);
}//oncreate
private class SampleView extends View {
Context con;
private Rect displayRect = null; //rect we display to
private int scrollRectX = 0; //current left location of scroll rect
private int scrollRectY = 0; //current top location of scroll rect
private float scrollByX = 0; //scroll by amounts
private float scrollByY = 0;
private float startX = 0; //track x from one ACTION_MOVE to the next
private float startY = 0; //track y from one ACTION_MOVE to the next
private int state = 0;
Bitmap bitmap2;
public SampleView(Context context) {
super(context);
displayRect = new Rect(0, 0, displayWidth, displayHeight);
}//constructor
public boolean onTouchEvent(MotionEvent event) {
float x;
float y;
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
//Initial down event location.
startX = event.getRawX();
startY = event.getRawY()-50;
// Log.e("TOUCHED",startY+" "+(scrollRectY+displayHeight));
if (((startX>scrollRectX)&(startX<(scrollRectX+displayWidth)))&
((startY>scrollRectY)&(startY<(scrollRectY+displayHeight)))) state = 1;
//Log.e("TOUCHED","State "+state);
break;
case MotionEvent.ACTION_MOVE:
x = event.getRawX();
y = event.getRawY()-50;
scrollByX = x - startX;
scrollByY = y - startY;
startX = x;
startY = y;
if (state != 0) invalidate(); //move it
break;
case MotionEvent.ACTION_UP:
x = event.getRawX();
y = event.getRawY()-50;
scrollByX = x - startX;
scrollByY = y - startY;
startX = x;
startY = y;
state = 0;
invalidate();
break;
}//switch
return true;
}//ontouch
protected void onDraw(Canvas canvas) {
scrollRectX = scrollRectX+(int)scrollByX;
scrollRectY = scrollRectY+(int)scrollByY;
displayRect.set(scrollRectX,scrollRectY,scrollRectX+displayWidth,
scrollRectY+displayHeight);
Paint paint = new Paint();
Bitmap bitmap1 = BitmapFactory.decodeResource(getResources(),R.drawable.ic_launcher);
bitmap2= BitmapFactory.decodeResource(getResources(),R.drawable.ic_launcher).copy(Config.RGB_565, true);
canvas.drawBitmap(bitmap2, null, displayRect, paint);
//TODO: Fill In Methods Etc.
}
}
}
i have used this code....now my question is this how to set separate toast messages for 2 bitmap in android?....if i touch in background rectangle it shows toast message and if i touch on image it shows another toast message by using if condition on ontouchevents....plz any1 can say this....

you can do like this way,
Demo.java
public class Demo extends Activity implements OnClickListener{
#Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.demo_layout);
final LinearLayout lin_layout = (LinearLayout) findViewById(R.id.lin_layout);
final ImageView img_view = (EditText) findViewById(R.id.img_view);
// call your touch event
l_l.setOnClickListener(this);
imageView1.setOnClickListener(this);
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
switch (v.getId()) {
case R.id.l_l: // if you touch on layout
// do your task
Toast.makeText(getApplicationContext(), "You Touch on: Linear_Layout",
Toast.LENGTH_LONG).show();
break;
case R.id.imageView1: // if you touch on Image
// do your task
Toast.makeText(getApplicationContext(), "You Touch on : Image ", Toast.LENGTH_LONG)
.show();
break;
default:
break;
}
}
}

Related

create a custom view canvas that draws a collection of custom moveable Rect views

I'm having trouble figuring out how to get a dynamic collection of custom views to display as movable rectangles inside a canvas. The canvas is a bar with bar stools and I want the restaurant manager to be able to create the layout of his/her bar that other pages can utilize.
I have it working, but not well and the individual "BarSpots" won't move and the onTouchEvent of the ViewBarSpot isn't firing - however - the onTouchEvent of the ViewBarCanvas IS firing. What am I missing??
ActivityBarLayout:
private FrameLayout flCanvas;
List<BarSpot> dbBarSpots;
...
private void LoadBar(List<BarSpot> barSpots) {
try{
flCanvas.removeAllViews();
View viewBarCanvas = new ViewBarCanvas(getApplicationContext(), barSpots);
flCanvas.addView(viewBarCanvas);
}
catch(Exception e){
LogUtil.log(e.getMessage());
}
}
ViewBarCanvas:
Context mContext;
public List<ViewBarSpot> mBoxs;
public List<BarSpot> mBarSpots;
public ViewBarCanvas(Context context, List<BarSpot> barSpots) {
super(context);
mContext = context;
mBarSpots = barSpots;
mBoxs = new ArrayList<>();
for (BarSpot barSpot : barSpots) {
mBoxs.add(new ViewBarSpot(context, barSpot));
}
init(null);
}
#Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
for (ViewBarSpot viewBarSpot : mBoxs) {
canvas.drawRect(viewBarSpot.mRectangle, viewBarSpot.mPaintBackground);
canvas.drawRect(viewBarSpot.mRectangle, viewBarSpot.mStrokePaint);
canvas.drawText(viewBarSpot.mText, viewBarSpot.mStart, viewBarSpot.mStart + viewBarSpot.mNumberOfCharacters, viewBarSpot.mRectangle.exactCenterX(), viewBarSpot.mRectangle.exactCenterY(), viewBarSpot.mPaintText);
}
}
ViewBarSpot:
public float mPosX;
public float mPosY;
public float mLastTouchX;
public float mLastTouchY;
#Override
public boolean onTouchEvent(MotionEvent event) {
final float x = event.getX();
final float y = event.getY();
switch (event.getAction() & MotionEvent.ACTION_MASK){
case MotionEvent.ACTION_DOWN: {
// Remember where we started
mLastTouchX = x;
mLastTouchY = y;
break;
}
case MotionEvent.ACTION_MOVE: {
// Calculate the distance moved
final float dx = x - mLastTouchX;
final float dy = y - mLastTouchY;
// Move the object
if (mRectangle.left < x && mRectangle.right > x && mRectangle.top < y && mRectangle.bottom > y) {
mPosX += dx;
mPosY += dy;
// Invalidate to request a redraw
postInvalidate();
}
// Remember this touch position for the next move event
mLastTouchX = x;
mLastTouchY = y;
break;
}
case MotionEvent.ACTION_UP:
/*realm.executeTransaction(new Realm.Transaction() {
#Override
public void execute(Realm realm) {
mBarSpot.setPositionLeft((int)mPosX - SQUARE_SIZE/2);
mBarSpot.setPositionRight((int)mPosX + SQUARE_SIZE/2);
mBarSpot.setPositionTop((int)mPosY - SQUARE_SIZE/2);
mBarSpot.setPositionBottom((int)mPosY + SQUARE_SIZE/2);
}
});*/
}
postInvalidate();
return true;
}
public ViewBarSpot(Context context, BarSpot barSpot) {
super(context);
mContext = context;
mBarSpot = barSpot;
mText = barSpot.getDescription();
mRectangle = new Rect(mBarSpot.getPositionLeft(), mBarSpot.getPositionTop(), mBarSpot.getPositionLeft() + SQUARE_SIZE, mBarSpot.getPositionTop()+ SQUARE_SIZE);
mPaintBackground = new Paint(Paint.ANTI_ALIAS_FLAG);
mPaintBackground.setColor(mContext.getResources().getColor(R.color.themeColor1));
mPaintBackground.setStyle(Paint.Style.FILL);
mStrokePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mStrokePaint.setStyle(Paint.Style.STROKE);
mStrokePaint.setColor(mContext.getResources().getColor(R.color.themeColor3));
mStrokePaint.setStrokeWidth(2);
mPaintText = new Paint(Paint.ANTI_ALIAS_FLAG);
mPaintText.setColor(mContext.getResources().getColor(R.color.themeColor3));
mPaintText.setTextSize(TEXT_SIZE);
mPaintText.setTextAlign(Paint.Align.CENTER);
mNumberOfCharacters = mPaintText.breakText(mText,true, SQUARE_SIZE,null);
mStart = (mText.length()- mNumberOfCharacters)/2;
}
#Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
}

How to take View and layout on the screen?

I try to make a activity and a View on the screen, cause the activity have the buttons which I need. My question is how can I do it, that when I start the app I see the buttons from the activity and the ball and the box from the view class??
How should I take the view in the layout?
that is the activity:
public class GameView extends Activity implements OnClickListener {
private Button bPAUSE;
private TextView tvTries;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.gameview);
initialize();
}
public void onClick(View v) {
}
public void initialize(){
bPAUSE = (Button) findViewById(R.id.button1);
bPAUSE.setOnClickListener(this);
tvTries = (TextView) findViewById(R.id.textView1);
}
}
that the View class:
public class BouncingBallView extends View {
private Ball ball;
private Box box;
// For touch inputs - previous touch (x, y)
private float previousX;
private float previousY;
// Constructor
public BouncingBallView(Context context) {
super(context);
box = new Box(0xff00003f); // ARGB
ball = new Ball(Color.GREEN);
// To enable keypad
this.setFocusable(true);
this.requestFocus();
// To enable touch mode
this.setFocusableInTouchMode(true);
}
// Called back to draw the view. Also called after invalidate().
#Override
protected void onDraw(Canvas canvas) {
// Draw the components
box.draw(canvas);
ball.draw(canvas);
// Update the position of the ball, including collision detection and reaction.
ball.moveWithCollisionDetection(box);
// Delay
try {
Thread.sleep(30);
} catch (InterruptedException e) { }
invalidate(); // Force a re-draw
}
// Called back when the view is first created or its size changes.
#Override
public void onSizeChanged(int w, int h, int oldW, int oldH) {
// Set the movement bounds for the ball
box.set(0, 0, w, h);
}
int touchCounter = 2;
#Override
public boolean onTouchEvent(MotionEvent event) {
float currentX = event.getX();
float currentY = event.getY();
float deltaX, deltaY;
float scalingFactor = 1.0f / ((box.xMax > box.yMax) ? box.yMax : box.xMax);
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
touchCounter = 2;
if (currentX >= previousX) {
deltaX = currentX - previousX;
ball.speedX += deltaX * scalingFactor;
} else if (previousX >= currentX) {
deltaX = previousX - currentX;
ball.speedX += deltaX * scalingFactor;
} if (currentY >= previousY) {
deltaY = currentY - previousY;
ball.speedX += deltaY * scalingFactor;
} else if (previousY >= currentY) {
deltaY = previousY - currentY;
ball.speedY += deltaY * scalingFactor;
}
//vorherig(previous) - aktuell
break;
case MotionEvent.ACTION_UP:
touchCounter = 1;
// Modify rotational angles according to movement
break;
}
// Save current x, y
previousX = currentX;
previousY = currentY;
return true; // Event handled
}
}
I actually tries to do this in the activity class but the layout is missing...
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
View BouncingBallView= new BouncingBallView(this);
setContentView(BouncingBallView);
initialize();
}

How to draw a line from the source to the destination of a drag and drop operation?

I've implemented a drag and drop system and now I want to draw a line from the source to destination. How can I draw that line? I already used an extension of the View class, but it's not working. Here is my code:
public class TempDDActivity extends Activity implements OnTouchListener {
/** Called when the activity is first created. */
private View selected_item = null;
private int offset_x = 0;
private int offset_y = 0;
Boolean touchFlag=false;
boolean dropFlag=false;
LayoutParams imageParams;
ImageView imageDrop,image1,image2;
int crashX,crashY;
Drawable dropDrawable,selectDrawable;
Rect dropRect,selectRect;
int topy,leftX,rightX,bottomY;
int dropArray[];
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
ViewGroup container = (ViewGroup) findViewById(R.id.container);
imageDrop=(ImageView) findViewById(R.id.ImgDrop);
image1=(ImageView) findViewById(R.id.img);
image2=(ImageView) findViewById(R.id.img2);
container.setOnTouchListener(new View.OnTouchListener()
{
public boolean onTouch(View v, MotionEvent event)
{
if(touchFlag==true)
{
System.err.println("Display If Part ::->"+touchFlag);
switch (event.getActionMasked())
{
case MotionEvent.ACTION_DOWN :
topy=imageDrop.getTop();
leftX=imageDrop.getLeft();
rightX=imageDrop.getRight();
bottomY=imageDrop.getBottom();
System.err.println("Display Top-->"+topy);
System.err.println("Display Left-->"+leftX);
System.err.println("Display Right-->"+rightX);
System.err.println("Display Bottom-->"+bottomY);
//opRect.
break;
case MotionEvent.ACTION_MOVE:
crashX=(int) event.getX();
crashY=(int) event.getY();
System.err.println("Display Here X Value-->"+crashX);
System.err.println("Display Here Y Value-->"+crashY);
int x = (int) event.getX() - offset_x;
int y = (int) event.getY() - offset_y;
//int w = getWindowManager().getDefaultDisplay().getWidth() - 100;
//int h = getWindowManager().getDefaultDisplay().getHeight() - 100;
int w = getWindowManager().getDefaultDisplay().getWidth() - 50;
int h = getWindowManager().getDefaultDisplay().getHeight() - 10;
if (x > w)
x = w;
if (y > h)
y = h;
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(new ViewGroup.MarginLayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT));
lp.setMargins(x, y, 0, 0);
//Drop Image Here
if(crashX > leftX && crashX < rightX && crashY > topy && crashY < bottomY )
{
Drawable temp=selected_item.getBackground();
imageDrop.setBackgroundDrawable(temp);
imageDrop.bringToFront();
dropFlag=true;
selected_item.setVisibility(View.INVISIBLE);
}
//Drop Image Here
selected_item.setLayoutParams(lp);
break;
case MotionEvent.ACTION_UP:
//
touchFlag=false;
if(dropFlag==true)
{
dropFlag=false;
}
else
{
selected_item.setLayoutParams(imageParams);
}
break;
default:
break;
}
}else
{
System.err.println("Display Else Part ::->"+touchFlag);
}
return true;
}
});
image1.setOnTouchListener(this);
image2.setOnTouchListener(this);
}
public boolean onTouch(View v, MotionEvent event)
{
switch (event.getActionMasked())
{
case MotionEvent.ACTION_DOWN:
touchFlag=true;
offset_x = (int) event.getX();
offset_y = (int) event.getY();
selected_item = v;
imageParams=v.getLayoutParams();
break;
case MotionEvent.ACTION_UP:
selected_item=null;
touchFlag=false;
break;
default:
break;
}
return false;
}
}
now I want to draw a line from source to destination
First you need to have a custom view for actually drawing the line. This would be the layout that wraps the ImageViews, which in your case I think is a RelativeLayout. That class would be something like:
public class DragObserverLayout extends RelativeLayout {
float startX, startY, stopX, stopY;
private Paint mPaint = new Paint();
private List<Rect> lines = new ArrayList<Rect>();
public DragObserverLayout(Context context, AttributeSet attrs) {
super(context, attrs);
mPaint.setColor(Color.GREEN);
mPaint.setStrokeWidth(2.0f);
}
#Override
protected void dispatchDraw(Canvas canvas) {
super.dispatchDraw(canvas);
final int count = lines.size();
for (int i = 0; i < count; i++) {
final Rect r = lines.get(i);
canvas.drawLine(r.left, r.top, r.right, r.bottom, mPaint);
}
}
public void addLine(Rect r) {
lines.add(r);
invalidate();
}
}
Then in the OnTouchListener for the container where you do the drag operation you would simply do:
final int[] location = new int[2];
final DragObserverLayout container = (DragObserverLayout ) findViewById(R.id.container);
container.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
if(touchFlag==true) {
switch (event.getActionMasked())
{
case MotionEvent.ACTION_DOWN :
//...
selected_item.getLocationOnScreen(location);
container.startX = location[0];
container.startY = location[1];
break;
case MotionEvent.ACTION_MOVE:
//...
selected_item.getLocationOnScreen(location);
break;
case MotionEvent.ACTION_UP:
// ...
// .. the item was dragged on the target
if (selected_item.getVisibility() != View.VISIBLE) {
Rect r = new Rect();
r.left = (int) container.startX;
r.top = (int) container.startY;
imageDrop.getLocationInWindow(location);
r.right = location[0];
r.bottom = location[1];
container.addLine(r);
}
This will draw a straight line from the initial position of the dragged ImageView(top left point of the view) to the current position until the ImageView is "dropped". If you want you could offset the start line's position to point to the real touched position by making some simple calculation in the onTouch method for the ImageViews. This also works as you have a full screen application covering the entire screen, otherwise you'll have to offset the return from getLocationOnScreen() to take in consideration the status bar. If you want to keep the line on the screen after the drag operation finishes you'll need to store it in the container.

Make new bitmap on the canvas from resource

I think that my problem is minor but I can't find solution. I am trying to make application which will help me to make WEB pages and I want to make application which will put graphic element on the screen.
I made drawable png images of rectangles and I can put them on the screen where I want, no problem, but I can not make new graphic/bitmap.
How I can put new graphics object on the screen when I press in meni DIV or iFrame?
public class Objects extends View {
private float X;
private float Y;
private Paint myPaint;
final String C_DIV = "DIV";
final String C_TABLE = "Table";
final String C_IFRAME = "iFrame";
final String C_LIST = "List";
Canvas canvas;
Bitmap divimg = BitmapFactory.decodeResource(getResources(), R.drawable.div);
Bitmap iframeimg = BitmapFactory.decodeResource(getResources(), R.drawable.iframe);
Bitmap img = null;
String objectname = " ";
public Objects(Context context) {
super(context);
myPaint = new Paint();
}
public void HTMLObjects(String object) {
Log.d(object, "see");
if (object.equals(C_DIV)) {
myPaint.setColor(Color.GREEN);
img = Bitmap.createBitmap(divimg);
objectname = "DIV";
}
if (object.equals(C_IFRAME)) {
myPaint.setColor(Color.BLUE);
img = Bitmap.createBitmap(iframeimg);
objectname = "iFrame";
}
}
public boolean onTouchEvent(MotionEvent event) {
int action = event.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
X = (int) event.getX();
Y = (int) event.getY();
break;
case MotionEvent.ACTION_MOVE:
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
X = (int) event.getX();
Y = (int) event.getY();
break;
}
return true;
}
public void onDraw(Canvas canvas) {
if (img != null) {
canvas.drawBitmap(img, X - 50, Y - 50, myPaint);
canvas.drawText(objectname, X, Y - 50, myPaint);
}
invalidate();
}
}
This is a class which I am calling from the activity Workspace with
ob.HTMLObjects((String) item.getTitle());
and I am sending information which menu is pressed.
I do not know how to make new/different object/bitmap when I pressed DIV or iFrame.
Try these version. I replaces x,y,img,objectname with according lists:
public class Objects extends View {
private Paint myPaint;
public final String C_DIV="DIV";
public final String C_TABLE="Table";
public final String C_IFRAME="iFrame";
public final String C_LIST="List";
private Canvas canvas;
private Bitmap divimg= BitmapFactory.decodeResource(getResources(), R.drawable.div);
private Bitmap iframeimg=BitmapFactory.decodeResource(getResources(), R.drawable.iframe);
private List<Bitmap> images;
private List<Float> xs;
private List<Float> ys;
private List<String> objectNames;
public Objects(Context context) {
super(context);
myPaint = new Paint();
images = new ArrayList<Bitmap>();
xs = new ArrayList<Float>();
ys = new ArrayList<Float>();
objectNames = new ArrayList<String>();
}
public void HTMLObjects(String object){
Log.d(object, "see");
if (object.equals(C_DIV)) {
myPaint.setColor(Color.GREEN);
images.add(Bitmap.createBitmap(divimg));
objectNames.add("DIV");
xs.add(0F);
ys.add(0F);
}
if (object.equals(C_IFRAME)){
myPaint.setColor(Color.BLUE);
images.add(Bitmap.createBitmap(iframeimg));
objectNames.add("iFrame");
xs.add(0F);
ys.add(0F);
}
}
public boolean onTouchEvent(MotionEvent event) {
int action=event.getAction();
if (xs.isEmpty()) {
return true;
}
int pos = xs.size() - 1;
switch(action) {
case MotionEvent.ACTION_DOWN:
xs.set(pos, event.getX());
ys.set(pos, event.getY());
break;
case MotionEvent.ACTION_MOVE:
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
xs.set(pos, event.getX());
ys.set(pos, event.getY());
break;
}
return true;
}
public void onDraw(Canvas canvas){
for (int i = 0; i < images.size(); i++) {
float x = xs.get(i);
float y = ys.get(i);
canvas.drawBitmap(images.get(i), x-50, y-50, myPaint);
canvas.drawText(objectNames.get(i), x, y-50, myPaint);
}
invalidate();
}
}

Image view rotation on ACTION_MOVE

I'm able to rotate image view on ACTION_DOWN.
but its not working for ACTION_MOVE & ACTION_UP.
public class RotateImage extends Activity {
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Rotate rotate;
rotate = new Rotate(this);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(rotate);
}
}
public class Rotate extends ImageView {
Paint paint;
int direction = 0;
private float x;
private float y;
int degree = 0;
float a, b, c;
private float centerX ;
private float centerY ;
private float newX ;
private float newY ;
public Rotate(Context context) {
super(context);
// TODO Auto-generated constructor stub
paint = new Paint();
paint.setColor(Color.WHITE);
paint.setStrokeWidth(2);
paint.setStyle(Style.STROKE);
this.setImageResource(R.drawable.direction1);
}
#Override
protected void onDraw(Canvas canvas) {
int height = this.getHeight();
int width = this.getWidth();
centerX = width/2;
centerY = height/2;
canvas.rotate(direction, width / 2, height / 2);
super.onDraw(canvas);
}
public void setDirection(int direction) {
this.direction = direction;
this.invalidate();
}
#Override
public boolean onTouchEvent(MotionEvent event) {
System.out.println("now i'm in BEFORE calling MotionEvent.ACTION_MOVE ");
if (event.getAction() == MotionEvent.ACTION_DOWN) {
x = event.getX();
y = event.getY();
newX = centerX-x;
newY = centerY-y;
updateRotation( newX, newY);
}
else if (event.getAction() == MotionEvent.ACTION_MOVE) {
x = event.getX();
y = event.getY();
newX = centerX-x;
newY = centerY-y;
updateRotation( newX, newY);
}
else if (event.getAction() == MotionEvent.ACTION_UP) {
x = event.getX();
y = event.getY();
newX = centerX-x;
newY = centerY-y;
updateRotation( newX, newY);
}
return super.onTouchEvent(event);
}
private void updateRotation(float newX2, float newY2) {
// TODO Auto-generated method stub
degree = (int)Math.toDegrees(Math.atan2(newY, newX))-90;
setDirection(degree);
}
}
any suggestion would be appropriated
Return true instead of super.onTouchEvent(event) in your onTouchEvent method. This will inform the OS that you are handling the touch event allowing it to provide you with further touch events (e.g. MotionEvent.ACTION_MOVE).

Categories

Resources