简体   繁体   English

如何从 Tizen 表盘调用首选项屏幕(Tizen 原生)

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

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.我正在开发一个表盘,并希望包含一些用户可以通过点击表盘打开的首选项(带有复选框等 UI 组件)。 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?是否可以在表盘项目中包含首选项(genlist、滑块等)的代码? 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)?或者我是否需要创建一个专用的 UI 项目,然后通过 Tizen Studio 的 Multi Package function 与表盘捆绑,并通过应用程序管理器 (app_control_h) 从表盘启动?

@go3d, I think you can use the entry component for the user text input. @go3d,我认为您可以将 entry 组件用于用户文本输入。 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. https://docs.tizen.org/application/native/guides/ui/efl/wearable/component-entry/ )我想您可以将入口组件的一些代码添加到 WeatherWatch 示例。

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);

Hi preferences (saving data), there are 2 ways:嗨首选项(保存数据),有两种方法:

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

  2. use xamarin.essentials NuGet package and Preferences.Get(..)/Preferences.Set(..) methods使用xamarin.essentials NuGet package 和 Preferences.Get(..)/Preferences.Set(..) 方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM