Page 1 of 2

Browser widget background color change

Posted: Fri Mar 15, 2019 9:57 pm
by Youks
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

Re: Browser widget background color change

Posted: Sat Mar 16, 2019 8:46 am
by richmond62
This is probably a totally goofy suggestion, but . . .

How about setting the backGroundColor of each card to black?

Re: Browser widget background color change

Posted: Sat Mar 16, 2019 9:59 am
by Youks
Hi Richmond,

The background color of the cards is already set to black (no matter the color the flickering is persisting).

Thx

Re: Browser widget background color change

Posted: Sat Mar 16, 2019 11:13 am
by [-hh]
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

Re: Browser widget background color change

Posted: Sat Mar 16, 2019 11:50 am
by Youks
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

Re: Browser widget background color change

Posted: Sat Mar 16, 2019 11:55 am
by richmond62
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?
-
Screenshot 2019-03-16 at 12.54.49.png

Re: Browser widget background color change

Posted: Sat Mar 16, 2019 12:03 pm
by [-hh]
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.

Re: Browser widget background color change

Posted: Sat Mar 16, 2019 12:10 pm
by Youks
This works perfectly on MacOS. The issue is on Android so far.

Re: Browser widget background color change

Posted: Sat Mar 16, 2019 12:13 pm
by [-hh]
Android has a slow processor. You could try to increase the waiting time to 1 second?

Re: Browser widget background color change

Posted: Sat Mar 16, 2019 12:16 pm
by richmond62
1 second might be too long for the current
Attention Deficit Generations who fiddle around non-stop
on their Android devices.
-
bonk.jpg
bonk.jpg (11.38 KiB) Viewed 8121 times

Re: Browser widget background color change

Posted: Sat Mar 16, 2019 12:18 pm
by Youks
Whatever timing we select the flickering always happens unfortunately.

Re: Browser widget background color change

Posted: Sat Mar 16, 2019 12:19 pm
by Youks
I believe that the widget should have a color property to overcome this issue.

Re: Browser widget background color change

Posted: Sat Mar 16, 2019 12:25 pm
by [-hh]
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

Re: Browser widget background color change

Posted: Sat Mar 16, 2019 12:45 pm
by Youks
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

Re: Browser widget background color change

Posted: Sat Mar 16, 2019 1:52 pm
by richmond62
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.