static void __apps_view_folder_entry_done_cb(void *data, Evas_Object *obj, void *event_info);
static void __apps_view_folder_entry_focused_cb(void *data, Evas_Object *obj, void *event_info);
static void __apps_view_folder_entry_unfocused_cb(void *data, Evas_Object *obj, void *event_info);
+static void __apps_view_folder_entry_maxlength_reached_cb(void *data, Evas_Object *obj, void *event_info);
Evas_Object *apps_view_create(Evas_Object *win)
apps_view_s.opened_folder = item;
- apps_view_s.folder_popup_ly = elm_layout_add(homescreen_efl_get_win());
+ apps_view_s.folder_popup_ly = elm_layout_add(homescreen_efl_get_conformant());
elm_layout_file_set(apps_view_s.folder_popup_ly , edj_path, GROUP_APPS_FOLDER_POPUP_LY);
evas_object_size_hint_weight_set(apps_view_s.folder_popup_ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_resize(apps_view_s.folder_popup_ly, apps_view_s.width, apps_view_s.height);
elm_entry_scrollable_set(entry, EINA_TRUE);
evas_object_show(entry);
+ Elm_Entry_Filter_Limit_Size limit_filter = { 0, };
+ limit_filter.max_char_count = APPS_FOLDER_MAX_TITLE;
+ limit_filter.max_byte_count = 0;
+ elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, &limit_filter);
+
char style_string[STR_MAX] = { 0, };
snprintf(style_string, sizeof(style_string), "<font_size=40><color=#60606060><align=center>%s</align></color></font_size>", _("IDS_COM_HEADER_UNNAMED_FOLDER"));
elm_object_part_text_set(entry, "elm.guide", style_string);
evas_object_smart_callback_add(entry, "activated", __apps_view_folder_entry_done_cb, NULL);
evas_object_smart_callback_add(entry, "focused", __apps_view_folder_entry_focused_cb, NULL);
evas_object_smart_callback_add(entry, "unfocused", __apps_view_folder_entry_unfocused_cb, NULL);
+ evas_object_smart_callback_add(entry, "maxlength,reached", __apps_view_folder_entry_maxlength_reached_cb, NULL);
elm_entry_text_style_user_push(entry, "DEFAULT='font=Tizen:style=Regular align=center color=#4DE7FFFF font_size=40 wrap=none'");
elm_entry_entry_set(entry, apps_view_s.opened_folder->label_str);
apps_view_delete_icon(item);
}
}
+
+ Evas_Object *entry = elm_object_part_content_get(apps_view_s.folder_popup_ly, APPS_FOLDER_TITLE);
+ if (entry) {
+ evas_object_smart_callback_del(entry, "activated", __apps_view_folder_entry_done_cb);
+ evas_object_smart_callback_del(entry, "focused", __apps_view_folder_entry_focused_cb);
+ evas_object_smart_callback_del(entry, "unfocused", __apps_view_folder_entry_unfocused_cb);
+ evas_object_smart_callback_del(entry, "maxlength,reached", __apps_view_folder_entry_maxlength_reached_cb);
+
+ evas_object_del(entry);
+ }
+
evas_object_del(apps_view_s.folder_popup_ly);
apps_view_s.folder_title_entry = NULL;
apps_view_s.folder_popup_ly = NULL;
snprintf(style_string, sizeof(style_string), "<font_size=40><color=#60606060><align=center>%s</align></color></font_size>", _("IDS_COM_HEADER_UNNAMED_FOLDER"));
elm_object_part_text_set(obj, "elm.guide", style_string);
}
+
+static void __apps_view_folder_entry_maxlength_reached_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ //@TODO: need to check the string
+ toast_unfocused_show("Up to 30 characters available.");
+}
static void __toast_timeout_cb(void *data, Evas_Object *obj, void *event_info);
static void __toast_block_clicked_cb(void *data, Evas_Object *obj, void *event_info);
+static void __toast_unfocused_timeout_cb(void *data, Evas_Object *obj, void *event_info);
+static void __toast_unfocused_block_clicked_cb(void *data, Evas_Object *obj, void *event_info);
+
void popup_show(int btn_count, Evas_Smart_Cb btn_func[3], void *func_data[3],
const char (*btn_text)[STR_MAX], const char *title_text, const char *popup_text)
evas_object_show(popup);
}
+void toast_unfocused_show(char* str)
+{
+ Evas_Object *toast_win = NULL;
+ Evas_Object *popup = NULL;
+
+ toast_win = elm_win_add(NULL, "homescreen_toast", ELM_WIN_NOTIFICATION);
+ elm_win_alpha_set(toast_win, EINA_TRUE);
+ elm_win_title_set(toast_win, "homescreen_toast");
+ elm_win_prop_focus_skip_set(toast_win, EINA_TRUE);
+ if (elm_win_wm_rotation_supported_get(toast_win)) {
+ int rots[4] = { 0, 90, 180, 270 };
+ elm_win_wm_rotation_available_rotations_set(toast_win, (const int *) (&rots), 4);
+ }
+ evas_object_show(toast_win);
+
+ popup = elm_popup_add(toast_win);
+ elm_object_style_set(popup, "toast");
+ evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_text_set(popup, str);
+ elm_popup_timeout_set(popup, 2.0);
+ evas_object_smart_callback_add(popup, "block,clicked", __toast_unfocused_block_clicked_cb, (void *) toast_win);
+ evas_object_smart_callback_add(popup, "timeout", __toast_unfocused_timeout_cb, (void *) toast_win);
+ elm_object_tree_focus_allow_set(popup, EINA_FALSE);
+
+ evas_object_show(popup);
+}
+
static void __toast_timeout_cb(void *data, Evas_Object *obj, void *event_info)
{
evas_object_del(obj);
}
+
static void __toast_block_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
evas_object_del(obj);
}
+
+static void __toast_unfocused_timeout_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ evas_object_del(obj);
+ evas_object_del((Evas_Object *) data);
+}
+
+static void __toast_unfocused_block_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ evas_object_del(obj);
+ evas_object_del((Evas_Object *) data);
+}