Skip to content

Instantly share code, notes, and snippets.

@javikin
Created August 7, 2018 04:01
Show Gist options
  • Save javikin/ebf0dd43ee80f1be969d901ffe1bb302 to your computer and use it in GitHub Desktop.
Save javikin/ebf0dd43ee80f1be969d901ffe1bb302 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/textureView"
android:background="@color/white"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/controls"/>
<View
android:id="@+id/viewRect"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/controls"
android:background="@drawable/custom_border_white_transparent"
android:layout_marginStart="45dp"
android:layout_marginEnd="45dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"/>
<RelativeLayout
android:id="@+id/controls"
android:layout_width="match_parent"
android:layout_height="110dp"
android:background="@color/shade_blue_80"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true">
<ImageButton
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="76dp"
android:src="@drawable/ic_photo_library"
android:background="?android:attr/selectableItemBackground"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/imageViewCapture"
android:contentDescription="@string/label_content_description_image"
android:onClick="choosePhoto"/>
<ImageButton
android:id="@+id/imageViewFlashOn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
android:src="@drawable/ic_flash_on"
android:background="?android:attr/selectableItemBackground"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/imageViewCapture"
android:contentDescription="@string/label_content_description_image"
android:layout_marginEnd="27dp"
android:onClick="turnFlashOff"/>
<ImageButton
android:id="@+id/imageViewFlashOff"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/imageViewCapture"
android:layout_marginEnd="27dp"
android:src="@drawable/ic_flash_off"
android:contentDescription="@string/label_content_description_image"
android:visibility="gone"
android:background="?android:attr/selectableItemBackground"
android:onClick="turnFlashOn"/>
<ImageButton
android:id="@+id/imageViewCapture"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/bt_capture"
android:contentDescription="@string/label_content_description_image"
android:background="?android:attr/selectableItemBackground"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:onClick="takePhoto"/>
<Button
android:text="@string/label_cancel"
android:textAllCaps="true"
style="@style/Button.BorderlessButton2"
android:padding="10dp"
android:layout_marginStart="28dp"
android:layout_centerVertical="true"
android:layout_toEndOf="@+id/imageViewCapture"
android:textColor="@color/white"
android:onClick="cancel"
/>
</RelativeLayout>
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment