What I want to make is that there is two buttons in left side, and imageView on the right side. The buttons activate the camera or bring a photo from the gallery and display it on the imageView. Also, if user touch the image, then a rect shape is following the move of user.
I made a xml file that contain the buttons and imageView. Then, I made a custom view for the rectangle shape using canvas.
What I was thinking is set touchListener on the imageView and according to the coordinates, app generate the rectangle on the canvas that overlapped on the imageView.
Here is my question, Can I use both a xml file and custom view at the same time? That means those two things can be overlapped?
I tried
v = new DrawingTheBall(this); // v is my custom view
setContentView(v);
setContentView(R.layout.activity_main);
no errors but, only the first called one appears.
If the overlapping is impossible, then should I just put the buttons and imageView in the custom view class?