-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 splash screen logo size jump on Samsung OneUI v4 #28644
Conversation
@@ -72,7 +72,7 @@ | |||
|
|||
<style name="BootTheme" parent="Theme.SplashScreen"> | |||
<item name="android:statusBarColor">@android:color/transparent</item> | |||
<item name="windowSplashScreenAnimatedIcon">@mipmap/bootsplash_logo</item> | |||
<item name="windowSplashScreenAnimatedIcon">@drawable/bootsplash_logo</item> |
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.
I moved the bootsplash logo from mipmap-*
to drawable-*
directories to align with react-native-bootsplash
v5 and AndroidX core-splashscreen
// From https://stackoverflow.com/a/61062773 | ||
public static boolean isSamsungOneUI4() { | ||
String name = "SEM_PLATFORM_INT"; | ||
|
||
try { | ||
Field field = Build.VERSION.class.getDeclaredField(name); | ||
int version = (field.getInt(null) - 90000) / 10000; | ||
return version == 4; | ||
} catch (Exception ignored) { | ||
return false; | ||
} | ||
} |
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.
I understand not wanting to bundle this in the library, but just curious if you thought about this?
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.
I will apply the same in react-native-bootsplash
in a upcoming version.
This is not pretty, but it's extracted from a Samsung APK so it should be correct, and we unfortunately need it 😕
I have a similar method in react-native-localize
for Xiaomi devices. I always rather use a workaround than let users reporting issues, as they don't know that it's their phone Android implementation fault.
I often wish Google enforce Android stock usage (without any modifications) to manufacturers, but it's a wild dream 😅
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.
I will apply the same in react-native-bootsplash in a upcoming version.
Okay, that's great. Can you let us know when this is ready so that we can update our code?
I often wish Google enforce Android stock usage
As an ex-native Android dev I 100% agree.
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.
@Julesssss Yes, I will. The module in Expensify is based on my initial work on v5, but has been merged way before I released the latest version (as I added support for brand image, dark mode, web, in this release)
Once bootsplash catch up on this, I will do a proposal to migrate Expensify back to it (and delete the custom module in your codebase). I know that light / dark mode support is planned on your side + you will be able to remove your web custom implementation.
Meanwhile, I'd rather be able to merge and check that this indeed fix the Samsung issue (as I don't have such test devices)
🧪🧪 Use the links below to test this build in android and iOS. Happy testing! 🧪🧪 |
Bumping for review @ArekChr 👍 |
I can help review as I have various Samsung devices to test. Galaxy S10: (One UI 4.1) XRecorder_03102023_014232.mp4Galaxy Tab A7: (One UI 4.1) XRecorder_13102023_164713.mp4Galaxy S8+ (One UI 1.0) 20231003_015816.mp4 |
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.
Works as expected but is it possible to increase system logo size by 2x to be same as zoomed one?
We can't really fix the initial size during the launch sequence, as it's handled by the OS (OneUI v4). So I apply a dedicated background drawable in such case (with 144dp logo) + pass a 0.5 logo size ratio to the react-native app, which will update the logo accordingly (react-native-bootsplash offers a hook, useHideAnimation, that handles that for you)
I understand the limitation but I checked other apps. Slack logo size looks good
XRecorder_03102023_021311.mp4
Slack doesn't seem to keep the splash screen, we see a black screen before the app first render. I'm sure there's other hacks (maybe by decompiling some APKs?), but does it worth the effort as it only impacts Samsungs stucked on Android 12 (?) trim.24B9C8E8-FE9A-4963-8271-5687DDB9E8AD.MOV |
It's not worth 😄 |
Hey @aimane-chnaif, thanks for testing. If you could complete the checklist I'll assign you as the C+ 👍 |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromemchrome.movMobile Web - Safarimsafari.movDesktopdesktop.moviOSiPhone 14 Plus ios.moviPhone SE ios2.movAndroidGalaxy S10: (One UI 4.1) XRecorder_03102023_014232.mp4Galaxy Tab A7: (One UI 4.1) XRecorder_13102023_164713.mp4Galaxy S8+ (One UI 1.0) 20231003_015816.mp4 |
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.
@aimane-chnaif I'd also like to see iOS tested as we did change native code.
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.
Confirmed fix on One UI 4.x devices.
And other devices are not affected by this PR expect the fix of right edge cut.
On it now |
All platforms are tested and updated checklist |
@aimane-chnaif thank you! |
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.
Excellent, thanks all!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/Julesssss in version: 1.3.85-0 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.85-4 🚀
|
🚀 Deployed to staging by https://github.com/Julesssss in version: 1.3.86-0 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.86-5 🚀
|
Details
This PR introduces a specific fix for Samsung OneUI v4.
As mentioned here, Samsung SplashScreen API implementation is incorrect on Android 12 (OneUI v4), it appears that the logo size seems 2x smaller than other manufacturers.
Samsung seems to have corrected the issue on OneUI v5.
References:
As we cannot fix OS implementation, the solution here consist in two parts:
logoSizeRatio
of0.5
in such cases, to properly set SVG logo dimensions on the animated splash screen0.5
is incorrect (I used video captures to determine it)This PS also fix a regression on the splash screen logo. A few changes have been made by @kowczarz, and the version currently on main is incorrect, making a 1px shift and the logo being cut on the right.
Fixed Issues
$ #26681
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android
isSamsungOneUI4
result in order to test the issue case. That's why in this video, the system handled splash screen show a correctly sized logo, then the logo become smaller. By keepingisSamsungOneUI4
untouched, it stays smaller on Samsung OneUI v4 and correctly sized on other devices.screen-20231002-203149.mp4