I have 6 separate images with a transparent background. How can I put all those images together as buttons, like:
From what I read I guess I have to use Frame Layout in order to have overlapping buttons.
I need each color is a separate button when clicked.
Update: I made a demo and check for transparent in onclick method however when I click the red area near the intersection between red and blue, it not register that the red button is click due to overlapping view. Please help!
https://www.dropbox.com/s/fc98nnnfbrtdh82/Photo%20Apr%2016%2C%202%2002%2013.jpg?dl=0
public boolean onTouch(View v, MotionEvent event) {
int eventPadTouch = event.getAction();
int iX = (int)event.getX();
int iY = (int)event.getY();
switch (eventPadTouch) {
case MotionEvent.ACTION_DOWN:
if (iX>=0 & iY>=0 & iX<TheBitmap.getWidth() & iY<TheBitmap.getHeight()&TheBitmap.getPixel(iX,iY)!=0) {
if (TheBitmap.getPixel(iX,iY)!=0) {
Toast.makeText(getApplicationContext(),"clicked blue",Toast.LENGTH_LONG).show();
}
}
return true;
}
return false;
}
}