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

Method onDraw

srcs/juloo.keyboard2/Keyboard2View.java:338–366  ·  view source on GitHub ↗
(Canvas canvas)

Source from the content-addressed store, hash-verified

336 };
337
338 @Override
339 protected void onDraw(Canvas canvas)
340 {
341 float y = _tc.margin_top;
342 for (KeyboardData.Row row : _keyboard.rows)
343 {
344 y += row.shift * _tc.row_height;
345 float x = _marginLeft + _tc.margin_left;
346 float keyH = row.height * _tc.row_height - _tc.vertical_margin;
347 for (KeyboardData.Key k : row.keys)
348 {
349 x += k.shift * _keyWidth;
350 float keyW = _keyWidth * k.width - _tc.horizontal_margin;
351 boolean isKeyDown = _pointers.isKeyDown(k);
352 Theme.Computed.Key tc_key = isKeyDown ? _tc.key_activated : _tc.key;
353 drawKeyFrame(canvas, x, y, keyW, keyH, tc_key);
354 if (k.keys[0] != null)
355 drawLabel(canvas, k.keys[0], keyW / 2f + x, y, keyH, isKeyDown, tc_key);
356 for (int i = 1; i < 9; i++)
357 {
358 if (k.keys[i] != null)
359 drawSubLabel(canvas, k.keys[i], x, y, keyW, keyH, i, isKeyDown, tc_key);
360 }
361 drawIndication(canvas, k, x, y, keyW, keyH, _tc);
362 x += _keyWidth * k.width;
363 }
364 y += row.height * _tc.row_height;
365 }
366 }
367
368 @Override
369 public void onDetachedFromWindow()

Callers

nothing calls this directly

Calls 5

drawKeyFrameMethod · 0.95
drawLabelMethod · 0.95
drawSubLabelMethod · 0.95
drawIndicationMethod · 0.95
isKeyDownMethod · 0.80

Tested by

no test coverage detected