Code Monkey home page Code Monkey logo

Comments (6)

spalmerin21 avatar spalmerin21 commented on September 23, 2024

This took me hours to find the cause after stripping my entire application. Does anyone have a good work around for this?

from androidslidinguppanel.

tokudu avatar tokudu commented on September 23, 2024

I'll look into the bug when I have time, work around: manually set the title for the action bar.

from androidslidinguppanel.

spalmerin21 avatar spalmerin21 commented on September 23, 2024

Looking at the problem description a little closer, my problem is a little different. The DrawerItemClickListener is never triggered when clicking an item. It simply closes the drawer as if there was no selection.

from androidslidinguppanel.

spalmerin21 avatar spalmerin21 commented on September 23, 2024

You can test by putting the DrawerLayout xml around the SlidingUpPanelLayout as shown below. As soon as you remove the SlidingUpPanelLayout, the DrawerLayout items become clickable.

<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" >

    <FrameLayout
        android:id="@+id/fragment_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
    <!-- The navigation drawer -->

    <ListView
        android:id="@+id/left_drawer"
        android:layout_width="240dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="#111"
        android:choiceMode="singleChoice"
        android:divider="@android:color/transparent"
        android:dividerHeight="0dp" />

    <com.sothree.slidinguppanel.SlidingUpPanelLayout
        android:id="@+id/sliding_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <TextView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center"
            android:text="Main Content"
            android:textSize="16sp" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center|top"
            android:text="The Awesome Sliding Up Panel"
            android:textSize="16sp" />
    </com.sothree.slidinguppanel.SlidingUpPanelLayout>
</android.support.v4.widget.DrawerLayout>

from androidslidinguppanel.

spalmerin21 avatar spalmerin21 commented on September 23, 2024

I solved the problem. I needed to move the ListView outside of the SlidingUpPanelLayout. This will make the items clickable as well as change the action bar title

<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" >

    <FrameLayout
        android:id="@+id/fragment_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
    <!-- The navigation drawer -->

    <com.sothree.slidinguppanel.SlidingUpPanelLayout
        android:id="@+id/sliding_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <TextView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center"
            android:text="Main Content"
            android:textSize="16sp" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center|top"
            android:text="The Awesome Sliding Up Panel"
            android:textSize="16sp" />
    </com.sothree.slidinguppanel.SlidingUpPanelLayout>

     <ListView
        android:id="@+id/left_drawer"
        android:layout_width="240dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="#111"
        android:choiceMode="singleChoice"
        android:divider="@android:color/transparent"
        android:dividerHeight="0dp" />

</android.support.v4.widget.DrawerLayout>

from androidslidinguppanel.

tanhs avatar tanhs commented on September 23, 2024

It looks good. Thanks.

from androidslidinguppanel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.