协调员布局或底部表格行为

时间:2017-09-02 06:32:56

标签: android gmail android-coordinatorlayout bottom-sheet

我想创建一个布局作为Gmail个人资料视图

this

当用户向上滚动时,配置文件图像应转换为操作栏图标,与gmail配置文件视图相同。

我通过使用底部工作表行为创建这样的视图,但是在向上滚动时用户图标移动到应用程序图标没有完成。

scrolled Up

如何使用底页实现此功能? 或者我是否需要将其更改为协调员布局?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/bottom_sheet_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    app:behavior_hideable="true"
    app:behavior_peekHeight="120dp"
    app:layout_behavior="@string/bottom_sheet_behavior">
    <FrameLayout
        android:id="@+id/top_frame"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <ImageView
            android:id="@+id/v_not_to_switch"
            android:layout_width="match_parent"
            android:layout_height="33dp"
            android:layout_gravity="bottom"
            android:background="@color/colorWhite" />

        <ImageView
            android:id="@+id/v_to_switch"
            android:layout_width="match_parent"
            android:layout_height="27dp"
            android:layout_gravity="top"
            android:background="@color/colorTransparent" />


        <de.hdodenhof.circleimageview.CircleImageView 
            xmlns:app_a="http://schemas.android.com/apk/res-auto"
            android:id="@+id/img_top_author_icon"
            android:layout_width="60dp"
            android:layout_height="60dp"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="0dp"
            android:src="@drawable/saple_user"
            app_a:civ_border_color="@color/colorWhite"
            app_a:civ_border_width="3dp" />
    </FrameLayout>
    <android.support.v7.widget.RecyclerView
         android:id="@+id/rv_article_detail_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/colorWhite"/>
</LinearLayout>

0 个答案:

没有答案
相关问题