setting panel state to hidden doesn't work
Created by: rajatpandit
i am using the slideupanel in the context of a drawer menu, an older version of the code worked fine but compiling this in api 21 doesn't work. unfortunately i dont' know the version of the working instance as in my gradle config, i had used a wild card.
has anyone else had this problem?
java code
if (slidingUpPanelLayout.getPanelState() != PanelState.HIDDEN) {
slidingUpPanelLayout.setPanelState(PanelState.HIDDEN);
}
layout xml
<!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. -->
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.sothree.slidinguppanel.SlidingUpPanelLayout
xmlns:sothree="http://schemas.android.com/apk/com.vc.audiocontent"
android:id="@+id/player_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
sothree:fadeColor="@android:color/darker_gray"
sothree:overlay="true"
sothree:umanoPanelHeight="68dp"
sothree:umanoParalaxOffset="100dp"
sothree:umanoShadowHeight="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:focusable="false"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/main_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize" />
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<fragment
android:id="@+id/player"
android:name="com.vc.audiocontent.PlayerFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/fragment_player" />
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
</LinearLayout>
<!-- android:layout_gravity="start" tells DrawerLayout to treat
this as a sliding drawer on the left side for left-to-right
languages and on the right side for right-to-left languages.
If you're not building against API 17 or higher, use
android:layout_gravity="left" instead. -->
<!-- The drawer is given a fixed width in dp and extends the full height of
the container. -->
<fragment
android:id="@+id/playlist_drawer"
android:name="com.vc.audiocontent.PlaylistFragment"
android:layout_width="@dimen/navigation_playlist_width"
android:layout_height="match_parent"
android:layout_gravity="end"
tools:layout="@layout/fragment_playlist" />
<fragment
android:id="@+id/navigation_drawer"
android:name="com.vc.audiocontent.NavigationDrawerFragment"
android:layout_width="@dimen/navigation_drawer_width"
android:layout_height="match_parent"
android:layout_gravity="start"
tools:layout="@layout/fragment_navigation_drawer" />
</android.support.v4.widget.DrawerLayout>