Skip to content

Instantly share code, notes, and snippets.

@amadeu01
Created March 22, 2018 15:37
Show Gist options
  • Save amadeu01/707622d9541c992b198b7e9a653fc90f to your computer and use it in GitHub Desktop.
Save amadeu01/707622d9541c992b198b7e9a653fc90f to your computer and use it in GitHub Desktop.
Crop image
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="io.github.amadeu01.cameraproportions.MainActivity">
<FrameLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"/>
<View android:id="@+id/view_crop"
android:layout_width="300dp"
android:layout_height="200dp"
android:layout_centerInParent="true"
android:background="@drawable/rounded_rectangle" />
<Button
android:id="@+id/addCameraButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="15dp"
tools:visibility="gone"
android:onClick="onAddCameraClicked"
android:text="Add camera" />
<RelativeLayout
android:id="@+id/cameraLayout"
android:visibility="gone"
tools:visibility="visible"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:paddingTop="10dp">
<com.github.florent37.camerafragment.widgets.CameraSettingsView
android:id="@+id/settings_view"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:onClick="onSettingsClicked"
android:layout_marginLeft="15dp"
/>
<com.github.florent37.camerafragment.widgets.FlashSwitchView
android:id="@+id/flash_switch_view"
android:onClick="onFlashSwitcClicked"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerInParent="true" />
<com.github.florent37.camerafragment.widgets.CameraSwitchView
android:id="@+id/front_back_camera_switcher"
android:onClick="onSwitchCameraClicked"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginRight="15dp"
android:layout_marginEnd="15dp"
/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/record_panel"
android:layout_width="match_parent"
android:layout_height="150dp"
android:background="@android:color/transparent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<com.github.florent37.camerafragment.widgets.RecordButton
android:id="@+id/record_button"
android:onClick="onRecordButtonClicked"
android:layout_width="75dp"
android:layout_height="75dp"
android:layout_centerInParent="true"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp" />
<TextView
android:id="@+id/record_duration_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@id/record_button"
android:layout_toStartOf="@id/record_button"
android:textColor="@android:color/white"
android:textSize="14sp"
android:visibility="invisible" />
<TextView
android:id="@+id/record_size_mb_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/record_button"
android:layout_toEndOf="@id/record_button"
android:textColor="@android:color/white"
android:textSize="14sp"
android:visibility="invisible" />
<com.github.florent37.camerafragment.widgets.MediaActionSwitchView
android:id="@+id/photo_video_camera_switcher"
android:onClick="onMediaActionSwitchClicked"
android:layout_width="40dp"
android:layout_height="40dp"
android:checked="false"
android:gravity="center"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/record_size_mb_text"
android:layout_toEndOf="@+id/record_size_mb_text"
android:layout_marginLeft="24dp"
android:layout_marginStart="24dp" />
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment