tasty-imitation-keyboard icon indicating copy to clipboard operation
tasty-imitation-keyboard copied to clipboard

Switch to Dark Color

Open cvonlehe opened this issue 8 years ago • 2 comments

How do you switch to the dark color? Is there a simple boolean you have to set? I've been looking for a way to do it and can't seem to find it.

cvonlehe avatar Jul 22 '16 14:07 cvonlehe

Nope, from my understanding of the code, the switch to dark color happens automatically (i.e. sent by the container app). It's up to the developer to color the keyboard accordingly.

cyrilzakka avatar Jul 27 '16 08:07 cyrilzakka

I also have this question. There must be a way to specifically saying to use darkmode (darkmode looks pretty good).

The lines of code I was looking at was KeyboardViewController

func darkMode() -> Bool {
    let darkMode = { () -> Bool in
        let proxy = self.textDocumentProxy
        return proxy.keyboardAppearance == UIKeyboardAppearance.dark
    }()
    
    return darkMode
}

Simply return true here.

And KeyboardInputTraits.swift

    if let layout = self.layout {
        let appearanceIsDark = (proxy.keyboardAppearance == UIKeyboardAppearance.dark)
        if appearanceIsDark != layout.darkMode {
            self.updateAppearances(appearanceIsDark)
        }
    }

However, I tried several things and the keyboard color did change to not to exactly darkmode. Please give some advice. Thanks.

ifanchu avatar Jan 28 '18 03:01 ifanchu