[FL-2119] BT HID App (#888)

* view_dispatcher: add default back processing for Long events
* assets: add ble connected and disconnected assets
* bt keyboard: introduce new application
* bt keyboard: add logic to keyboard mode
* bt: remove debug ble hid application
* bt hid: introduce media controller
* gui canvas: rename CanvasFontDirection -> CanvasDirection
* gui canvas: add arrow element
* assets: update finilized assets
* bt hid: finalise keynote GUI
* bt hid: finalise media player GUI
* bt: add media key buttons support
* bt: add exit confirm view
* bt: change Clicker -> Remote
* bt: support f6 target
* bt: hopefully final bt hid design
* bt hid: add blue led notification when device is connected
* bt: leave only bt clicker for now
* bt: add display notification on pin code show event
This commit is contained in:
gornekich
2021-12-15 20:39:06 +03:00
committed by GitHub
parent 63642617ee
commit f0d4584b40
36 changed files with 1319 additions and 579 deletions

31
applications/gui/canvas.c Normal file → Executable file
View File

@@ -47,7 +47,7 @@ void canvas_reset(Canvas* canvas) {
canvas_set_color(canvas, ColorBlack);
canvas_set_font(canvas, FontSecondary);
canvas_set_font_direction(canvas, CanvasFontDirectionLeftToRight);
canvas_set_font_direction(canvas, CanvasDirectionLeftToRight);
}
void canvas_commit(Canvas* canvas) {
@@ -115,7 +115,7 @@ void canvas_set_color(Canvas* canvas, Color color) {
u8g2_SetDrawColor(&canvas->fb, color);
}
void canvas_set_font_direction(Canvas* canvas, CanvasFontDirection dir) {
void canvas_set_font_direction(Canvas* canvas, CanvasDirection dir) {
furi_assert(canvas);
u8g2_SetFontDirection(&canvas->fb, dir);
}
@@ -304,6 +304,33 @@ void canvas_draw_disc(Canvas* canvas, uint8_t x, uint8_t y, uint8_t radius) {
u8g2_DrawDisc(&canvas->fb, x, y, radius, U8G2_DRAW_ALL);
}
void canvas_draw_triangle(
Canvas* canvas,
uint8_t x,
uint8_t y,
uint8_t base,
uint8_t height,
CanvasDirection dir) {
furi_assert(canvas);
if(dir == CanvasDirectionBottomToTop) {
canvas_draw_line(canvas, x - base / 2, y, x + base / 2, y);
canvas_draw_line(canvas, x - base / 2, y, x, y - height + 1);
canvas_draw_line(canvas, x, y - height + 1, x + base / 2, y);
} else if(dir == CanvasDirectionTopToBottom) {
canvas_draw_line(canvas, x - base / 2, y, x + base / 2, y);
canvas_draw_line(canvas, x - base / 2, y, x, y + height - 1);
canvas_draw_line(canvas, x, y + height - 1, x + base / 2, y);
} else if(dir == CanvasDirectionRightToLeft) {
canvas_draw_line(canvas, x, y - base / 2, x, y + base / 2);
canvas_draw_line(canvas, x, y - base / 2, x - height + 1, y);
canvas_draw_line(canvas, x - height + 1, y, x, y + base / 2);
} else if(dir == CanvasDirectionLeftToRight) {
canvas_draw_line(canvas, x, y - base / 2, x, y + base / 2);
canvas_draw_line(canvas, x, y - base / 2, x + height - 1, y);
canvas_draw_line(canvas, x + height - 1, y, x, y + base / 2);
}
}
void canvas_draw_xbm(
Canvas* canvas,
uint8_t x,