Status Update
Comments
jl...@google.com <jl...@google.com>
pa...@google.com <pa...@google.com> #2
Thanks! Over to Nader to take a detailed look!
lb...@gmail.com <lb...@gmail.com> #3
I believe we should dup
jl...@google.com <jl...@google.com> #4
Yes definitely. Thanks Siyamed!
In the meantime there maybe other ways to work around it. The main issue is that surface implicitly creates a seaprate layer which impacts the behavior of the blending modes. Being ale to just set the Brush on the paint directly would work around this in the most straightforward way.
jl...@google.com <jl...@google.com> #5
The issue is that the content depends on transparent pixels existing in the scene before the gradient is applied.
To address this you can do the following in order to force rasterization of the graphicsLayer into a separate buffer using CompositingStrategy.Offscreen
, then only draw the gradient on top of the pixels rendered by the text Composable.
Text("Hello World!", modifier =
// Use offscreen compositing strategy so that there are transparent pixels in the offscreen buffer
// to blend against with the SrcIn blend mode
Modifier.graphicsLayer(compositingStrategy = CompositingStrategy.Offscreen).drawWithCache {
val brush = Brush.horizontalGradient(listOf(Color.Red, Color.Blue, Color.Cyan, Color.Magenta, Color.Green))
onDrawWithContent {
drawContent()
drawRect(brush, blendMode = BlendMode.SrcIn)
}
}
)
do...@google.com <do...@google.com> #6
sorry for delay, looks great Jens
lb...@gmail.com <lb...@gmail.com> #7
Also, please, have a CTRL+C shortcut to the ID. If there is no ID, maybe show the context menu, or something...
And, in the pane of attribute, have it working for every attribute (including ID, of course)
jl...@google.com <jl...@google.com> #8
"Copy Special"
Because the user may want to copy: the id (if present), view class name, or text value of the view (if present).
"CTRL+C"
It is unclear what the keystroke should copy to the clipboard since it could be either one of the 3 above choices. Maybe a textual representation of the string in component tree ? The attribute panel currently gives: "AttributeName<TAB>Value" which seems good.
lb...@gmail.com <lb...@gmail.com> #9
You could instead use "Copy..." , which means there is a choice of what to copy, that needs to be by the user.
The most usable one is to copy the ID as this is the most unique thing that's related to every View. It's also at the top of the context menu.
What do you mean by "textual representation of the string in component tree"? You mean how to reach there down the tree? This can be in a new context menu item.
About the attribute/property panel, if I focus on the value, I expect the value to be copied.
Description
Add a feature to copy data from the component tree and the properties panel.
Perhaps add a right click menu that has a copy action.
The action could be setup similar to "Copy Path/Reference" when right clicking on an editor tab i.e. there are several sub menus specifying what to copy to the clipboard.
For example: