使用Floating Action Button動畫切換兩個視圖的布局:FABRevealLayout
FABRevealLayout 一個使用Floating Action Button動畫切換兩個視圖的布局,基于Material Design。

FABRevealLayout用起來很簡單。你只需在布局里面包含一個Design Support Library的FloatingActionButton以及兩個view(這里稱為主view與次view)。FABRevealLayout會自動擺放它們的位置并提供兩個view之間的動畫切換功能。
<com.truizlop.fabreveallayout.FABRevealLayout
android:id="@+id/fab_reveal_layout"
android:layout_width="match_parent"
android:layout_height="@dimen/fab_reveal_height"
>
<android.support.design.widget.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:backgroundTint="@color/some_color"
android:src="@drawable/some_drawable"
/>
<RelativeLayout
android:id="@+id/main_view"
android:layout_width="match_parent"
android:layout_height="match_parent">
...
</RelativeLayout>
<RelativeLayout
android:id="@+id/secondary_view"
android:layout_width="match_parent"
android:layout_height="match_parent">
...
</RelativeLayout>
</com.truizlop.fabreveallayout.FABRevealLayout></pre>
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!