Browser widget background color change
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Browser widget background color change
Hi All,
I have a Browser widget with a custom property to change its background color from white to black. The issue is that on every card opening the browser briefly flickers to white before turning black. I've tried locking the screen or waiting with some time but it persists.
custom property:
<html style="">
<head>
<meta name="viewport" content="device-width, initial-scale=1.0, user-scalable=no"/>
</head>
<body style="background-color: black; color: white; font-family: Arial ; font-size: 17px; line-height: 1.4; text-wrap: normal;">
</body>
</html>
And i set the HTMLTEXT of the Browser to this property.
Anything wrong to this code or method?
Test Done on Note 8 with latest Android.
Best Regards & Thx
I have a Browser widget with a custom property to change its background color from white to black. The issue is that on every card opening the browser briefly flickers to white before turning black. I've tried locking the screen or waiting with some time but it persists.
custom property:
<html style="">
<head>
<meta name="viewport" content="device-width, initial-scale=1.0, user-scalable=no"/>
</head>
<body style="background-color: black; color: white; font-family: Arial ; font-size: 17px; line-height: 1.4; text-wrap: normal;">
</body>
</html>
And i set the HTMLTEXT of the Browser to this property.
Anything wrong to this code or method?
Test Done on Note 8 with latest Android.
Best Regards & Thx
-
- Livecode Opensource Backer
- Posts: 9418
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Browser widget background color change
This is probably a totally goofy suggestion, but . . .
How about setting the backGroundColor of each card to black?
How about setting the backGroundColor of each card to black?
Re: Browser widget background color change
Hi Richmond,
The background color of the cards is already set to black (no matter the color the flickering is persisting).
Thx
The background color of the cards is already set to black (no matter the color the flickering is persisting).
Thx
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Browser widget background color change
You could try (in the card script or above it in the message path):
Code: Select all
on preopenCard
set the htmltext of widget "browser" to \
"<html style=''><head>" & \
"<meta name='viewport' content='device-width, " & \
"initial-scale=1.0, user-scalable=no'/></head>" & \
"<body style='background-color: black; color: white; " & \
"font-family: Arial ; font-size: 17px; line-height: 1.4; " & \
"text-wrap: normal;'></body></html>"
wait 0.5 seconds with messages --> adjust the time to your needs
end preopenCard
shiftLock happens
Re: Browser widget background color change
Hi all,
Thank you for your help. It looks like that by default, anytime we invoke the widget it appears first white before taking the color we assign to it. It appears very quickly in white first. I have tried to lock the screen before showing the widget but does not remove that flickering.
Any other hint?
Thanks
Regards
Thank you for your help. It looks like that by default, anytime we invoke the widget it appears first white before taking the color we assign to it. It appears very quickly in white first. I have tried to lock the screen before showing the widget but does not remove that flickering.
Any other hint?
Thanks
Regards
-
- Livecode Opensource Backer
- Posts: 9418
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Browser widget background color change
I wonder if there is a template of the Browser widget and that could
have its backGroundColor set to black
before any instances of it are made to appear on a card?
Or, just maybe, you could open the browser in the LCB thing and muck around with it there?
-
have its backGroundColor set to black
before any instances of it are made to appear on a card?
Or, just maybe, you could open the browser in the LCB thing and muck around with it there?
-
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Browser widget background color change
Lock screen doesn't work for native displays like the browser widget.
That's why I proposed to set the htmltext on preopenCard (or preopenStack).
This works here on MacOS, Win7+10 and linux.
That's why I proposed to set the htmltext on preopenCard (or preopenStack).
This works here on MacOS, Win7+10 and linux.
shiftLock happens
Re: Browser widget background color change
This works perfectly on MacOS. The issue is on Android so far.
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Browser widget background color change
Android has a slow processor. You could try to increase the waiting time to 1 second?
shiftLock happens
-
- Livecode Opensource Backer
- Posts: 9418
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Browser widget background color change
1 second might be too long for the current
Attention Deficit Generations who fiddle around non-stop
on their Android devices.
-
Attention Deficit Generations who fiddle around non-stop
on their Android devices.
-
Re: Browser widget background color change
Whatever timing we select the flickering always happens unfortunately.
Re: Browser widget background color change
I believe that the widget should have a color property to overcome this issue.
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Browser widget background color change
The default backColor is in libbrowser, so not directly accessible through the LCB code.
But you could instead do a fade-in effect, for example as here:
https://www.abeautifulsite.net/a-clean- ... r-webpages
But you could instead do a fade-in effect, for example as here:
https://www.abeautifulsite.net/a-clean- ... r-webpages
shiftLock happens
Re: Browser widget background color change
Thank you Hermann for the trick but it is unfortunately too complicated for such an easy task.
I hope LC could implement something easier for Android.
Many thanks Gents for trying
I hope LC could implement something easier for Android.
Many thanks Gents for trying
-
- Livecode Opensource Backer
- Posts: 9418
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Browser widget background color change
Humph . . .
I tried setting the INK of the browser to blendClear,
but that had no effect whatsoever.
Nor did any of the other INK settings have an effect.
I tried setting the INK of the browser to blendClear,
but that had no effect whatsoever.
Nor did any of the other INK settings have an effect.