Been banging my head off the wall with this for a while. Basically my application shows a camera preview that fills the screen and when the user taps on the preview it captures an image (trying to do this through a transparent imagebutton. At the bottom of the screen I would like another image button, this time it will stop the recording the application is doing.
Here is my activity layout
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:id="@+id/camera_preview"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</FrameLayout>
<ImageButton
android:id="@+id/button_capture"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:contentDescription="@string/capture"
android:src="@null" />
</FrameLayout>
<ImageButton
android:id="@+id/stopRecording"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_gravity="bottom|center"
android:layout_marginBottom="50dp"
android:background="@null"
android:contentDescription="@string/stopRec"
android:onClick="moveToUpload"
android:scaleType="fitCenter"
android:src="@drawable/rec_gray" />
</FrameLayout>
I was trying to use FrameLayouts as they allow overlaying.
The only non changable thing is the CameraPreview HAS to be a FrameLayout.
Any help appreciated correcting this code,
Thanks.