Exemple #1
0
void handle_deinit()
{
    tick_timer_service_unsubscribe();

    animation_unschedule_all();

    property_animation_destroy(mario_animation_beg);
    property_animation_destroy(mario_animation_end);
    property_animation_destroy(block_animation_beg);
    property_animation_destroy(block_animation_end);
    property_animation_destroy(hour_animation_slide_in);
    property_animation_destroy(hour_animation_slide_away);
    property_animation_destroy(minute_animation_slide_in);
    property_animation_destroy(minute_animation_slide_away);

    gbitmap_destroy(mario_normal_bmp);
    gbitmap_destroy(mario_jump_bmp);
    gbitmap_destroy(ground_bmp);

    text_layer_destroy(date_layer);
    text_layer_destroy(text_minute_layer);
    text_layer_destroy(text_hour_layer);

    layer_destroy(ground_layer);
    layer_destroy(mario_layer);
    layer_destroy(blocks_layer);

    window_destroy(window);
}
Exemple #2
0
static void main_window_unload(Window *window)
{
	animation_unschedule_all();
	tick_timer_service_unsubscribe();
	layer_destroy(s_face);
	layer_destroy(s_hand);
	animation_destroy(s_my_animation_ptr);
}
void selection_layer_destroy(Layer* layer) {
  SelectionLayerData *data = layer_get_data(layer);
  
  animation_unschedule_all();
  if (data) {
    selection_layer_deinit(layer);
  }
}
Exemple #4
0
static void changeText(int step, const char* font){
  animation_unschedule_all();
  text_layer_set_font(s_text_layer, fonts_get_system_font(font));
  text_layer_set_text(s_text_layer, wikiData[step]);
  number_of_pixels = layer_get_bounds(window_get_root_layer(s_wiki_window)).size.h - text_layer_get_content_size(s_text_layer).h;
  if (number_of_pixels < 0) {
      animate_quote(number_of_pixels);
  }
}
void animation_control(void) {	
	if (animation_count > 0) {
		animation_count--;
		return;
	}
	
	switch (animation_state) {
		case 0: // initial launch, animate the code and label on screen
			animation_state = 10;
			if (fonts_changed)
				set_fonts();
			animate_code_on();
			animate_label_on();
			show_countdown_layer();
			break;
		case 20: // animate the code off screen
			animation_state = 30;
			animation_direction = DOWN;
			animate_code_off();
			break;
		case 30: // animate the code on screen
			animation_state = 10;
			animation_direction = LEFT;
			animate_code_on();
			break;
		case 40: // animate the code and label off screen
			animation_state = 0;
			animation_count = 1;
			animate_code_off();
			animate_label_off();
			break;
		case 50: // animate the code and label and second counter off screen
			animation_state = 60;
			animation_unschedule_all();
			animation_count = 1;
			animation_direction = RIGHT;
			hide_countdown_layer();
			animate_code_off();
			animate_label_off();
			break;
		case 60: // animate the swipe layer on screen using the background color
			animation_state = 70;
			GRect start = GRect(0, display_bounds.size.h*-1, display_bounds.size.w, display_bounds.size.h);
			swipe_layer = text_layer_create(start);
			text_layer_set_background_color(swipe_layer, bg_color);
			Layer *window_layer = window_get_root_layer(single_code_main_window);
			layer_add_child(window_layer, text_layer_get_layer(swipe_layer));
			animate_layer(text_layer_get_layer(swipe_layer), AnimationCurveEaseInOut, &start, &display_bounds, 500, on_animation_stopped_callback);
			break;
		case 70: // set the new colors and clear the swipe layer
			apply_display_colors();
			text_layer_destroy(swipe_layer);
			animation_state = 0;
			animation_control();
			break;
	}
}
Exemple #6
0
static void deinit() {
	animation_unschedule_all();
	accel_tap_service_unsubscribe();
	bluetooth_connection_service_unsubscribe();
	window_destroy_safe(s_main_window);
}