background
google has introduced the DrawerLayout, which shows a menu on the left area of the screen when you click on the "up" button of the action bar.
because the library isn't supported yet on actionBarSherlock, there is already a way to overcome it using this project .
it already has variants on many apps: currents, gmail, hangouts, youtube...
the question
on the "currents" app (and in youtube) , when the user slides the (most-left) page from left to right , the DrawerLayout appears, no matter where the finger has started the touch .
how can i achieve the same effect? maybe i should use onInterceptTouchEvent ?
there isn't much documentation and tutorials of what cool things can be done , other than this link (ok and this one too) . they say (in the part of "Give the user a quick peek") that about 20dp on the left is used for this functionality, but i can see that "currents" work with much larger area.
it seems the library is still not quite finished, and so the layout xml file cannot even be shown in the visual UI editor...
EDIT: it seems that the library is open sourced. code is available on :
.../android-sdk\sources\android-18\android\support\v4\widget\DrawerLayout.java
.../android-sdk\sources\android-18\android\support\v4\widget\SlidingPaneLayout.java
.../android-sdk\sources\android-18\android\support\v4\app\ActionBarDrawerToggle.java
now the question is how to make it work as i've written, so that it would work like on youtube , allowing us to customize how it looks and from where to allow scrolling it.
Give the user a quick peek If the user touches the very left edge of the screen (within 20 dp from the left), have the drawer peek out as soon as the finger makes contact with the display. This promotes accidental discovery and provides richer feedback.
Look at here. In that case you need to have another way to determine the touch in the area you wnt and trigger the drawer by usingmDrawerLayout.openDrawer(mDrawer)
– WesternizegetSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN)
– WesternizegetSlidingMenu
is from slidingmenu jfeinstein library (3rd party), btw, i already got the answer to customize the default 20dp, I'll post it in a couple of minutes while I try myself some details. – Westernize