2

Proactively hide the handle of a slide drawer

 2 years ago
source link: https://www.codesd.com/item/proactively-hide-the-handle-of-a-slide-drawer.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Proactively hide the handle of a slide drawer

advertisements

Is there a way on how I could hide the handle of a sliding drawer upon opening the sliding drawer? I've tried using the setVisibility(View.GONE) method when the OnDrawerOpenListener was triggered, but the handle is still visible. Is it possible to hide the handle of the drawer or it would always be visible? Here's a snippet of the xml of my sliding drawer:

        <SlidingDrawer android:layout_width="wrap_content"
        android:id="@+id/notifDrawer" android:handle="@+id/notifHandle"
        android:content="@+id/notifContent" android:layout_height="fill_parent"
        android:orientation="horizontal">
        <LinearLayout android:id="@+id/notifHandle"
            android:layout_width="wrap_content" android:layout_height="fill_parent"
            android:background="@drawable/button_selected" android:orientation="vertical"
            android:padding="0dip" android:gravity="center">
            <TextView android:id="@+id/notification_count"
                android:visibility="gone" android:layout_width="wrap_content"
                android:layout_height="wrap_content" android:textSize="10sp"
                android:textStyle="bold" android:textColor="#FFFFFF"
                android:gravity="center" android:background="@drawable/badge">
            </TextView>
        </LinearLayout>
        <ListView android:id="@+id/notifContent"
            android:layout_width="fill_parent" android:layout_height="fill_parent"
            android:background="#C0C0C0" android:divider="@drawable/divider"
            android:fadingEdge="none">
        </ListView>
    </SlidingDrawer>


Following trick worked for me

    <Button
      android:id="@+id/handle"
      android:layout_width="0dp"
      android:layout_height="0dp"
      android:background="#00000000" />




About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK