Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ allprojects {

dependencies {
compile "com.facebook.react:react-native:+"
compile "com.android.support:appcompat-v7:26.1.0"
compile 'com.android.support:design:26.1.0'
compile "com.android.support:appcompat-v7:27.1.1"
compile "com.android.support:design:27.1.1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,14 @@ public boolean onLayoutChild( CoordinatorLayout parent, V child, int layoutDirec
toggleHeaderColor(false);
ViewCompat.offsetTopAndBottom(child, mMaxOffset);
}

/**
* Workaround for support SDK 27 race condition
*/
if ( mViewDragHelper == null ) {
mViewDragHelper = ViewDragHelper.create( parent, mDragCallback );
}

mViewRef = new WeakReference<>(child);
mNestedScrollingChildRef = new WeakReference<>( findScrollingChild( child ) );
return true;
Expand All @@ -203,6 +208,13 @@ public boolean onInterceptTouchEvent( CoordinatorLayout parent, V child, MotionE
return false;
}

/**
* Workaround for Support SDK 27 race condition. We'll wait until mViewDragHelper is available
*/
if ( mViewDragHelper == null ) {
return false;
}

int action = MotionEventCompat.getActionMasked( event );
if ( action == MotionEvent.ACTION_DOWN ) {
reset();
Expand All @@ -219,6 +231,7 @@ public boolean onInterceptTouchEvent( CoordinatorLayout parent, V child, MotionE
return false;
}
break;

case MotionEvent.ACTION_DOWN:
int initialX = (int) event.getX();
mInitialY = (int) event.getY();
Expand All @@ -235,6 +248,7 @@ public boolean onInterceptTouchEvent( CoordinatorLayout parent, V child, MotionE
mIgnoreEvents = mActivePointerId == MotionEvent.INVALID_POINTER_ID &&
!parent.isPointInChildBounds(child, initialX, mInitialY);
break;

case MotionEvent.ACTION_MOVE:
break;
}
Expand All @@ -243,7 +257,7 @@ public boolean onInterceptTouchEvent( CoordinatorLayout parent, V child, MotionE
// We don't want to trigger a BottomSheet fling as a result of a Cancel MotionEvent (e.g., parent horizontal scroll view taking over touch events)
mScrollVelocityTracker.clear();
}

if ( ! mIgnoreEvents && mViewDragHelper.shouldInterceptTouchEvent( event ) ) {
return true;
}
Expand Down