cleanup powermgm and add haptic feedback

This commit is contained in:
sharandac
2020-08-03 09:04:33 +02:00
parent 69b9a54408
commit ae45eac491
24 changed files with 168 additions and 125 deletions

View File

@@ -132,8 +132,7 @@ void weather_app_setup( void ) {
static void enter_weather_widget_event_cb( lv_obj_t * obj, lv_event_t event ) {
switch( event ) {
case( LV_EVENT_CLICKED ): motor_vibe( 1 );
mainbar_jump_to_tilenumber( weather_app_tile_num, LV_ANIM_OFF );
case( LV_EVENT_CLICKED ): mainbar_jump_to_tilenumber( weather_app_tile_num, LV_ANIM_OFF );
break;
}
}

View File

@@ -145,24 +145,21 @@ void weather_forecast_tile_setup( uint32_t tile_num ) {
static void exit_weather_widget_event_cb( lv_obj_t * obj, lv_event_t event ) {
switch( event ) {
case( LV_EVENT_CLICKED ): motor_vibe( 1 );
mainbar_jump_to_maintile( LV_ANIM_OFF );
case( LV_EVENT_CLICKED ): mainbar_jump_to_maintile( LV_ANIM_OFF );
break;
}
}
static void setup_weather_widget_event_cb( lv_obj_t * obj, lv_event_t event ) {
switch( event ) {
case( LV_EVENT_CLICKED ): motor_vibe( 1 );
weather_jump_to_setup();
case( LV_EVENT_CLICKED ): weather_jump_to_setup();
break;
}
}
static void refresh_weather_widget_event_cb( lv_obj_t * obj, lv_event_t event ) {
switch( event ) {
case( LV_EVENT_CLICKED ): motor_vibe( 1 );
weather_forecast_sync_request();
case( LV_EVENT_CLICKED ): weather_forecast_sync_request();
weather_widget_sync_request();
break;
}

View File

@@ -131,6 +131,7 @@ void weather_setup_tile_setup( uint32_t tile_num ) {
lv_obj_add_style( weather_autosync_cont, LV_OBJ_PART_MAIN, &weather_setup_style );
lv_obj_align( weather_autosync_cont, weather_lat_cont, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 5 );
weather_autosync_onoff = lv_switch_create( weather_autosync_cont, NULL );
lv_obj_add_protect( weather_autosync_onoff, LV_PROTECT_CLICK_FOCUS);
lv_obj_add_style( weather_autosync_onoff, LV_SWITCH_PART_INDIC, mainbar_get_switch_style() );
lv_switch_off( weather_autosync_onoff, LV_ANIM_ON );
lv_obj_align( weather_autosync_onoff, weather_autosync_cont, LV_ALIGN_IN_RIGHT_MID, -5, 0 );
@@ -145,6 +146,7 @@ void weather_setup_tile_setup( uint32_t tile_num ) {
lv_obj_add_style( weather_wind_cont, LV_OBJ_PART_MAIN, &weather_setup_style );
lv_obj_align( weather_wind_cont, weather_autosync_cont, LV_ALIGN_OUT_BOTTOM_MID, 0, 0 );
weather_wind_onoff = lv_switch_create( weather_wind_cont, NULL);
lv_obj_add_protect( weather_wind_onoff, LV_PROTECT_CLICK_FOCUS);
lv_obj_add_style( weather_wind_onoff, LV_SWITCH_PART_INDIC, mainbar_get_switch_style() );
lv_switch_off( weather_wind_onoff, LV_ANIM_ON);
lv_obj_align( weather_wind_onoff, weather_wind_cont, LV_ALIGN_IN_RIGHT_MID, -5, 0);