Анимация нижнего листа и кнопки, как в Google Map - PullRequest
0 голосов
/ 09 декабря 2018

Я хочу добиться того же поведения анимации в Android, что и карта Google, где bottomsheet скользит с помощью кнопок, закрепленных наверху на некоторое время.После достижения определенной высоты bottomsheet скользит по кнопкам.Мне удалось закрепить кнопку на вершине bottomsheet с помощью layout_anchorGravity="top|left", но я не знаю, как скользить по ней после того, как она достигнет определенной высоты.Я действительно застрял в этой проблеме, и это сводит меня с ума.

    <androidx.coordinatorlayout.widget.CoordinatorLayoutxmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/coordinator_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >
        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="16dp"
            android:orientation="vertical"
            app:layout_anchor="@+id/bottomsheet"
            app:layout_anchorGravity="top|left">

            <Button
                android:id="@+id/fab"
                android:layout_width="40dp"
                android:layout_height="40dp"
                android:background="#FFFFFF"
                android:textColor="#000000"
                android:layout_marginBottom="10dp"/>

            <Button
                android:id="@+id/fab1"
                android:layout_width="40dp"
                android:layout_height="40dp"
                android:background="#FFFFFF"
                android:textColor="#000000"
                />

        </LinearLayout>


    <FrameLayout
        android:id="@+id/bottom_sheet"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:behavior_hideable="true"
       app:layout_behavior="android.support.design.widget.BottomSheetBehavior">

        bottom sheet layout

  </FrameLayout>
    </androidx.coordinatorlayout.widget.CoordinatorLayout>

enter image description here enter image description here

...