intergalacticspacehighway / react-native-z-view

Show a View on top of all the views in React Native, like an overlay.
MIT License
141 stars 2 forks source link

react-native 0.66.5 failed with this library #2

Open chj-damon opened 1 year ago

chj-damon commented 1 year ago

/Users/damon/Documents/thundersdata/frontend/rn-template/node_modules/react-native-z-view/android/src/main/java/com/reactnativezview/ZViewRootViewGroup.java:11: 错误: 找不到符号 import com.facebook.react.uimanager.JSPointerDispatcher; ^ 符号: 类 JSPointerDispatcher 位置: 程序包 com.facebook.react.uimanager /Users/damon/Documents/thundersdata/frontend/rn-template/node_modules/react-native-z-view/android/src/main/java/com/reactnativezview/ZViewRootViewGroup.java:22: 错误: 找不到符号 private JSPointerDispatcher mJSPointerDispatcher; ^ 符号: 类 JSPointerDispatcher 位置: 类 ZViewRootViewGroup /Users/damon/Documents/thundersdata/frontend/rn-template/node_modules/react-native-z-view/android/src/main/java/com/reactnativezview/ZViewRootViewGroup.java:26: 错误: 找不到符号 if (ReactFeatureFlags.dispatchPointerEvents) { ^ 符号: 变量 dispatchPointerEvents 位置: 类 ReactFeatureFlags /Users/damon/Documents/thundersdata/frontend/rn-template/node_modules/react-native-z-view/android/src/main/java/com/reactnativezview/ZViewRootViewGroup.java:26: 错误: 非法的含括号表达式 if (ReactFeatureFlags.dispatchPointerEvents) { ^ /Users/damon/Documents/thundersdata/frontend/rn-template/node_modules/react-native-z-view/android/src/main/java/com/reactnativezview/ZViewRootViewGroup.java:27: 错误: 找不到符号 this.mJSPointerDispatcher = new JSPointerDispatcher(this); ^ 符号: 类 JSPointerDispatcher 位置: 类 ZViewRootViewGroup /Users/damon/Documents/thundersdata/frontend/rn-template/node_modules/react-native-z-view/android/src/main/java/com/reactnativezview/ZViewRootViewGroup.java:91: 错误: 找不到符号 this.mJSTouchDispatcher.onChildEndedNativeGesture(ev, this.mEventDispatcher); ^ 符号: 方法 onChildEndedNativeGesture(MotionEvent,EventDispatcher) 位置: 类型为JSTouchDispatcher的变量 mJSTouchDispatcher 6 个错误

FAILURE: Build failed with an exception.

chj-damon commented 1 year ago

0.72 works fine.

chj-damon commented 1 year ago

I also noticed that ZView cannot cover StatusBar and NavigationBar, which makes the effect a litter weird to me.

image

here's the code:

<ZView>
  <View
    style={{
      width,
      height,
      backgroundColor: 'rgba(0, 0, 0, 0.5)',
    }}
  >
    <Text>{message}</Text>
  </View>
</ZView>
chj-damon commented 1 year ago

I also tried on IOS, it works fine.

chj-damon commented 1 year ago

simulator_screenshot_FB3D0E5B-1731-43AA-A099-9C9146D821B8

intergalacticspacehighway commented 1 year ago

ZView cannot cover StatusBar and NavigationBar

@chj-damon This should be fixed in 0.2.3

react-native 0.66.5 failed with this library

Looks like it is failing pointer event imports which were recently added. Is something blocking you from upgrading to the latest RN?

chj-damon commented 1 year ago

I'm just maintaining a UI Library which supports most react-native versions from 0.66 above. I don't think it's a good idea to tell developers this UI Library is only compatiable with the latest RN.

intergalacticspacehighway commented 1 year ago

@chj-damon Published a new version 0.2.4. It should fix the 0.66.5 compilation issue. Let me know if you still face any issues.

chj-damon commented 1 year ago

tried the latest 0.2.4 version. something went wrong. here's my code:

<ZView touchable>
  <View
    style={{
      width,
      // height: 200,
      // padding: 40,
      backgroundColor: 'rgba(0, 0, 0, 0.5)',
    }}
  >
    <Text style={{color: 'white'}}>Full size overlay view</Text>
  </View>
</ZView>

when height or padding not set, it works fine. ZView will cover the StatusBar, but once either of height or padding been set, it won't work.

821693562944_ pic 831693562973_ pic

intergalacticspacehighway commented 1 year ago

@chj-damon Seems to be working fine for me on a physical device and also emulator with/without height/padding. Can you try to repro in a new RN app and check if it is reproducible?

Screenshot 2023-09-01 at 4 14 27 PM