Evas_Object *edje = NULL;
edje = elm_layout_edje_get(page_indicator->unit[i]);
snprintf(cur_page_num, sizeof(cur_page_num), "%d", page_indicator->current_page + 1);
- LOGD("Current page is %s, set the number to the page indicator", cur_page_num);
+ if (i < page_indicator->page_count) {
+ LOGD("Current page is %s, set the number to the page indicator", cur_page_num);
+ }
if (i == cur_indicator_unit) {
edje_object_signal_emit(edje, SIGNAL_PAGE_INDICATOR_CURRENT, SIGNAL_SOURCE);
edje_object_signal_emit(edje, SIGNAL_PAGE_INDICATOR_DEFAULT, SIGNAL_SOURCE);
}
- if (edje_object_part_text_set(elm_layout_edje_get(page_indicator->unit[PAGE_INDICATOR_CENTER_PAGE_INDEX]), CENTER_UNIT_TEXT, cur_page_num) == EINA_FALSE) {
- LOGE("Failed to set text on the page indicator");
+ if (page_indicator->page_count > PAGE_INDICATOR_MAX_PAGE_COUNT && i == PAGE_INDICATOR_CENTER_PAGE_INDEX) {
+ if (edje_object_part_text_set(elm_layout_edje_get(page_indicator->unit[PAGE_INDICATOR_CENTER_PAGE_INDEX]), CENTER_UNIT_TEXT, cur_page_num) == EINA_FALSE) {
+ LOGE("Failed to set text on the page indicator");
+ }
}
}
}