Create curve layout to use bottom sheet android

2019-07-30 00:08发布

问题:

I am using bottomsheet in my application .I want to create my sheet like this image:

how can i create curve layout? I want when clicking on green circle, bottom sheet open .

I have created this shape :

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape xmlns:android="http://schemas.android.com/apk/res/android"
            android:shape="oval">
            <solid android:color="#4f5551" />
            <size
                android:width="100dp"
                android:height="50dp" />

        </shape>
    </item>
    <item
        android:bottom="-100dp"
        android:left="-2000dp"
        android:right="-1300dp"
        android:top="48dp">
        <shape xmlns:android="http://schemas.android.com/apk/res/android">
            <solid android:color="#4f5551" />
            <size
                android:width="100dp"
                android:height="500dp" />
        </shape>
    </item>
</layer-list>

It does not look like at all :-(

************************* Edit **************

After googling i found this link : instead of BottomNavigationView i extended of RelativeLayout and this is my layout:

<com.example.saidi.custombottobar.view.ButtomSheetCustom
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:layout_marginTop="200dp"
        android:background="@color/colorAccent"
        tools:context=".view.MainActivity">

How can i rotate those curve to the top of layout instead of inner curve?