mohebifar / react-native-copilot

Step-by-step walkthrough tooltip for your react native app
MIT License
2.25k stars 408 forks source link

Android Overlay doesn't work #320

Open jgalianoz opened 5 months ago

jgalianoz commented 5 months ago

Current Behavior The overlay is not working correctly on some Android devices, with incorrect positioning. On iOS, everything works perfectly.

Input Code

<CopilotProvider
                androidStatusBarVisible={Platform.OS === 'android'}
                backdropColor={color.lightDarkBlack}
                tooltipStyle={NativeStyles.tooltip}
                tooltipComponent={TutorialTooltip}
                stepNumberComponent={() => null}
                arrowStyle={NativeStyles.arrow}
                animated={false}
              >
                <StatusBar style="auto" translucent />
                <Navigation />
              </CopilotProvider>

Expected behavior/code A clear and concise description of what you expected to happen (or code).

Environment

Possible Solution

Additional context/Screenshots

image image
brien-crean commented 4 months ago

I also had this issue on Android and solved it by passing the current height of the StatusBar as the verticalOffset. I am not currently working on an iOS app so you may want to pass 0 if Platform.OS === 'ios'.

import { StatusBar } from 'react-native';
import { CopilotProvider } from 'react-native-copilot';

<CopilotProvider
    overlay="svg"
    verticalOffset={StatusBar.currentHeight}
  >
  {children}
</CopilotProvider>