elm_naviframe_item_pop_cb_set(nf_item, custom_back_cb, NULL);
}
+static void editfield_focused_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ Evas_Object *editfield = (Evas_Object *)data;
+ elm_object_signal_emit(editfield, "elm,state,focused", "");
+
+ if (!elm_entry_is_empty(obj))
+ elm_object_signal_emit(editfield, "elm,action,show,button", "");
+}
+
+static void editfield_unfocused_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ Evas_Object *editfield = (Evas_Object *)data;
+ elm_object_signal_emit(editfield, "elm,state,unfocused", "");
+ elm_object_signal_emit(editfield, "elm,action,hide,button", "");
+}
+
+static Evas_Object *create_multiline_editfield_layout(Evas_Object *parent, void *data)
+{
+ Evas_Object *editfield;
+
+ editfield = elm_layout_add(parent);
+ elm_layout_theme_set(editfield, "layout", "editfield", "multiline");
+ evas_object_size_hint_align_set(editfield, EVAS_HINT_FILL, 0.0);
+ evas_object_size_hint_weight_set(editfield, EVAS_HINT_EXPAND, 0.0);
+
+ entry = elm_entry_add(editfield);
+ static Elm_Entry_Filter_Limit_Size limit_filter_data;
+ limit_filter_data.max_char_count = KEYBOARD_EDITOR_CHAR_COUNT_MAX;
+ elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, &limit_filter_data);
+ evas_object_smart_callback_add(entry, "maxlength,reached", maxlength_cb, data);
+
+ elm_object_part_text_set(entry, "elm.guide", g_input_keyboard_data.guide_text);
+ evas_object_smart_callback_add(entry, "focused", editfield_focused_cb, editfield);
+ evas_object_smart_callback_add(entry, "unfocused", editfield_unfocused_cb, editfield);
+ elm_object_part_content_set(editfield, "elm.swallow.content", entry);
+
+ return editfield;
+}
+
+static Evas_Object *create_editfield_view(void *data)
+{
+ App_Data *ad = (App_Data *)data;
+
+ Evas_Object *main_scroller, *main_box, *editfield;
+
+ main_scroller = elm_scroller_add(ad->naviframe);
+ elm_scroller_bounce_set(main_scroller, EINA_FALSE, EINA_TRUE);
+ evas_object_size_hint_weight_set(main_scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(main_scroller, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(main_scroller);
+
+ main_box = elm_box_add(main_scroller);
+ evas_object_size_hint_align_set(main_box, EVAS_HINT_FILL, 0.0);
+ evas_object_size_hint_weight_set(main_box, EVAS_HINT_EXPAND, 0.0);
+ evas_object_show(main_box);
+
+ editfield = create_multiline_editfield_layout(main_box, data);
+ elm_box_pack_end(main_box, editfield);
+ evas_object_show(editfield);
+
+ Evas_Object *btn = elm_button_add(main_box);
+ elm_object_text_set(btn, "OK");
+ evas_object_size_hint_weight_set(btn, 0.5, 0.5);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_smart_callback_add(btn, "clicked", btn_clicked_cb, NULL);
+ evas_object_show(btn);
+ elm_box_pack_end(main_box, btn);
+
+ elm_object_content_set(main_scroller, main_box);
+
+ evas_object_show(ad->naviframe);
+ const char *item_style = NULL;
+ if (_WEARABLE)
+ item_style = "empty";
+ Elm_Object_Item *nf_item = elm_naviframe_item_push(ad->naviframe, NULL, NULL, NULL, main_scroller, item_style);
+ elm_naviframe_item_pop_cb_set(nf_item, custom_back_cb, NULL);
+
+ return main_scroller;
+}
+
bool input_keyboard_launch(Evas_Object *window, void *data) {
if (window == NULL) {
PRINTFUNC(DLOG_ERROR, "Can not get window");
return false;
}
- create_fullscreen_editor(data);
+
+ if (_WEARABLE)
+ create_fullscreen_editor(data);
+ else
+ create_editfield_view(data);
+
return true;
}