Repository navigation
Point the keyboard's hex colors at the shared Scribe colors - #803
bhanu-dev82 wants to merge 15 commits into
Conversation
|
A few colors in the keyboard don't exactly match any shared color, so I kept them as they are for now. Wanted to check with you on each before changing anything 🙂 1. Light invalid / already-plural bar
2. Dark letter keys
3. Light suggestion text
4. Enter key
5. Smaller one-off colors
Happy to add whichever you pick to this PR, or do them in a follow-up so this one stays a no-visual-change PR. Whatever's easier to review! |
|
Thanks so much for this, @bhanu-dev82! Responses to your questions:
Thanks so much for this, @bhanu-dev82! |
|
Thanks so much for the quick answers, @andrewtavis! All done in this PR now 🙂
I also added a small cache for the color lookups so suggestions don't rebuild them on every keystroke. The PR description lists every old → new value. I don't have before/after screenshots yet, but tests check all of these against both the Scribe setting and the phone's mode. Thanks again! 🚀 |
| dark: Boolean, | ||
| ): Int { | ||
| val key = (id.toLong() shl 1) or (if (dark) 1L else 0L) | ||
| return scribeColorCache.getOrPut(key) { ContextCompat.getColor(scribeNightContext(dark), id) } |
There was a problem hiding this comment.
The Long key and Int value get boxed on every lookup, so this still allocates per keystroke. Would a SparseIntArray per mode work here?
| android:padding="@dimen/small_margin" | ||
| android:src="@drawable/ic_delete_vector" | ||
| android:tint="#E53935" /> | ||
| android:tint="@color/scribe_delete" /> |
There was a problem hiding this comment.
Since KeyboardUIManager already sets this tint in code, could we drop the XML android:tint? It follows the device night mode rather than Scribe's setting, so its a bit misleading
|
Thanks for the review, @Roniscend! Both fixed 🙂 The color cache now uses a |
This sounds right to me, @bhanu-dev82! Sounds like we can make this small change and then merge :) We can then do a color update in the delete PR! |
|
Thanks @andrewtavis! I've made that small change 🙂 The active Wikidata info-panel dot now uses the key text color ( Sounds good to me that the delete color can be updated in #772! |
Contributor checklist
./gradlew lintKotlin detekt testcommand as directed in the testing section of the contributing guideDescription
Hey 👋 This is the keyboard step of #475. The keyboard now reads the shared
scribe_*colors instead of hex literals. Where a hex already matched a shared color, nothing looks different 🙂 Following @andrewtavis's answers on this PR, there are also a few small intentional visual changes, listed below.scribe_caption(#E558564Blight,#CAC4D0dark).scribe_keyboard_background.scribeColorInt(id, dark)helper.Colors.ktand the newscribeColorIntshare the same night-mode override. Lookups are cached, so suggestions don't build a new context on every keystroke.GeneralKeyboardIME.DARK_THEMEandLIGHT_THEME. They colored the command-bar separators, which are set to transparent right after, so nothing changes on screen.scribe_keyboard_border(same#40888888, a grey not used elsewhere on the keyboard). I didn't usescribe_outline, as that's the orange button outline.Intentional visual changes (old → new)
scribe_keyboard_background)#D2D4DA→#D3D6DD#1E1E1Escribe_key)#FFFFFF#444444→#434343scribe_text)#1E1E1E→#000000#FFFFFFscribe_key_special, Figma values)#ADB3BD#2D2D2Dscribe_key_special)#AEB3BE→#ADB3BD#202020→#2D2D2Dscribe_delete, the delete red from #772)#E53935→#E4572E#E53935→#D11149scribe_text, inactive =scribe_caption)#000000; inactive#CCCCCC→#E558564B#FFFFFF; inactive#66FFFFFF→#CAC4D0scribe_key_specialalready existed, so I updated it to the Figma values rather than adding a second special-key name. The Enter key used to work these out from fractions inKeyboardView; that calculation is gone.Still kept as they are: the floating drag-handle pill, and the clipboard caption greys and card border.
ScribeColorResolverTestchecks that the lookups give the expected values when the phone is in day mode and in night mode, for everyscribe_*color.KeyboardSharedColorsTestchecks the command bars, conjugation labels and separators against the old values when the Scribe setting and the phone's mode disagree, plus the new letter key, special key, suggestion, clear-all and page-dot colors. The label color is now worked out once per grid instead of once per button 🚀Related issue