But why don't they support variables? I suspect there is a good reason for that, but still i'm curious

Moderator: Martin
That's what I'm missing at the moment. I have an overlay widget that should fill the whole screen width. Yet, I can only set it to a fixed size, e.g. 1080px. When I now show it on another of my devices where the screen width is 1280, it only displays with 1080px width. And I can't make it stretch because all calculations are based on the actual pixel width.digitalstone wrote:Width and height of the widget itself as well.
The only solution i can think of (with only hardcoding height and width) is to make the widget something like 5000px squared.... BUT...mbirth wrote:That's what I'm missing at the moment. I have an overlay widget that should fill the whole screen width. Yet, I can only set it to a fixed size, e.g. 1080px. When I now show it on another of my devices where the screen width is 1280, it only displays with 1080px width. And I can't make it stretch because all calculations are based on the actual pixel width.digitalstone wrote:Width and height of the widget itself as well.
I think Desmanto described a solution to this:mbirth wrote: I'd need a way to programmatically change the "canvas" size to the real screen width and show the widget 1:1. And update width and element width after the orientation changes.
As i'm looking in setting up the widget itself, i understand the initial resolution of the widget itself is needed to determine the original resolution to pass to Android.Desmanto wrote: The other things is the display resolution probably should be automagically retrieved by automagic itself. Maybe we can have new function as getDisplayResolutionWidth() and getDisplayResolutionHeight(). Later, we can put it at the show widget resolution after scaling it to certain number.
It's already possible - I use the Java code from this comment: viewtopic.php?p=19193#p19193digitalstone wrote:I think that Desmanto's idea of "getDisplayResolutionWidth() and getDisplayResolutionHeight()" is very possible.
And also very useful.
Well, you're right.mbirth wrote:It's already possible - I use the Java code from this comment: viewtopic.php?p=19193#p19193digitalstone wrote:I think that Desmanto's idea of "getDisplayResolutionWidth() and getDisplayResolutionHeight()" is very possible.
And also very useful.
I just can't set the widget's canvas size programmatically. I have to manually edit the widget and change the number (as it's a numeric field, no variables allowed).
And when setting the widget to a fixed size, e.g. 800x4, showing it full-width on a screen with more pixels (e.g. 1600px), scales it - including the height of the bar. My initially 4px thick bar is suddenly 8px thick. I don't want that.