Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I researched the code of <code>DrawerLayout</code> and found the next issue: When we touch the edge of screen there appears small (20*density px) part of the <code>drawer</code> (it makes moving drawer easier). It doesn't appears immediatly, but after a certain interval (160 ms) of time. It is realized by <code>postDelayed</code>. </p> <p>The <code>drawer</code> can be in several states: <code>IDLE</code>, <code>DRAGGING</code> and <code>SETTLING</code>. If it was in the <code>DRAGGING</code> state, it cannot return to this state anymore with the same pointer and edge (because there is a condition: <code>mEdgeDragsInProgress[pointerId] &amp; edge) == edge</code> which doesn't allow to drag the edge which have been dragging already). </p> <p>So in some cases the drawer have moved to the state <code>DRAGGING</code> already when delayed <code>Runnable</code> is executing. This delayed action opens <code>drawer</code> for 20*density px and change state of <code>drawer</code>. So <code>drawer</code> cannot be moved anymore (because it cannot return to the state <code>DRAGGING</code>).</p> <p>There is a code for cancelling delayed action (which opens drawer), but this code in the method <code>onInterceptTouchEvent</code>, which is called only once (because it returns <code>false</code>). I think this code should be in the method <code>onTouchEvent</code>.</p> <p>Unfortunatly I didn't find any way to cancel delayed event (because it has <code>private</code> modifier and I can't get it). So only one way I found: copy the source code of <code>DrawerLayout</code> to my project and make this small change: copy </p> <pre><code>case MotionEvent.ACTION_MOVE: { // If we cross the touch slop, don't perform the delayed peek for an edge touch. if (mLeftDragger.checkTouchSlop(ViewDragHelper.DIRECTION_ALL)) { mLeftCallback.removeCallbacks(); mRightCallback.removeCallbacks(); } break; } </code></pre> <p>from the method <code>onInterceptTouchEvent</code> to the method <code>onTouchEvent</code>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload