-
Notifications
You must be signed in to change notification settings - Fork 460
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
Bugfix(android): dynamic pixel density change #2679
base: main
Are you sure you want to change the base?
Conversation
Thanks a lot, can you recommend me a way to test the pixel density change? Is this an issue on iOS as well? |
Link to repo/app I used to spot the problem and test the solution. I also had a plan to add case to app/paper or dedicated app/density, but suppose it will be another story.
I am not aware of possibility to change density on iOS. |
I have signed the CLA! |
General idea: You need a random case where canvas and it's content depends on container size (i.e. "button skin"). Steps:
NB!:
|
@kedikx Sorry it took me so much time to get back to you on this. The reason I was a bit silent on this is that where were doing refactoring where we thought the problem would be addressed differently. But indeed this is makes sense and I am now looking to merge this change. |
@@ -99,6 +101,15 @@ public byte[] getJniStreamFromSource(String sourceUri) throws IOException { | |||
return null; | |||
} | |||
|
|||
void onResume() { |
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.
should this be "onConfigurationChanged"?
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.