Q:

SlidingDrawer semi opened on start

I am working a piece of my app and I was wondering if it's possible to have a Sliding Drawer open partially instead of being fully closed so the user can peak at the text content before clicking the show more button which would be able to show the rest of the text. 
Thanks in advance. 

A:

I had a similar problem and I ended up modifying SlidingDrawer to be able to show a part of the content when the Drawer is collapsed/closed.  With SemiClosedSlidingDrawer you specify how much of the content screen that should be shown in collapsed/closed mode with the dimension attribute 'semiClosedContentSize':
<se.smartrefill.view. SemiClosedSlidingDrawer 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:custom="http://schemas.android.com/apk/res/se.smartrefill.app.x"
    android:id="@+id/mySlidingDrawer"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    custom:orientation="horizontal"
    custom:handle="@+id/handle"
    custom:content="@+id/content"
    custom:allowSingleTap="true"
    custom:semiClosedContentSize="40dp"
    >

Then your attrs.xml (in res/values/) also needs to contain:
<declare-styleable name="SemiClosedSlidingDrawer">
    <attr name="handle" format="integer"/>
    <attr name="content" format="integer"/>
    <attr name="orientation" format="string" />
    <attr name="bottomOffset" format="dimension"  />
    <attr name="topOffset" format="dimension"  />
    <attr name="allowSingleTap" format="boolean" />
    <attr name="animateOnClick" format="boolean" />
    <attr name="semiClosedContentSize" format="dimension" />
</declare-styleable>

, where 'se.smartrefill.app.x' refers to the application package defined in the AndroidManifest. 
This specific SlidingDrawer (above) is configured to use horizontal orientation, and a 40dp wide (and fill_parent high) strip of the content view will be shown (to the right) in collapsed/closed mode.  In expanded/open mode, this implementation will work just as the standard SlidingDrawer, but in collapsed/closed mode the content screen will never become completely hidden (unless you specify semiClosedContentSize="0dp", which will turn it into a standard SlidingDrawer).  This implementation is based on the implementation of SlidingDrawer in Android-4 ("1.6"), but is compatible up to (incl.)  Android-14 ("4.0").  This implementation ought to be compatible with future versions of Android as well (almost nothing has changed in SlidingDrawer between API 4 and API 14).  This implementation supports both vertical and horizontal orientation.  
Try it out! 
Regards,
Jacob

