1

I have built a camera app for android.The problem I am facing is making the camera frame to round instead of square or fullscreen.I tried to make the layout change its shape to circle but it didn't work. The layout is->

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_height="match_parent" android:layout_width="match_parent"
                android:orientation="vertical"
    android:gravity="center"
    android:background="#541358">
    <FrameLayout android:layout_width="350dp"
                 android:layout_height="350dp"
        android:layout_gravity="center"
        android:background="@drawable/backshape"
                 android:id="@+id/container">
    </FrameLayout>
</LinearLayout>

And this is the layout design And this is how the camera looks like in actual(Notice the camera is still square, But I need it circular)

Any help is very much appreciated.

Achy97
  • 994
  • 1
  • 14
  • 29

1 Answers1

0

your framelayout can be like this

        <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <SurfaceView
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
        <View
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/backShape"></View>
    </FrameLayout>
jaydeep_gedia
  • 484
  • 2
  • 4
  • 13