fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design
https://fyne.io/
Other
25.22k stars 1.4k forks source link

Android: System UI text is forcefully recolored white #5260

Closed pjanx closed 1 week ago

pjanx commented 1 week ago

Checklist

Describe the bug

Fyne seems to somewhere enforce white text colour for the system UI. With a light theme on my Samsung phone, I can't see anything!

On Android simulator, I've noticed that Fyne sets the background of those UI parts to black. A possibly related issue is that Fyne in my Android simulator gets a black window background on a light theme, making app contents rather than the system UI unreadable.

How to reproduce

Screenshots

Screenshots: light mode, without overlay window, dark mode, without overlay window.

Screenshot_20241112_220413 Screenshot_20241112_220435 Screenshot_20241112_221033 Screenshot_20241112_221004

Example code

package main

import (
    "net"

    "fyne.io/fyne/v2"
    "fyne.io/fyne/v2/app"
    "fyne.io/fyne/v2/dialog"
    "fyne.io/fyne/v2/driver/mobile"
    "fyne.io/fyne/v2/widget"
)

func main() {
    a := app.New()
    w := a.NewWindow("Bugs")
    w.Resize(fyne.NewSize(640, 480))
    w.SetContent(widget.NewMultiLineEntry())

    connectAddress := widget.NewEntry()
    connectAddress.SetPlaceHolder("host:port")
    connectAddress.Validator = func(text string) error {
        _, _, err := net.SplitHostPort(text)
        return err
    }
    connectAddress.SetText(string([]byte{3, 2, 1, 65, 66, 67, ':', '1'}))
    connectAddress.TypedKey(&fyne.KeyEvent{Name: fyne.KeyPageDown})

    var wConnect *dialog.FormDialog
    wConnect = dialog.NewForm("Connect to relay", "Connect", "Exit",
        []*widget.FormItem{
            {Text: "Address:", Widget: connectAddress},
        }, func(ok bool) {
            if ok {
            } else if _, ok := a.Driver().(mobile.Driver); ok {
                wConnect.Show()
            } else {
                a.Quit()
            }
        }, w)
    wConnect.Show()
    w.ShowAndRun()
}

Fyne version

2.5.2

Go compiler version

1.23.2

Operating system and version

Android 13 One UI 5.1

Additional Information

No response

andydotxyz commented 1 week ago

This looks to be a duplicate of #1442. As noted on that issue we are looking for help because it looks like we have set the appropriate theme but it does not take effect.