Open kedikx opened 1 month ago
Thanks a lot, can you recommend me a way to test the pixel density change? Is this an issue on iOS as well?
Thanks a lot, can you recommend me a way to test the pixel density change?
Link to repo/app I used to spot the problem and test the solution. https://github.com/kedikx/rns-density
I also had a plan to add case to app/paper or dedicated app/density, but suppose it will be another story.
Is this an issue on iOS as well?
I am not aware of possibility to change density on iOS. Never saw it, at least from a user point of view.
I have signed the CLA!
can you recommend me a way to test the pixel density change?
General idea:
You need a random case where canvas and it's content depends on container size (i.e. "button skin").
Steps:
NB!: /android/app/src/main/AndroidManifest.xml should have 'density' in configChanges (fontScale also if you want to get things even more complicated):
android:configChanges="...|density|fontScale|..."
This is a fix for #2635.
Summary:
PlatformContext: implement get/set pixel density methods, set/update current density from ReactContext on resume.
RNSkAndroidPlatformContext: reuse getPixelDensity() from jniContext instead on base member variable.