Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Correctly display cozy-apps when the device's Keyboard is displayed #1024

Merged
merged 2 commits into from
Nov 21, 2023
Merged
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
6 changes: 5 additions & 1 deletion src/components/webviews/CozyProxyWebView.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ export const CozyProxyWebView = ({
const Wrapper = Platform.OS === 'ios' ? View : KeyboardAvoidingView

return (
<Wrapper style={{ ...styles.view, ...style }} behavior="height">
<Wrapper
style={{ ...styles.view, ...style }}
behavior="height"
keyboardVerticalOffset={props.keyboardVerticalOffset || 0}
>
{state.source ? (
<CozyWebView
source={state.source}
Expand Down
34 changes: 15 additions & 19 deletions src/screens/cozy-app/CozyAppScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ export const CozyAppScreen = ({

<View
style={{
height: isFirstHalf
? dimensions.statusBarHeight
: styles.immersiveHeight.height,
height: dimensions.statusBarHeight,
backgroundColor: topBackground
}}
>
Expand All @@ -79,19 +77,6 @@ export const CozyAppScreen = ({
</View>

<View style={styles.mainView}>
{
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
route.params.iconParams && !isReady && (
<Animation
onFirstHalf={setFirstHalf}
onFinished={setReady}
shouldExit={shouldExitAnimation}
params={route.params.iconParams}
slug={route.params.slug}
/>
)
}

<CozyProxyWebView
style={webViewStyle}
slug={route.params.slug}
Expand All @@ -101,14 +86,13 @@ export const CozyAppScreen = ({
logId="AppScreen"
onLoadEnd={onLoadEnd}
onError={handleError}
keyboardVerticalOffset={dimensions.statusBarHeight}
/>
</View>

<View
style={{
height: isFirstHalf
? dimensions.navbarHeight
: styles.immersiveHeight.height,
height: dimensions.navbarHeight,
backgroundColor: bottomBackground
}}
>
Expand All @@ -119,6 +103,18 @@ export const CozyAppScreen = ({
}}
/>
</View>
{
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
route.params.iconParams && !isReady && (
<Animation
onFirstHalf={setFirstHalf}
onFinished={setReady}
shouldExit={shouldExitAnimation}
params={route.params.iconParams}
slug={route.params.slug}
/>
)
}
</>
)
}
Loading