Implementing Color Indicators in Tizen Native Applications

Original Created Jul 17, 2018 | Regeneration Apr 22, 2026

I need to display color indicators for selected colors in my Tizen mobile application. These indicators should appear in Genlist items, detail views, and dialogs.

I've explored two approaches but encountered issues:

  1. Using Elm_Bg: The colored background doesn't render unless I specify minimum size
  2. Using ColorSelector's circle widget: It shows but I can't change its color

Here are my implementation attempts:

Colored Square Approach:

static Evas_Object* gl_content_get_cb(void* data, Evas_Object* obj, const char* part) {
    if (!strcmp(part, "elm.swallow.end")) {
        Evas_Object* bg = elm_bg_add(obj);
        elm_bg_color_set(bg, 66, 162, 206);
        return bg;
    }
}

Circle Widget Approach:

static Evas_Object* gl_content_get_cb(void* data, Evas_Object* obj, const char* part) {
    if (!strcmp(part, "elm.swallow.end")) {
        Evas_Object* layout = elm_layout_add(obj);
        elm_layout_theme_set(layout, "colorselector", "item", "default");
        return layout;
    }
}

What is the recommended way to implement such color indicators in Tizen native applications?

Problem Understanding

The user needs to display color indicators in various UI components of a Tizen mobile application. The main challenges are:

  1. Getting basic color indicators to render properly
  2. Finding the most appropriate component for this purpose

Solution Methods

  1. Using Elm_Bg with Proper Size Hints

    • The background object requires explicit size hints to render
    • Solution code:
      Evas_Object* bg = elm_bg_add(obj);
      elm_bg_color_set(bg, 66, 162, 206);
      evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
      evas_object_size_hint_min_set(bg, ELM_SCALE_SIZE(24), ELM_SCALE_SIZE(24));
      evas_object_size_hint_aspect_set(bg, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
      return bg;
      
  2. Alternative Approach Using Layouts

    • For more complex indicators, consider using custom layouts
    • This provides more control over appearance and behavior

Additional Tips

  • When using Elm_Bg, remember that size hints are mandatory for proper rendering
  • For consistent appearance across devices, use ELM_SCALE_SIZE for dimension values
  • Consider accessibility requirements when choosing colors

Customize your cookie preferences

You can enable or disable non-essential cookies. Essential cookies are always on to ensure the site works properly and to keep you signed in.

Necessary

These cookies are necessary for the website to function properly and cannot be switched off. They help with things like logging in and setting your privacy preferences.

Always on

Analytics

These cookies help us improve the site by tracking which pages are most popular and how visitors move around the site.

Enable analytics cookies
Public Forum Public Forum
Employees only. Please sign in with your company account.