The following animator is controlled by the application. This sample application uses the ecore_animator_add() function to run the animation for an unspecified amount of time because the time hands must move continuously when the watch face is activated. The Ecore Animator API is a helper to simplify creating animations. #define HANDS_STOPWATCH_12H_PIVOT_POSITION_Y 360-93 #define HANDS_STOPWATCH_12H_PIVOT_POSITION_X BASE_WIDTH /2 #define HANDS_STOPWATCH_30S_PIVOT_POSITION_Y 93 #define HANDS_STOPWATCH_30S_PIVOT_POSITION_X BASE_WIDTH /2 #define HANDS_SEC_PIVOT_POSITION_Y BASE_HEIGHT / 2 The shadow hands are synchronized with the time hands. The shadow padding is needed to add reality to the watch view. You can adjust the size and position of the parts through the defined variables in the chronograph.h file. View_chronograph_create_parts(parts_image_path, position_x, position_y, size_w, size_h, type) Size_h = data_get_parts_height_size(type) Size_w = data_get_parts_width_size(type) Parts_image_path = data_get_parts_image_path(type) ĭata_get_parts_position(type, &position_x, &position_y) In the _create_parts() function, the parts are created according to the predefined size and position in the chronograph.h Create parts of type Parts type.* Create hands and shadow hands to display in the watch */ * Create a layout to display the chronograph view in the watch */ĭata_get_resource_path(EDJ_FILE, edj_path, sizeof(edj_path)) Ĭhronograph_layout = view_chronograph_create_layout(bg, edj_path) ĭlog_print(DLOG_ERROR, LOG_TAG, "Failed to create chronograph_layout") edc) file and make parts for the clock hands: Create the chronograph layout using the.Win = view_create_watch_window(width, height) ĭlog_print(DLOG_ERROR, LOG_TAG, "Failed to create a watch window") ĭata_get_resource_path(IMAGE_BG, bg_path, sizeof(bg_path)) īg = view_create_bg(win, bg_path, width, height) ĭlog_print(DLOG_ERROR, LOG_TAG, "Failed to create a bg") The win variable is essential to make the application UI, and the bg variable is the main background image of the application. Create the basic layout using the view_create() function.This file contains the functions for implementing the views and handling events. This file contains the functions related to the application life-cycle, callback functions, and view control. This file contains the functions for retrieving and making data for the application. This directory contains the image files used in the C files. This file is for the UI and contains the style, images, and position of the sample application. This file contains information and definition of the variables and functions used in the C files, especially in the view.c file. This file contains information and definition of the variables and functions used in the C files, especially in the data.c file. This file contains information and definition of the variables and functions used in the C files, especially in the main.c file. This directory contains the image files used in the main.edc file. You can create and view the sample application project, including the source files, in the IDE. The following figure illustrates the main screen of the Chronograph Watch. It does not include any additional functionalities, such as a stopwatch. This sample application includes only the watch functionality. The Ecore Animator API is introduced to show the moving hands continuously. The Chronograph Watch sample application demonstrates how to create a circular watch with continuously moving hands.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |