Ejemplo n.º 1
0
void update_bluetooth(bool connected) {
  if (connected) {
    layer_show(s_enemy_layer);
  }
  else {
    layer_hide(s_enemy_layer);
  }
}
Ejemplo n.º 2
0
/**
 * Refresh
 */
void refresh_stops_window(realtime_transport_type_t ttype) {
    if (!window_stack_contains_window(transport_type_to_window_map[ttype])) {
        return;
    }

    menu_layer_reload_data(transport_type_to_menulayer_map[ttype]);
    layer_hide(transport_type_to_loadinglayer_map[ttype]);

    if (command_timeout_timer != NULL) {
        app_timer_cancel(command_timeout_timer);
        command_timeout_timer = NULL;
    }
}
Ejemplo n.º 3
0
void ui_layout() {
    int top = MARGINTOP;

    if ((is_sleeping && config.auto_sleep_mode) || (config.low_power_quiet_mode && quiet_time_is_active())) {
        text_layer_move(ui.layers.time, 0, top + (PHEIGHT - top) * 0.20);
        text_layer_move(ui.layers.date, 0, top + (PHEIGHT - top) * 0.50);

        text_layer_hide(ui.layers.status_bar);
        text_layer_hide(ui.layers.status_bar1);
        text_layer_hide(ui.layers.status_bar2);
        text_layer_hide(ui.layers.status_bar3);
        layer_hide(ui.layers.battery);
        text_layer_hide(ui.layers.month);
        text_layer_hide(ui.layers.info_box_left);
        text_layer_hide(ui.layers.info_box_right);
    }
    else {
        text_layer_show(ui.layers.date);
        text_layer_show(ui.layers.month);
        text_layer_show(ui.layers.info_box_left);
        text_layer_show(ui.layers.info_box_right);

        if (config.show_status_bar == 1) {
            top = MARGINTOP_WITH_STATUS_BAR;
        }

        if (config.layout == 1) { //Reverse Classic layout
            if (config.hide_battery == 1) {
                text_layer_move(ui.layers.time, 0, top + (PHEIGHT - top) * 0.62);
                text_layer_move(ui.layers.date, 0, top + (PHEIGHT - top) * 0.42);
            }
            else {
                text_layer_move(ui.layers.time, 0, top + (PHEIGHT - top) * 0.64);
                text_layer_move(ui.layers.date, 0, top + (PHEIGHT - top) * 0.40);
            }

            layer_move(ui.layers.battery, 0, top + (PHEIGHT - top) * 0.44);
            text_layer_move(ui.layers.month, 0, top + (PHEIGHT - top) * 0.28);
            text_layer_move(ui.layers.info_box_left, INFO_MARGIN, top + (PHEIGHT - top) * 0.05);
            text_layer_move(ui.layers.info_box_right, HALFPWIDTH + 1, top + (PHEIGHT - top) * 0.05);
        }
        else { //Classic layout
            if (config.hide_battery == 1) {
                text_layer_move(ui.layers.time, 0, top + (PHEIGHT - top) * 0.02);
                text_layer_move(ui.layers.date, 0, top + (PHEIGHT - top) * 0.36);
            }
            else {
                text_layer_move(ui.layers.time, 0, top);
                text_layer_move(ui.layers.date, 0, top + (PHEIGHT - top) * 0.38);
            }

            layer_move(ui.layers.battery, 0, top + (PHEIGHT - top) * 0.18);
            text_layer_move(ui.layers.month, 0, top + (PHEIGHT - top) * 0.59);
            text_layer_move(ui.layers.info_box_left, INFO_MARGIN, top + (PHEIGHT - top) * 0.74);
            text_layer_move(ui.layers.info_box_right, HALFPWIDTH + 1, top + (PHEIGHT - top) * 0.74);
        }

        if (config.hide_battery == 1) {
            layer_hide(ui.layers.battery);
        }
        else {
            layer_show(ui.layers.battery);
        }

        if (config.show_status_bar == 1) {
            text_layer_show(ui.layers.status_bar);
            text_layer_show(ui.layers.status_bar2);

            #ifdef PBL_ROUND
                text_layer_hide(ui.layers.status_bar1);
                text_layer_hide(ui.layers.status_bar3);
            #else
                text_layer_show(ui.layers.status_bar1);
                text_layer_show(ui.layers.status_bar3);
            #endif
        }
        else {
            text_layer_hide(ui.layers.status_bar);
            text_layer_hide(ui.layers.status_bar1);
            text_layer_hide(ui.layers.status_bar2);
            text_layer_hide(ui.layers.status_bar3);
        }

        if (is_obstructed) {
            text_layer_hide(ui.layers.info_box_left);
            text_layer_hide(ui.layers.info_box_right);
            text_layer_hide(ui.layers.month);
        }
        else {
            text_layer_show(ui.layers.info_box_left);
            text_layer_show(ui.layers.info_box_right);
            text_layer_show(ui.layers.month);
        }
    }
}
Ejemplo n.º 4
0
void text_layer_hide(TextLayer *layer) {
    if (layer != NULL) {
        layer_hide((Layer *) layer);
    }
}