0

I have to use SlidingDrawer in my app. I know this class is deprecated but it very useful to do what i want so i have decided to use it.

I've used this link

Android: can height of SlidingDrawer be set with wrap_content?

in order to use wrap_content when the SlidinDrawer is open. It works perfect on android 4.2.2 with AOSP rom but with android 4.0.4 on SGSII (Samsung rom), i have some display problem when i open or close the SlidingDrawer. If there is no action, the widget appears correctly.

Have you any idea why there is this problem ?

Edit : Here is a screenshot. The problem disappeared when i took a screenshot, so to see the problem i took a photo with another device. enter image description here

Community
  • 1
  • 1
mrroboaat
  • 5,602
  • 7
  • 37
  • 65

1 Answers1

1

Alternate to SlidingDrawer is "Custom Sliding Drawer".

Sephiroth has created one of it. It has option to sliding up and down. It has handler which is used like actual handle to open and close Sliding Drawer.

I will suggest you to implement this custom one. This will solve your problem.

You just need to define following in your layout

<view class="it.sephiroth.demo.slider.widget.MultiDirectionSlidingDrawer"
     xmlns:my="http://schemas.android.com/apk/res/it.sephiroth.demo.slider"
     android:id="@+id/drawer"
     my:direction="topToBottom"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     my:handle="@+id/handle"
     my:content="@+id/content">

     <include android:id="@id/content"
         layout="@layout/pen_content" />

     <imageview android:id="@id/handle"
          android:layout_width="wrap_content"
          android:layout_height="40dp"
          android:src="@drawable/sliding_drawer_handle_bottom" />
</view>

Thats it. Your sliding drawer is ready to work.

Chintan Rathod
  • 25,864
  • 13
  • 83
  • 93
  • Is it a way to use wrap_content for the height of this custom sliding drawer ? – mrroboaat May 20 '13 at 12:18
  • i think you should give exact "dp" height to your drawer. For each screen size you can provide it and this will not "wrap" after initialization. – Chintan Rathod May 20 '13 at 12:45
  • It's okay, I find the solution for the height but I have the problem again for the display. If I open up, i can see the content but when i want to close it, the content disappears ... And the problem persists on my SGS II with android 4.0.4 whereas it works perfectly on Galaxy NOte with android 4.2.2 – mrroboaat May 20 '13 at 12:52
  • my friend, I never use deprecated things. It is deprecated due to some reason. and that is why I search for alternative. I can't help you in inbuild SlidingDrawer. – Chintan Rathod May 20 '13 at 12:56
  • arf ! It's strange, I find it's a nice widget but i agree if it is deprecated it's maybe, there are too problems with it ... – mrroboaat May 20 '13 at 13:04