Android: How to use translucent status and navigation bars #5525
AE1NS
started this conversation in
Show and tell
Replies: 1 comment
-
I created a capacitor plugin for this: https://github.com/NePheus/capacitor-adjust-resize |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Our app uses translucent status and navigation bars in the Android implementation. So i.e. map views fills the whole viewarea and is also visible behind the transparent status bar, up to the rounded corners of new devices. This looks much better for me and is similar to native map apps.
To achieve this, you have to se this setting inside the styles.xml:
<item name="android:windowTranslucentNavigation">true</item>
Unfortunately I have discovered an issue with the keyboard here. It seems to be a general android issue, that they keyboard does not adjust the layout, when setting the translucent navigation, but overlays the bottom part of the webview. To fix this, you can do the following:
Create a file KeyboardUtil.java in the same folder as the MainActivity.java:
Call it inside the MainActivity:
Now the CoordinatorLayout of capacitors main layout automatically adjusts, when they keyboard is shown or hidden.
Beta Was this translation helpful? Give feedback.
All reactions