Languages

Menu
Sites
Language
Single BACK button doesn't remove ENTRY component from screen

I have created an entry (on screen keyboard) for a wearable v4 app.  I can type keys with the full keyboard onscreen but my text is behind the vkeyboard (if multiline is off), or partially cut off in the top left (if multiline is on).

If I click the back button on the watch (emulator), the keyboard dissappears but the text remains on screen.  There is also an "ABC  DEF" at the bottom of that window (only in the v5 emulator), or I just see a black background with my text vertically centered (on v4 emulator).

Shouldn't the BACK button remove the entire keyboard and return to the previous view on the naviframe?  Can someone explain what is happening?  I have posted my code below:

void _setting_name_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{
appdata_s *ad = data;
Evas_Object *naviframe = ad->naviframe;
Elm_Object_Item *nf_it = NULL;

/* Unhighlight Item */
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);

// Create a keyboard (entry) and add to naviframe
Evas_Object *entry;
entry = elm_entry_add(naviframe);
elm_entry_entry_set(entry, "A short text.");

// elm_entry_input_panel_layout_set(entry,ELM_INPUT_PANEL_LAYOUT_NUMBERONLY);
elm_entry_input_panel_return_key_type_set (entry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE);
elm_entry_autocapital_type_set (entry,ELM_AUTOCAPITAL_TYPE_WORD);
// Add a filter for max 16 characters
static Elm_Entry_Filter_Limit_Size limit_size = { .max_char_count = 16 };
elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, &limit_size);
// Disable word wrap
elm_entry_line_wrap_set(entry,ELM_WRAP_NONE);
elm_entry_single_line_set(entry, EINA_TRUE);

// Push the entry onto the naviframe to show it
nf_it = elm_naviframe_item_push(naviframe, _("Slider"), NULL, NULL, entry, "empty");
// nf_it = elm_naviframe_item_push(naviframe, _(""), NULL, NULL, entry, "empty");

// Set the callback of the naviframe when layout popped off
elm_naviframe_item_pop_cb_set(nf_it, _setting_name_finished_cb, ad);
}
Edited by: Michelle Dupuis on 19 Aug, 2019
View Selected Answer

Responses

14 Replies
Paul L

Hi, can you share app screenshot and short description on it what do you want to achieve?

Michelle Dupuis
Based on my reading, the symptoms I describe in my reply would suggest the conformant isn't working, and that a circle surface has not been added to the naviframe.  But I am building on the "SettingsUI" sample code, which contains this both a conformant and cicle surface:
 
static void
create_base_gui(appdata_s *ad)
{
    Evas_Object *conform = NULL;

	/* Window */
	ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
	elm_win_autodel_set(ad->win, EINA_TRUE);

	evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);

	/* Conformant */
	conform = elm_conformant_add(ad->win);
	evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	elm_win_resize_object_add(ad->win, conform);
	evas_object_show(conform);

	/* Naviframe */
	ad->naviframe = elm_naviframe_add(conform);
	elm_object_content_set(conform, ad->naviframe);

	/* Eext Circle Surface*/
	ad->circle_surface = eext_circle_surface_naviframe_add(ad->naviframe);

	/* Main View */
	create_base_view(ad);

	eext_object_event_callback_add(ad->naviframe, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL);
	eext_object_event_callback_add(ad->naviframe, EEXT_CALLBACK_MORE, eext_naviframe_more_cb, NULL);

	/* Show window after base gui is set up */
	evas_object_show(ad->win);
}

 

Michelle Dupuis

My goal: from the Genlist I want to click an item called "NAME", which pops up a keyboard where I type my name.  When I click done on the keyboard, or click BACK button the keyboard closes and I'm back at my genlist.

The source code is available in this related question:  https://developer.tizen.org/forums/native-application-development/keyboard-text-on-wearable-entry-component-cutoff

My genlist appears like this:

Then when I popup the entry component it looks like this:  (Note that "A short text" is hidden behind keyboard)

And after pressing the BACK button:

 

I've noticed that the behaviour changes a bit with emulator v3 / v4 / v5,  But my questions are:

1. Why is the text hidden behind the keyboard?  Shouldn't the conformant move it above?

2. When above the keyboard (in multiline mode) the top left of the text is cutoff.  Should the circle surface force alignment within a circle?

3. Why after pressing BACK do I see the text entry without a keyboard?  And I have to hit back AGAIN to return to the genlist.

4. Are these all emulator problems?  Or is something wrong with my code (see post linked above)

Mark as answer
Paul L

ad 1 and 2: Circle surface is supported by circle components (elm_entry is not), here you have list and examples: https://developer.tizen.org/development/guides/native-application/user-interface/efl/ui-components/wearable-ui-components/circle-surface#add_object
You can add some paddings/margins around the entry or/and center text inside the entry to avoid this behaviour.


ad 3 and 4. You can to change eext_naviframe_back_cb to your custom callback function in eext_object_event_callback_add(ad->naviframe, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL); 
First hide keyboard an then switch to listview in one on back pressed event.

Michelle Dupuis

Thanks Paul.  Can you provide an example of how to add padding/margins around the entry?  As well, how to center the text in case that is the approach I want?

 

Michelle Dupuis

The event handler for Naviframe's EEXT_CALLBACK_BACK does not seem to be called when you hit BACK while the keyboard is open.

Michelle Dupuis

Regarding questions 3 & 4:  If I create a custom callback I assume that I should hide the keyboard by popping a view off the naviframe.  However, how do I switch back to my genlist?  Shouldn't popping the last view do this for me?

Can you provide an example of how to switch back to the listview?  (I'm using the SettingsUI example code)

Paul L

To align/center text use elm_entry_text_style_user_push with html tags. You can change font color, size, typeface etc.

The best way to create ui layout is to use edc files. https://developer.tizen.org/development/guides/native-application/user-interface/efl/layouting-edc/part-block/positioning-parts

Paul L

or try this:

https://developer.tizen.org/development/guides/native-application/user-interface/efl/primitive-graphical-objects/evas-objects

    evas_object_move(entry, 50, 50);
    evas_object_resize(entry, 300, 300);
    evas_object_show(entry);
Michelle Dupuis

I like the code way of moving the entry, so I tried that but it doesn't work.  The coordinates don't change, almost as if Tizen is forcing entry to a certain location.

I tried moving the 3 linea above BEFORE the naviframe push, and AFTER, but it still doesn't affect the text position.  Do I have to disable the conformant some how (just guessing).

Michelle Dupuis

At the moment my structure is Win > Conformant > Naviframe (with Circle Surface).  After the entry is added tot he Naviframe I seem to have no ability to move it.  

So I added the Naviframe to the Win directly, but that didn't change anything...still can't move or resize the entry.  I don't understand why.  Hopefully you have a solution on how to move the entry.

 

Michelle Dupuis

Ooops - I mean I added the ENTRY to the WIN directly, but still couldn't change its position.   [I wish I could edit my posts]

Michelle Dupuis

I added a box first (which the conformant would make full size) and then placed my entry into the box at an offset  That seems to work but is this the right way to do it?

Michelle Dupuis

Please note that the solution for 3/4 (re: custom callback) does NOT work.  The solution accepted refers to using an EDC to layout the entry.