Closed ennerf closed 2 years ago
Which version of Attach are you using? 4.0.15 has some changes that should work.
You're right, it works with 4.0.15 👍 Thanks.
Fwiw, it looks like stylesheet loading in charm 6.1.1 still has issues. The glisten_ios_notch.css
stylesheet gets loaded correctly with attach 4.0.15, but the "iPad Pro (12.9-inch) (5th generation)" simulator loads glisten_ios.css
instead of glisten_ios_tablet.css
.
But that is unrelated to the notch?
It uses DisplayService::isTablet
, which in turn calls !isPhone.
Yes, it is independent of notch, but to me related in the sense that both issues require replacing the stylesheet after initialization. DisplayService::isTablet
returns the correct value, so there might be a bug with how _tablet
gets added in Glisten. I didn't see a Glisten specific issue tracker though, otherwise I'd create a new issue there.
This works for me
public static String getPlatformSpecificStylesheetName() {
String platformSuffix = PlatformUtil.isIOS() ? "_ios"
: PlatformUtil.isAndroid() ? "_android"
: "";
String formFactorSuffix = PlatformUtil.hasNotch() ? "_notch"
: PlatformUtil.isTablet() ? "_tablet"
: "";
return String.format("glisten%s%s.css", platformSuffix, formFactorSuffix);
}
Again, not related to this current issue. Nonetheless, that is exactly what Glisten does (not apparently), but with the DisplayService for notch and tablet. I'll report this bug to the Glisten private issue tracker.
Devices with notch (e.g. "iPhone12 Pro" simulator) return that they have no notch and subsequently load a wrong stylesheet with not enough margin.
I'm not familiar enough with Objective C to find the issue with the existing code, but the following Java workaround works for all devices I tested.