I'm trying to replicate Google Maps' bottom panel swipe up animation:
- Tap on Maps marker shows small, portion of bottom panel (header)
- Swipe up on the header panel reveals a full sized panel with more info.
- Swipe down on full size panel restored view to header only
- Tap off marker, and the bottom panel diasappears
Using TranslationAnimation
, I've been able to get a bottom panel to animate up when tapping on the marker. To problem I'm having, is that at the end of the animation, I must set its View to VISIBLE
so that the panel shows, but then the full panel shows and not just the top header portion.
I'm currently using a FrameLayout containing a LinearLayout as my bottom panel view:
<FrameLayout
android:id="@+id/viewBottomPane"
android:layout_width="match_parent"
android:visibility="gone"
android:background="#000000"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
android:id="@+id/paneHeader"
layout="@layout/headerPanel" />
<TextView
android:id="@+id/paneFooter"
android:text=""
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</FrameLayout>
I'd like to just show paneHeader
on Map marker tap, then swipe up to show full viewBottomPane
, swipe down to show paneHeader
and tap off marker to hide all.
I´ve used this library for that purpouse before and worked pretty good.
The documentation says this
I´ve tried on Android 2.3.6 and it works perfectly. Don't know if you need it to be backwards compatible but if you do this will be helpful.
You´ve got the xml part
And the listeners on your class
Also you can state with view will trigger the pane up event.
Hope it helps! :)