-
Notifications
You must be signed in to change notification settings - Fork 344
[Sample] [Graphic] - Implementation of "Displaying UltraHDR" Sample #51
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
Conversation
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.
LGTM just few comments
samples/media/ultrahdr/README.md
Outdated
@@ -0,0 +1,4 @@ | |||
# DisplayingUltraHDRSample samples | |||
|
|||
// TODO: provide minimal instructions |
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.
Could you provide a quick readme?
- What the sample does
- Link to docs
override fun onAttachedToWindow() { | ||
super.onAttachedToWindow() | ||
display?.run { | ||
registerHdrSdrRatioChangedListener({ it.run() }, hdrSdrRatioListener) |
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.
Nit: for readability move this into a variable called executor. Otherwise it's not clear what is it without going into the javadocs
} | ||
} | ||
|
||
override fun onDetachedFromWindow() { |
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.
Question: this happens when the activity is destroyed or the view is removed from the viewgroup, but if the app goes onPause this won't happen. Is it okay to still have the listener registered and HDR mode on? Or is it best practice to turn on/off onresume/onpause?
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.
Also, you are not updating the mode on detach. Shouldn't you do it? Otherwise the activity will be kept as HDR even if the view is not there anymore
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.
Ah yes, makes sense
@marcelpinto I've moved this to the graphic package as displaying UltraHDR is more of a graphic related topic |
Description
This CL contains sample code for Displaying UltraHDR Images on API 34 and above.
How Has This Been Tested?
Test Configuration #1 - Pixel 7 Pro API 34 Beta (Android 14 Beta)
Checklist:
Demo
Note: You will not see this effect properly until running the platform app on a device with API34. The demo is for illustrative purposes)
https://github.com/android/platform-samples/assets/5649571/1ac8ea89-c4c2-4c54-90a6-06001e3680d6
Screenshots