New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sliding up panel crashes with Navigation Drawer #113
Comments
Same. Having DrawerLayout as the root of the layout with a slidinguppanellayout child results in this error: And modifying the gravity of the SlidingUpPanelLayout results in this error: llegalArgumentException: layout_gravity must be set to either top or bottom |
You must specify the layout_gravity property in SlidingUpPanelLayout. |
This occurs with the layout_gravity property set: <android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.sothree.slidinguppanel.SlidingUpPanelLayout
xmlns:sothree="http://schemas.android.com/apk/res/..."
android:id="@+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom"
sothree:collapsedHeight="@dimen/header_height"
sothree:shadowHeight="4dp" >
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<FrameLayout
android:id="@+id/lower_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
<ListView android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#111"/>
</android.support.v4.widget.DrawerLayout>``` |
That's probably a bug. I will have a look. |
Im using it wiithout problems with the Navigation Drawer
</android.support.v4.widget.DrawerLayout> |
It looks like commit 0d3be introduced a check for correct values of layout_gravity. If no correct value is found an exception is thrown. However, setting the layout_gravity as bottom will throw an exception in the onMeasure of the DrawerLayout. My workaround is to hardcode the gravity in the constructor. I'm not sure of best practices, but I recommend adding a .setGravity( TOP | BOTTOM) or custom xml option for SlidingUpPanelLayout. This way we avoid DrawerLayout's check of its child views and still allow for custom gravity settings. |
@powelldev @BradleyRL Hey guys check this out The sliding up drawer works but has some overlapping issues. |
I'm facing the same problem @powelldev how you fixed this issue? |
I just checked in 77a8fba. The attribute was named incorrectly, it should have been |
@tokudu |
Can you post your code somewhere? We have a NagivationDrawer in Umano, and Anton On Sun, Feb 23, 2014 at 1:43 AM, Akshay notifications@github.com wrote:
Anton Lopyrev |
@sothree |
@sothree |
I am using it DrawerLayout but the Sliding Panel is not getting dragged. Tried moving it move the fragment but it also didn't help. Layout File <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
</android.support.v4.widget.DrawerLayout> The method onInterceptTouchEvent of SlidingUpPanelLayout always return false. Even pull the source from https://github.com/ribot/AndroidSlidingUpPanel who applied a fix but still the Sliding Panel remain fixed on bottom. Any ideas?? |
It was my bad, got it working. |
Hi,
First of all, Thanks for providing this awesome library. I wanna use this library with the new Navigation Drawer.
I tried implementing but the app crashes.
I hope someone can help me solve this problem.
The text was updated successfully, but these errors were encountered: