-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat!: support previous non-E2E #1817
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
base: master
Are you sure you want to change the base?
feat!: support previous non-E2E #1817
Conversation
} | ||
} else { | ||
Window window = cordova.getActivity().getWindow(); | ||
int uiOptions = window.getDecorView().getSystemUiVisibility(); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
View.getSystemUiVisibility
uiOptions |= flags; | ||
window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); | ||
} | ||
window.getDecorView().setSystemUiVisibility(uiOptions); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
View.setSystemUiVisibility
|
||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | ||
// Allow custom navigation bar background color for SDK 26 and greater. | ||
window.setNavigationBarColor(bgColor); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
Window.setNavigationBarColor
window.setNavigationBarColor(bgColor); | ||
} else { | ||
// Force navigation bar to black for SDK 25 and less. | ||
window.setNavigationBarColor(Color.BLACK); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
Window.setNavigationBarColor
controllerCompat.setAppearanceLightStatusBars(isStatusBarBackgroundColorLight); | ||
|
||
// Allow custom background color for StatusBar. | ||
window.setStatusBarColor(bgColor); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note
Window.setStatusBarColor
private View getStatusBarView(CordovaWebView webView) { | ||
FrameLayout rootView = getRootLayout(webView); | ||
for (int i = 0; i < (rootView != null ? rootView.getChildCount() : 0); i++) { | ||
View child = rootView.getChildAt(i); |
Check warning
Code scanning / CodeQL
Dereferenced variable may be null Warning
rootView
this
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1817 +/- ##
==========================================
+ Coverage 72.12% 72.63% +0.51%
==========================================
Files 23 23
Lines 1844 1831 -13
==========================================
Hits 1330 1330
+ Misses 514 501 -13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
} | ||
} | ||
|
||
private void setStatusBarBackgroundColor(final String colorPref) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For iOS, I passed the colour values as 3 integers, which allowed a bit more flexibility in how it was specified on the JS side (i.e., to allow setting it to rgb(123 234 124)
or maroon
and using CSS.getComputedStyle to parse it and guarantee we'd get 3 RGB components)
// Confirm if value is a valid hex code is before passing to native-side | ||
if (!(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(value))) { | ||
console.error('Invalid color hex code. Valid format: #RRGGBB or #AARRGGBB'); | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The iOS side did some smart parsing using the getComputedStyle
API to take any valid CSS colour specification and get back RGB components
You might be able to use |
b4e4b54
to
250a0c6
Compare
Motivation and Context
Description
StatusBar JS API:
window.statusbar.visible = <true|false>
window.statusbar.setBackgroundColor('#AARRGGBB')
`config.xml preferences:
This PR reuses all of the previous preferences. Order of imports listed below
StatusBarBackgroundColor
BackgroundColor
BackgroundColor
Testing
npm t
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)