Closed FSpark closed 9 months ago
You need a plugin to apply the theme of your wiki to the app. See FAQ :)
Thank you for your reply, I have tried it, but I think you have misunderstood what I mean, the options in the plugin change the color of the system bar, my request is not to follow the system light and dark settings by default to enable setForceDark()
of WebView , which is a new feature introduced in 2.3.1.
You mean applying force light/dark, but not setting theme color? Hmmm... someday I may update the plugin to add a light/dark only option :)
Yes, like this:
lightBar
in https://github.com/donmor/Tiddloid/blob/0719cbcd38bfa99face7d015d6569bce3daea6b9/app/src/main/java/top/donmor/tiddloid/TWEditorWV.java#L1858 doesn't always seem to work, some themes are even just CSS and don't change the colour palette.
Wait.. why apply setForceDark()
again to force darkness when a dark theme is detected?
setForceDark()
applies on WebView. It has to be set separately.
In fact Tiddloid reads data from current palette, not theme. Themes and palettes in TiddlyWiki are set separately.
Yes, I've read that source code, what I mean is that the page-background
in TiddlyWiki is already dark, which means that TiddlyWiki is already in a dark theme at this time, and then applying setForceDark()
will cause color misalignment.
Hmmmmmmm... I thought the WebView just notifies the page that should be in dark mode and renders background (if not changed by the page) and some widgets darkened... So you think the webview does something more than abobe, or it overrides the settings of the page?
It is not as smart as DarkReader, as shown in the picture, you can also test it with a dark palette like SolarizedDark:
Okay I may remove this line in next update since is not properly handled by TW.
Well, this should have been a nice feature.. 😢
It's not a new feature XD... In the 1.x era there's a "Colorful Update" (1.4.0/lite 1.2.0) which introduced the tweak plugin and theme colors. The setForceDark()
should have been an adaption to recent apis, but it seems to be a failure.
I'll remove setForceDark()
until it is proved to work well with TW. Another attempt is to apply a patch to the tweak plugin, replacing the checkbox with a combobox to provide a third "Dark / Light" option, in addition to yes or no. The app also needs a minor tweak to work with it.
It's weird that on my physical device (a Redmi) the page is properly rendered... That's why I didn't see anything wrong, maybe XD
Maybe it's because my system's WebView version (78.0) is too old... 😣
Hmmmmm... I just remembered once the page rendered incorrectly in avd, even the setForceDark()
not present... Now I'm not sure to remove this line or not.
Does anyone still have problem? I may close this if no problem reported.
I'm glad you've provided the ability to force a dark theme in version 2.3.1, but that feature is toggled with the system settings. However, I had already customized the dark theme in my TiddlyWiki file and enabling
setForceDark()
would cause color misalignment, so I would like you to provide the option for the user to fix the light/dark theme themselves.PS: Thanks for bringing the legacy local loading option back!