-
Notifications
You must be signed in to change notification settings - Fork 6k
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
support customize platformView theme #7236
Conversation
I'm going to leave this review for @amirh because I'm not familiar with the current architecture or possible implications of this change. |
@amirh any updates? |
@xster pls check this pr? |
* @return A style resource describing the theme to use for the window. | ||
*/ | ||
@StyleRes | ||
protected int getPresentationTheme() { |
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 don't really know how this works.
Though it seems a bit unfortunate to create this parallel mechanism to side-load this. Can it not be passed via args from the Flutter side and then use context.setTheme or something instead?
@SupSaiYaJin can you provide a screenshot or a mockup of what you're trying to achieve? |
@matthew-carroll |
@SupSaiYaJin I'm not sure what your screenshots are trying to show. Are those screenshots of what you currently have? or are they mockups of what you're trying to achieve? Are part of them Flutter and part of them Android? |
@matthew-carroll
Java:
Use transparent theme:
|
@matthew-carroll Any suggestions? Did I describe it clearly?😁 |
Thanks @SupSaiYaJin that helps. Does the transparent background really require a custom theme? Can't you just |
No, it didn't work, cause the |
The |
@amirh what do you think is the right approach here? Should platform views support theming, or is there some other way that transparency should be supported? |
@amirh have you had time to have a look at this? If so, any feedback? |
@SupSaiYaJin how can I bring your code to my flutter project? I can't find where the flutter engine is stored |
@amirh issue still present. Any temporary workaround? Thanks |
@amirh can you please review this code for accept the merge request? |
@amirh when do you think this could be fixed? I have a sprint review with the client next week and I have to bring an answer for this problem. |
I apologize for the long delay on this. It seems to me like it would make sense to just always have the VD's window be translucent. Normally in Android you'd only do it when needed in order to save a composition step between windows, but since the VD has just one window there should be no cost for always keeping that window translucent(which has a side effect of preserving alpha which is what we really want here). I sent #9828 which is a simplified version of this PR to do that. Thank you again for bringing this up and finding the solution! |
@amirh I found that touch events would be misaligned the height of the status bar in some devices with notch screen such as Xiaomi 8. Use android.R.style.Theme_Panel will resolve this. |
@SupSaiYaJin thanks for the quick report! |
Closing this PR as the issue was addressed by #9849 |
This is necessary when need a translucent AndroidView to make the Flutter UI visible below an AndroidView.