I am developing an app that is using face recognition. I have managed to draw an image over the camera, but the image is not transparent.
I want the face to be transparent like we have in a real camera. i have tried to follow this post: Change background color to a limited area of a view - Android
what is the best way to achieve this ?
This is my layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
android:background="@android:color/black"
android:orientation="vertical">
<com.facekeyexample.views.AutoFitTextureView
android:id="@+id/texture"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
<TextView
android:id="@+id/message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/darker_gray"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:padding="12dp"
android:text="@string/align_face"
android:textColor="@android:color/white"
android:textSize="16dp"
android:textStyle="bold" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/message"
android:alpha="0.77"
android:background="@color/transparent_darkIndigo"
android:orientation="vertical">
<TextView
android:id="@+id/counter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginBottom="32dp"
android:padding="5dp"
android:text="3"
android:textColor="@android:color/holo_orange_light"
android:textSize="120dp"
android:textStyle="bold"
android:visibility="gone" />
<View
android:id="@+id/elipseShape"
android:layout_width="320dp"
android:layout_height="430dp"
android:layout_centerInParent="true"
android:background="@drawable/face"
/>
<com.facekey.liveness.LivenessView
android:id="@+id/livenessView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="gone" />
</RelativeLayout>
</RelativeLayout>
Thank you