mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-10 09:13:43 +08:00
Android: Disable touch interaction on screens that are transitioning (#51)
This commit is contained in:
committed by
GitHub
parent
ed14cd3a87
commit
ac719105ac
@@ -7,10 +7,13 @@ import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import com.facebook.react.uimanager.PointerEvents;
|
||||
import com.facebook.react.uimanager.ReactPointerEventsView;
|
||||
|
||||
public class Screen extends ViewGroup {
|
||||
public class Screen extends ViewGroup implements ReactPointerEventsView {
|
||||
|
||||
public static class ScreenFragment extends Fragment {
|
||||
|
||||
@@ -67,6 +70,11 @@ public class Screen extends ViewGroup {
|
||||
return mTransitioning;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PointerEvents getPointerEvents() {
|
||||
return mTransitioning ? PointerEvents.NONE : PointerEvents.AUTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLayerType(int layerType, @Nullable Paint paint) {
|
||||
// ignore – layer type is controlled by `transitioning` prop
|
||||
|
||||
Reference in New Issue
Block a user