How to call a preferences screen from a Tizen watchface (Tizen native)

138 views Asked by At

I am developing a watch face and want to include some preferences (with UI components like checkboxes, etc.) that the user can open by tapping on the watch face. For this, what is the proper way to open a preferences list? Is it possible to include the code for the preferences (genlist, sliders, etc.) in the watch face project? Or do I need to create a dedicated UI project which is then bundled with the watch face via the Multi Package function of Tizen Studio and launched from the watch face through the app manager (app_control_h)?

2

There are 2 answers

2
taehyub On

@go3d, I think you can use the entry component for the user text input. here is the document for the entry usages on the wearable device. (https://docs.tizen.org/application/native/guides/ui/efl/wearable/component-entry/) I guess you can add some codes for the entry component to the WeatherWatch sample.

Example)

void maxlength_reached(void *data, Evas_Object *obj, void *event_info)
{
  //Implements the behavior when the entry maxlenth is reached.
}

static void _entry_enter_click(void *data, Evas_Object *obj, void *event_info)
{
  //Implements the behavior when the enter key is pressed.
}

// Create Entry Object.
Evas_Object* entry = elm_entry_add(layout);
elm_entry_single_line_set(entry, EINA_TRUE);
elm_entry_scrollable_set(entry, EINA_TRUE);
elm_scroller_policy_set(entry, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
evas_object_smart_callback_add(entry, "maxlength,reached", maxlength_reached, NULL);

limit_filter_data.max_char_count = 0;
limit_filter_data.max_byte_count = 100;
elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, &limit_filter_data);
elm_object_part_text_set(entry, "elm.guide", "input your text");
elm_entry_cursor_end_set(entry);
evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_smart_callback_add(entry, "activated", _entry_enter_click, NULL);

elm_object_content_set(layout, entry);
0
Rostislav Litovkin On

preferences(saving data). There are 2 ways:

  1. https://tizenschool.org/tutorial/118/contents/10

Using App Preference you may save information about the currently selected application, so when changing the app settings and return it back, the application will be loaded with the preferences, which was set during the last session.

  1. use xamarin.essentials NuGet package and Preferences.Get(..) or Preferences.Set(..) methods