MCPcopy Create free account
hub / github.com/Julow/Unexpected-Keyboard / labelColor

Method labelColor

srcs/juloo.keyboard2/Keyboard2View.java:405–425  ·  view source on GitHub ↗
(KeyValue k, boolean isKeyDown, boolean sublabel)

Source from the content-addressed store, hash-verified

403 }
404
405 private int labelColor(KeyValue k, boolean isKeyDown, boolean sublabel)
406 {
407 if (isKeyDown)
408 {
409 int flags = _pointers.getKeyFlags(k);
410 if (flags != -1)
411 {
412 if ((flags & Pointers.FLAG_P_LOCKED) != 0)
413 return _theme.lockedColor;
414 return _theme.activatedColor;
415 }
416 return _theme.pressedColor;
417 }
418 if (k.hasFlagsAny(KeyValue.FLAG_SECONDARY | KeyValue.FLAG_GREYED))
419 {
420 if (k.hasFlagsAny(KeyValue.FLAG_GREYED))
421 return _theme.greyedLabelColor;
422 return _theme.secondaryLabelColor;
423 }
424 return sublabel ? _theme.subLabelColor : _theme.labelColor;
425 }
426
427 private void drawLabel(Canvas canvas, KeyValue kv, float x, float y,
428 float keyH, boolean isKeyDown, Theme.Computed.Key tc)

Callers 2

drawLabelMethod · 0.95
drawSubLabelMethod · 0.95

Calls 2

getKeyFlagsMethod · 0.80
hasFlagsAnyMethod · 0.45

Tested by

no test coverage detected