<?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"> <SurfaceView android:id="@+id/cameraView" android:layout_width="match_parent" android:layout_height="match_parent" /> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <View android:layout_width="match_parent" android:layout_height="185dp" android:background="@color/semitransparent" /> <RelativeLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"> <View android:id="@+id/left" android:layout_width="40dp" android:layout_height="match_parent" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:background="@color/semitransparent" /> <LinearLayout android:id="@+id/scannerLayout" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_centerInParent="true" android:layout_toEndOf="@+id/left" android:layout_toLeftOf="@id/right" android:layout_toRightOf="@id/left" android:layout_toStartOf="@+id/right" android:background="@drawable/ic_viewfinder" android:orientation="horizontal"> <View android:id="@+id/scannerBar" android:layout_width="match_parent" android:layout_height="5dp" android:background="@color/colorPrimary" /> </LinearLayout> <View android:id="@+id/right" android:layout_width="40dp" android:layout_height="match_parent" android:layout_alignParentEnd="true" android:layout_alignParentRight="true" android:background="@color/semitransparent" /> </RelativeLayout> <View android:layout_width="match_parent" android:layout_height="185dp" android:background="@color/semitransparent" /> </LinearLayout> </FrameLayout>