Skip to content

[Android] useAnimatedKeyboard hook breaks translucent status bar #4277

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

Closed
peterlazar1993 opened this issue Mar 24, 2023 · 2 comments · Fixed by #4390
Closed

[Android] useAnimatedKeyboard hook breaks translucent status bar #4277

peterlazar1993 opened this issue Mar 24, 2023 · 2 comments · Fixed by #4390
Labels
Needs review Issue is ready to be reviewed by a maintainer Platform: Android This issue is specific to Android Repro provided A reproduction with a snippet of code, snack or repo is provided

Comments

@peterlazar1993
Copy link

peterlazar1993 commented Mar 24, 2023

Description

I have a translucent StatusBar so that I can draw content beneath the status bar.

On Android, after un-mounting a screen with the useAnimatedKeyboard hook with isStatusBarTranslucentAndroid set to true, the status bar loses it's translucency and I cannot draw content beneath the StatusBar again.

This issue was previously reported in #3631 and a fix was deployed in #3958. I do not think the fix is complete since on un-mount the status bar is broken.

keyboard.mp4

Workaround

Reset the StatusBar on component un-mount

...
useEffect(() => {
    return () => {
      StatusBar.setBarStyle('light-content');
      StatusBar.setTranslucent(true);
      StatusBar.setBackgroundColor('transparent');
    };
  }, []);
...

Steps to reproduce

  1. Setup repo, run on Android
  2. Press the useAnimatedKeyboard Bug button
  3. Once page mounts, navigate back
  4. The status bar is not translucent anymore

Snack or a link to a repository

https://github.com/peterlazar1993/reanimated-bug

Reanimated version

3.0.2

React Native version

0.71.4

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

Real device

Device model

Realme X7 Max - Android 13

Acknowledgements

Yes

@peterlazar1993 peterlazar1993 added the Needs review Issue is ready to be reviewed by a maintainer label Mar 24, 2023
@github-actions github-actions bot added Platform: Android This issue is specific to Android Repro provided A reproduction with a snippet of code, snack or repo is provided labels Mar 24, 2023
@TomWq
Copy link

TomWq commented Mar 26, 2023

That's true. I thought I was the only one with that problem

fluiddot pushed a commit to wordpress-mobile/react-native-reanimated that referenced this issue Jun 5, 2023
…software-mansion#4390)

<!-- Thanks for submitting a pull request! We appreciate you spending
the time to work on these changes. Please follow the template so that
the reviewers can easily understand what the code changes affect. -->

## Summary

FIX [Android] useAnimatedKeyboard hook breaks translucent status bar
software-mansion#4277
Fixes software-mansion#4277
<!-- Explain the motivation for this PR. Include "Fixes #<number>" if
applicable. -->

## Test plan
Tested on both Paper & Fabric

Co-authored-by: Aleksandra Cynk <[email protected]>
@ugar0ff
Copy link

ugar0ff commented Dec 8, 2024

same issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs review Issue is ready to be reviewed by a maintainer Platform: Android This issue is specific to Android Repro provided A reproduction with a snippet of code, snack or repo is provided
Projects
None yet
3 participants