highly experimental bluetooth, try gadgetbridge
This commit is contained in:
@@ -27,30 +27,34 @@
|
||||
|
||||
lv_setup_entry_t setup_entry[ MAX_SETUP_ICON ];
|
||||
|
||||
lv_obj_t *setup_cont = NULL;
|
||||
lv_obj_t *setup_cont[ MAX_SETUP_TILES ];
|
||||
uint32_t setup_tile_num[ MAX_SETUP_TILES ];
|
||||
lv_style_t setup_style;
|
||||
uint32_t setup_tile_num;
|
||||
|
||||
void setup_tile_setup( void ) {
|
||||
setup_tile_num = mainbar_add_tile( 1, 1 );
|
||||
setup_cont = mainbar_get_tile_obj( setup_tile_num );
|
||||
|
||||
for ( int tiles = 0 ; tiles < MAX_SETUP_TILES ; tiles++ ) {
|
||||
setup_tile_num[ tiles ] = mainbar_add_tile( 1 + tiles , 1 );
|
||||
setup_cont[ tiles ] = mainbar_get_tile_obj( setup_tile_num[ tiles ] );
|
||||
}
|
||||
|
||||
lv_style_copy( &setup_style, mainbar_get_style() );
|
||||
|
||||
for ( int setup = 0 ; setup < MAX_SETUP_ICON ; setup++ ) {
|
||||
// set x, y and mark it as inactive
|
||||
setup_entry[ setup ].x = SETUP_FIRST_X_POS + ( ( setup % MAX_SETUP_ICON_HORZ ) * ( SETUP_ICON_X_SIZE + SETUP_ICON_X_CLEARENCE ) );
|
||||
setup_entry[ setup ].y = SETUP_FIRST_Y_POS + ( ( setup / MAX_SETUP_ICON_HORZ ) * ( SETUP_ICON_Y_SIZE + SETUP_ICON_Y_CLEARENCE ) );
|
||||
setup_entry[ setup ].y = SETUP_FIRST_Y_POS + ( ( ( setup % ( MAX_SETUP_ICON_VERT * MAX_SETUP_ICON_HORZ ) ) / MAX_SETUP_ICON_HORZ ) * ( SETUP_ICON_Y_SIZE + SETUP_ICON_Y_CLEARENCE ) );
|
||||
setup_entry[ setup ].active = false;
|
||||
// create app icon container
|
||||
setup_entry[ setup ].setup = mainbar_obj_create( setup_cont );
|
||||
setup_entry[ setup ].setup = mainbar_obj_create( setup_cont[ setup / ( MAX_SETUP_ICON_HORZ * MAX_SETUP_ICON_VERT ) ] );
|
||||
lv_obj_reset_style_list( setup_entry[ setup ].setup, LV_OBJ_PART_MAIN );
|
||||
lv_obj_add_style( setup_entry[ setup ].setup, LV_OBJ_PART_MAIN, &setup_style );
|
||||
lv_obj_set_size( setup_entry[ setup ].setup, SETUP_ICON_X_SIZE, SETUP_ICON_Y_SIZE );
|
||||
lv_obj_align( setup_entry[ setup ].setup , setup_cont, LV_ALIGN_IN_TOP_LEFT, setup_entry[ setup ].x, setup_entry[ setup ].y );
|
||||
lv_obj_align( setup_entry[ setup ].setup , setup_cont[ setup / ( MAX_SETUP_ICON_HORZ * MAX_SETUP_ICON_VERT ) ], LV_ALIGN_IN_TOP_LEFT, setup_entry[ setup ].x, setup_entry[ setup ].y );
|
||||
|
||||
lv_obj_set_hidden( setup_entry[ setup ].setup, true );
|
||||
|
||||
log_d("icon x/y: %d/%d", setup_entry[ setup ].x, setup_entry[ setup ].y );
|
||||
log_d("icon screen/x/y: %d/%d/%d", setup / ( MAX_SETUP_ICON_HORZ * MAX_SETUP_ICON_VERT ), setup_entry[ setup ].x, setup_entry[ setup ].y );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,5 +71,5 @@ lv_obj_t *setup_tile_register_setup( void ) {
|
||||
}
|
||||
|
||||
uint32_t setup_get_tile_num( void ) {
|
||||
return( setup_tile_num );
|
||||
return( setup_tile_num[ 0 ] );
|
||||
}
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
|
||||
#define MAX_SETUP_ICON_HORZ 3
|
||||
#define MAX_SETUP_ICON_VERT 2
|
||||
#define MAX_SETUP_ICON ( MAX_SETUP_ICON_HORZ * MAX_SETUP_ICON_VERT )
|
||||
#define MAX_SETUP_TILES 2
|
||||
#define MAX_SETUP_ICON ( MAX_SETUP_ICON_HORZ * MAX_SETUP_ICON_VERT * MAX_SETUP_TILES )
|
||||
|
||||
#define SETUP_ICON_X_SIZE 64
|
||||
#define SETUP_ICON_Y_SIZE 64
|
||||
|
||||
@@ -53,6 +53,9 @@ void splash_screen_stage_one( TTGOClass *ttgo ) {
|
||||
lv_obj_align(preload_label, preload, LV_ALIGN_OUT_BOTTOM_MID, 0, 5);
|
||||
|
||||
lv_disp_trig_activity(NULL);
|
||||
|
||||
lv_obj_move_foreground( preload );
|
||||
|
||||
lv_task_handler();
|
||||
|
||||
for( int bl = 0 ; bl < display_get_brightness() ; bl++ ) {
|
||||
@@ -62,6 +65,7 @@ void splash_screen_stage_one( TTGOClass *ttgo ) {
|
||||
}
|
||||
|
||||
void splash_screen_stage_update( const char* msg, int value ) {
|
||||
lv_obj_move_foreground( preload );
|
||||
lv_disp_trig_activity(NULL);
|
||||
lv_task_handler();
|
||||
delay(100);
|
||||
@@ -72,7 +76,7 @@ void splash_screen_stage_update( const char* msg, int value ) {
|
||||
}
|
||||
|
||||
void splash_screen_stage_finish( TTGOClass *ttgo ) {
|
||||
ttgo->bl->adjust( 0 );
|
||||
// ttgo->bl->adjust( 0 );
|
||||
for( int bl = display_get_brightness() ; bl > 0 ; bl-- ) {
|
||||
ttgo->bl->adjust( bl );
|
||||
delay(1);
|
||||
|
||||
@@ -49,6 +49,7 @@ lv_status_bar_t statusicon[ STATUSBAR_NUM ] =
|
||||
{ NULL, NULL, LV_ALIGN_IN_TOP_RIGHT, &statusbarstyle[ STATUSBAR_STYLE_WHITE ] },
|
||||
{ NULL, LV_SYMBOL_BATTERY_FULL, LV_ALIGN_OUT_LEFT_MID, &statusbarstyle[ STATUSBAR_STYLE_WHITE ] },
|
||||
{ NULL, LV_SYMBOL_WIFI, LV_ALIGN_OUT_LEFT_MID, &statusbarstyle[ STATUSBAR_STYLE_WHITE ] },
|
||||
{ NULL, LV_SYMBOL_BLUETOOTH, LV_ALIGN_OUT_LEFT_MID, &statusbarstyle[ STATUSBAR_STYLE_WHITE ] },
|
||||
{ NULL, LV_SYMBOL_BELL, LV_ALIGN_OUT_LEFT_MID, &statusbarstyle[ STATUSBAR_STYLE_WHITE ] },
|
||||
{ NULL, LV_SYMBOL_WARNING, LV_ALIGN_OUT_LEFT_MID, &statusbarstyle[ STATUSBAR_STYLE_WHITE ] },
|
||||
};
|
||||
@@ -178,6 +179,7 @@ void statusbar_setup( void )
|
||||
statusbar_hide_icon( STATUSBAR_BELL );
|
||||
statusbar_hide_icon( STATUSBAR_WARNING );
|
||||
statusbar_hide_icon( STATUSBAR_WIFI );
|
||||
statusbar_style_icon( STATUSBAR_BLUETOOTH, STATUSBAR_STYLE_GRAY );
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
STATUSBAR_BATTERY_PERCENT,
|
||||
STATUSBAR_BATTERY,
|
||||
STATUSBAR_WIFI,
|
||||
STATUSBAR_BLUETOOTH,
|
||||
STATUSBAR_BELL,
|
||||
STATUSBAR_WARNING,
|
||||
STATUSBAR_NUM
|
||||
|
||||
Reference in New Issue
Block a user