HeliBoard
HeliBoard copied to clipboard
Black background not working when forcing dark mode
Describe the bug Keyboard buttons are unhappy about darker colors
To Reproduce Set color theme to black
Expected behavior Buttons should all have a black backround
Screenshots
App version 1.0-alpha1
Device:
- Model: Oneplus 9
- OS: LineageOS 21
Additional Info If im exakt it even seems that some buttons are the darkest on Gray and after that they go Back to white (so complete black is white again), i found out about that when i tryed user-defined colors
I can't reproduce this. Did you change anything else in the appearance settings besides switching to black theme?
If im exakt it even seems that some buttons are the darkest on Gray and after that they go Back to white (so complete black is white again), i found out about that when i tryed user-defined colors
Sorry, I don't understand what you mean by that.
Btw next time please stick to this part of the issue template:
If you add screenshots, reduce the size or use thumbnails to keep the issue nicely readable
Sorry i seam to habe missed that
If you add screenshots, reduce the size or use thumbnails to keep the issue nicely readable
Stange now the buttons seem to go black, I didnt change anything, bizarre.
There ist still one button that is not following the black color.
Here a Screenshot of the button, but this time with less hight so the it shold stay more readable
That button seems to allways mix any color you give it, by changing the "keyboard background" color, with Gray, so black becomes dark gray and white becomes light Gray.
The button that im talking about is the arrow on the left side of the picture.
You will be able to explicitly set that button's background at a later point, I didn't yet have time to implement it.
Good that it works now. Could you check when you change the theme again (e.g. to light), does it now have black backgrounds? There might be some issue with the keyboard not properly reloading after a color change (working correctly on my phone, LineageOS 16).
Once you swipe the keyboard settings away when switching apps, the app is closed completely and thus will do a full reload when it next shows. Maybe that's why it works now...
The spacebar, the enter key and the 4 buttons when you long press comma seem to be affected. They seem to randomly go white, it dosn't seem to happen offen but still strange. Right now the buttons look fine but earlier that day they where white for a moment. No idea how that happens. I report back when i find some sort of trigger that makes these button backgrounds go white again.
Edit: I found the trigger, the buttons go white when i open a app that I have forced to darkmode with darkq, then these buttons go white until the app is restarted.
Edit edit: Nope now it dosn't happen anymore now strange, i still think is probably something about darkq.
I checked and it looks like it's not HeliBoard's fault. Forcing a dark theme in Android settings causes strange things. In my case, all the buttons turn white. So it's probably the same with DarQ. Check if forcing a dark theme in Android settings also causes this bug for you.
Changing the keyboard and going back to HeliBoard should reproduce this bug.
I turned off key borders and managed to reproduce the "bug".
The problem disappears after disabling dark theme enforcement in Android settings, so I'm pretty sure it's not HeliBoard's fault.
Right, well at least the Problem has been found. I guess, the issue would be solved. Well the arrow on the top left still would be nice to have a color selection, but that is planed right, if so this can be closed, it probably wont make sence to ajust for dark theme enforcment mode.
Most colors work just fine, so would assume it's possible to make those keys also display correctly.
I think we can still leave the issue open, in case someone wants to try fixing it. (my phone can't force dark mode)
OK then, shure if it still gets fixed it wouldn't hurt, also unrelated but your phone can probably force dark mode you just need the app darkq and follow the Instructions (its also explained on the webside), since you never mentioned the app, i wasnt shure how you think that it work (or maby your phone is locked down so hard that it dosn't work), would you say what is going on on you phone? I just thought i mention it in case it was unclear what i ment.
DarQ requires Android 10 according to description, so not working on my Android 9 phone.
DarQ requires Android 10 according to description, so not working on my Android 9 phone.
Ohhh, makes sence
With the key border off it's not that bad, but if it's on it looks much worse.
Hi, Any news on this ? Thanks
No news, and I don't intend to work on issues created by outside things messing with HeliBoard. Though if someone who uses some force dark mode wants to work on this, you're welcome.
outside things
It's a stock Android feature.
if someone who uses some force dark mode wants to work on this, you're welcome
Apparently, the solution is to add <item name="android:forceDarkAllowed">false</item> in styles.
It's a stock Android feature.
It's not the app, so outside. And I don't block you or anyone else from working on it. See also the contributor needed label.
Apparently, the solution is to add
- false
in styles.
According to documentation this goes into an activity's theme. The keyboard itself doesn't have an activity, so it could only be disabled for the settings (which do have an activity).
I'm not an Android dev :sweat_smile:
There's the same problem on FUTO keyboard, which is going to be fixed soon, so I'll check out what they'll do.
I actually found a workaround I think. First set the colors to user defined. After that tap on adjust colors. Next on the top left tap the 3 dots. Then tap show all collors.
After that set all colors to the way you want. If you do that the issue seems to go away. You just have to define a lot of colors.
I actually found a workaround I think
Thanks, that's a very good pointer. This makes me guess that "force dark mode" is messing with app resources, which is an awful practice no system should do because it introduces bugs like this or #280. Removing the bug label because the "bug" is that Heliboard is using XML resources that can be (an in this case are) manipulated with root privileges.
I think I may have potentially fixed the "bug". I added the fix by @KaKi87: <item name="android:forceDarkAllowed">false</item> in styles and built an alpha build which I will test later tonight, will report back. If not will try this <item name="android:forceDarkAllowed" tools:targetApi="q">false</item>.
the "bug" is that Heliboard is using XML resources that can be (an in this case are) manipulated with root privileges
No, this is a native Android feature that does not require root.
No, this is a native Android feature that does not require root.
The system has root privileges. And it's mis-using them for manipulating the app. It's sad when it's official Android policy that the app cannot trust its own resource data.. Same thing in the linked issue #280.
I think I may have potentially fixed the "bug". I added the fix by @KaKi87:
<item name="android:forceDarkAllowed">false</item>in styles and built an alpha build which I will test later tonight, will report back. If not will try this<item name="android:forceDarkAllowed" tools:targetApi="q">false</item>.
I think I have managed to get it right!
https://github.com/user-attachments/assets/68a31482-1eab-4e85-bca9-7974dc7bba33
@fakerat Could you make a PR?
@fakerat Could you make a PR?
Apologies for the late response was quite overwhelmed let me try during this weekend ...