Languages

Menu
Sites
Language
Genlist UI issue on Samsung Z1 device, inconsistent with emulator

I'm developing a Tizen 2.3 mobile native app where I use a genlist where each item either has got a "groupindex" style or a "2line.top" style.  I use the following tag on the texts to make sure long strings are fully visible:

<wrap=word><ellipsis=-1.0>Some Very Long Text, Sometimes 2 or 3 Lines Long</ellipsis></wrap>

It works just fine in the Tizen 2.3 emulator, with the wrapping occuring where it should, and the ellipsis are never used. However, on a real Samsung Z1 device (Tizen v2.3.0.1, build string "Z130HDDU0BOD7"), the first items of the genlist look incorrect, as shown on the following screen shots:

https://goo.gl/photos/2oYFq9sHeSMALqow9

The photo where it says the camera resolution is 3.1MP shows the app as it is running on the Z1 device. The other photo shows it as it is running in a 480x800 512MB RAM emulator.  I would like it to look as it looks on the emulator shot.

The first item looks off even when it's not really the first item, e.g. when a "groupindex" item comes first and the "2line.top" item comes as second.  And oddly no other items are wrong, only the first one with the style "2line.top" in the genlist.

Is there a workaround to get around this issue?  Or can we expect a fix on the OS level?  Or maybe I'm using the wrong trick on the genlist items to get the long strings wrapped?  It would be awesome if there was an easier way to achieve that, e.g. by setting the genlist to automatically wrap all items.


Thanks,
Tamas

 

Edited by: Tamas Miklos on 17 Jun, 2015

Responses

17 Replies
Vikram

Hi,

seems there is a similar topic, https://developer.tizen.org/forums/native-application-development/how-change-height-genlist-item

as that topic, possible " elm_genlist_mode_set(list, ELM_LIST_COMPRESS)" can help you, to make your genlist item with too long text looks nice.

but I am not sure whether them are the same, could you help to share your sample code here? We can help you to do more try&testing. :)

 

 

Tamas Miklos

Thank you for your reply. I already use ELM_LIST_COMPRESS for my genlist. I'm not sure what part of the code would be relevant to this issue, so here's the genlist creation function as a start:

static Evas_Object *
create_genlist_InfoPage(appdata_s *ad, Eina_List *list, int pageIdx)
{
 Evas_Object *genlist;
 Elm_Object_Item *it;
 int n_items = eina_list_count(list);
 int index;

 Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
 if (pageIdx == PAGE_APPS) {
  itc->item_style = APPSPAGE_ITEM_STYLE;
  itc->func.text_get = gl_AppsPage_text_get_cb;
  itc->func.content_get = gl_AppsPage_content_get_cb;
 }
 else {
  itc->item_style = "2line.top";
  itc->func.text_get = gl_InfoPage_text_get_cb;
 }
 itc->func.del = gl_del_cb;

 Elm_Genlist_Item_Class *gitc = elm_genlist_item_class_new();
 gitc->item_style = "groupindex";
 gitc->func.text_get = gl_InfoPageGroup_text_get_cb;
 gitc->func.del = gl_del_cb;

 genlist = elm_genlist_add(ad->nf);
 elm_scroller_single_direction_set(genlist, ELM_SCROLLER_SINGLE_DIRECTION_HARD);
 elm_genlist_homogeneous_set(genlist, EINA_FALSE);
 elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
 elm_genlist_select_mode_set(genlist, ELM_OBJECT_SELECT_MODE_NONE);

 evas_object_smart_callback_add(genlist, "realized", gl_realized_cb, NULL);
 evas_object_smart_callback_add(genlist, "loaded", gl_loaded_cb, NULL);
 evas_object_smart_callback_add(genlist, "contracted", gl_contracted_cb, NULL);

 Eina_List *node = eina_list_nth_list(list, 0);
 for (index = 0; index < n_items; index++) {
  item_data_s *id = calloc(sizeof(item_data_s), 1);
  id->index = index;
  id->list = list;
  ListItem *nodeData = eina_list_data_get(node);

  switch (nodeData->ID) {
   case IID_DIV_DEVICE:
   case IID_DIV_DEVICE_1ST:
    it = elm_genlist_item_append(genlist, gitc, id, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
    break;
   default:
    it = elm_genlist_item_append(genlist, itc, id, NULL, ELM_GENLIST_ITEM_NONE, gl_InfoPage_selected_cb, ad);
    break;
  }

  id->item = it;
  nodeData->GenListItem = it;
  node = eina_list_next(node);
 }
 elm_genlist_item_class_free(itc);
 elm_genlist_item_class_free(gitc);
 evas_object_show(genlist);
 return genlist;
}

The whole app source code is quite long, so please let me know what calls or functions shall I copy-paste to help dig down deeper into this. And thank you for taking time to look into this.

Alex Dem

Hi,
I tried to check your case (with UI controls example->genlist), and have added Group item first and items with similar style "2line.top" below
inside itc->func.text_get callback my code looks like:

if (strstr(itc->item_style, "2line.top")) {
        if (strcmp(part, "elm.text.main.left.top")==0) {
            snprintf(buf, 1023, "[%d]%s", id->index, demo_names[id->index % size]);
            return strdup(buf);
        } else if (strcmp(part, "elm.text.sub.left.bottom")==0){
            snprintf(buf, 1023, "[%d]%s", id->index, demo_names[id->index % size]);
            return strdup(buf);
        }
    }

I did not observe the issue for long text (3/4 lines) on Z1 device inside <wrap=word><ellipsis=-1.0></ellipsis></wrap> but I have observed some issues with first item on emulator.
Please provide how do you got text inside your itc->func.text_get callback? It could be essentially .
Alexey.

Tamas Miklos

Thank you for your reply.  I'm somehow glad that you can experience some visual issues :)  It means I'm not all crazy about whining about genlists :))

Here's morecode that you've asked for:

typedef struct _ListItem
{
    char *Field;
    char *Value;
    char *Value2;
    int ID;
    sensor_h Sensor;
    sensor_type_e SensorType;
    sensor_listener_h SensorListener;
    char *IconFile;
    Elm_Object_Item *GenListItem;
}ListItem;

static char *

gl_InfoPage_text_get_cb(void *data, Evas_Object *obj, const char *part)
{
 item_data_s *id = data;
 const Elm_Genlist_Item_Class *itc = elm_genlist_item_item_class_get(id->item);

 if (itc->item_style && !strcmp(itc->item_style, "2line.top")) {
  if (part && !strcmp(part, "elm.text.main.left.top")) {
   ListItem *nodeData = eina_list_nth(id->list, id->index);
   if (nodeData) return strdup(nodeData->Field);
   return NULL;
  }
  else if (part && !strcmp(part, "elm.text.sub.left.bottom")) {
   ListItem *nodeData = eina_list_nth(id->list, id->index);
   if (nodeData) return strdup(nodeData->Value);
   return NULL;
  }
 }
 return NULL;
}

static char *
gl_AppsPage_text_get_cb(void *data, Evas_Object *obj, const char *part)
{
 item_data_s *id = data;
 const Elm_Genlist_Item_Class *itc = elm_genlist_item_item_class_get(id->item);

 if (itc->item_style && !strcmp(itc->item_style, APPSPAGE_ITEM_STYLE)) {
  if (part && !strcmp(part, "elm.text.main.left.top")) {
   ListItem *nodeData = eina_list_nth(id->list, id->index);
   if (nodeData) return strdup(nodeData->Field);  // package label
   return NULL;
  }
  else if (part && !strcmp(part, "elm.text.sub.right.top")) {
   ListItem *nodeData = eina_list_nth(id->list, id->index);
   if (nodeData) return strdup(nodeData->Value);  // package version
   return NULL;
  }
  else if (part && !strcmp(part, "elm.text.sub.left.bottom")) {
   ListItem *nodeData = eina_list_nth(id->list, id->index);
   if (nodeData) return strdup(nodeData->Value2);  // package name
   return NULL;
  }
 }
return NULL;
}

The underlying einalist are constructed of ListItem elements.  In the ListItems the Field is the string for the first line, and the Value is the string for the second line.  Except for the Apps page that uses a special case with Field + Value + Value2.  With the Apps page I experience other genlist related UI appearance issues that I've mentioned in another topic here on this forum.

 

Thanks,
Tamas

Alex Dem

Hi,
Looks like you use the same approach for "2line.top" style in itc->func.text_get method but have got another error (works on emulator but not for device, unlike my case).
Alexey. 

Tamas Miklos

I've tried to post a longer code, but it triggered the spam filter.  So here's the snippet that was missing from my previous post:

static char *
gl_InfoPageGroup_text_get_cb(void *data, Evas_Object *obj, const char *part)

{
 item_data_s *id = data;
 const Elm_Genlist_Item_Class *itc = elm_genlist_item_item_class_get(id->item);

 if (itc->item_style && !strcmp(itc->item_style, "groupindex")) {
  if (part && !strcmp(part, "elm.text.main")) {
   ListItem *nodeData = eina_list_nth(id->list, id->index);
   if (nodeData) return strdup(nodeData->Field);
   return NULL;
  }
 }
 return NULL;
}

Tamas Miklos

My app has finally been approved to be published in the Tizen Store, so please check it out under the name AIDA64.  If you run it on a Z1, you can see that the first list item heights are fine on the System, Display, Network, Battery, Tizen, Thermal, Sensors, Apps, System Files and About pages; but the height is slightly larger than expected on the CPU page, and a lot higher than expected on the Devices and Directories pages.  The layout is still just fine, with proper item heights in the 480x800 or any other resolution emulators.

Tamas Miklos

UPDATE: My app was tested on a Z3, and the UI completely falls apart due to the genlist UI issue that apparently hasn't been resolved in Tizen 2.4 either. I've just checked it, and in the emulator everything looks and works fine. How to resolve this issue on my end? And if it's indeed a Tizen platform bug, when can we expect it to be fixed?

Tamas Miklos

UPDATE #2: I've reported the issue to the Tizen Store support, and just like before, they were unable to provide a meaningful response.  They said: "Regarding your inquiry, we would like to inform you that it is not mandatory to fix Recommendation Issue (Defect ID : 2790140), it is just for your reference when you update the appliation in near future." Yeah, right, when the UI completely falls apart on the Z3, it is not mandatory to fix it, just recommended. But the issue is not with my app, but with the Tizen platform. Why cannot Samsung step up and say they would at least try to find out where the issue might be? Even with an official native Tizen mobile sample app it is quite easy to reproduce the genlist issue. If the Tizen Store support is not up to the job, and noone here has an idea, what 3rd option would be left for an app developer like me to resolve such issues of the Tizen platform? I would be more than happy to help, to work together with real Tizen developers/engineers, but I feel like I'm the only one who truly wants to catch this bug of the Tizen platform.

Alex Dem

Hi,
Just minor question:
Did you set api version 2.4 in manifest for for Z3?
Alexey.

Tamas Miklos

No. What I have is a single development environment, Tizen SDK 2.3.1, and I have the API version set to 2.3.  Unless someone (I mean Samsung here, mainly) is able to provide clear guidelines on how to maintain 2 different instances in the Tizen Store for the same app, one for 2.3 devices and the other for 2.4 devices, without mixing things up on a 2.4 device, I won't migrate the app to 2.4 SDK.  What I want to do is keep it at 2.3, and make the app work perfectly on all possible combinations of Tizen 2.3 + Z1, 2.4 + Z1 and 2.4 + Z3.  And since the genlist issue also presents in 2.3 + Z1, I'm pretty sure the issue is not the SDK, or at least it's not about the combination of 2.4 + Z3.  The issue plagues both 2.3 and 2.4 platform, and both Z1 and Z3 devices, but with different extent. On Z1, as you can see on the above screen shots, only minor cosmetical issues are present.  While on the Z3 the UI falls apart: cells in the genlist get overlapped, the content gets completely unreadable.

BTW, as a test, I've tried to migrate my project using the Tizen 2.4 SDK, but the SDK wasn't able to properly import my project, and so it wouldn't compile. One more issue with Tizen SDKs, but since I don't even want to go for 2.4, I didn't hassle with reporting this via either this forum or via Tizen Store support.

Alex Dem

Hi,
I hope that for Z1 could be released firmware to use "2.4" device api (as for Z3).
Alexey.

Tamas Miklos

Yes, that is definitely something that Samsung is working hard to make happen. It would however not make all Z1 users migrate to the new platform in the short- and mid-term. So even if 2.4 + Z1 is a possible combination, Samsung should make it clear for native mobile app developers how to properly migrate their 2.3 apps to 2.4, and how to maintain apps for both platform in the Tizen Store. Proper developer supporting materials (documentations, how-to's, tutorial videos, sample apps) are quite scarce to find for Tizen native mobile platform...

Alex Dem

Hi,
fyi, Even in Release Notes https://developer.tizen.org/development/tools/download/release-notes/2.4-oct-22-2015 there is remark:
The Tizen 2.4 SDK supports the development of Tizen 2.4 applications only. To develop an application based on the Tizen 2.3 platform, you must use the Tizen 2.3 SDK.
Alexey.

Carsten Haitzler

fyi - you are not spekaing with the developers there with appstore support.

if you have actual bugs or issues that you want developers to look into, please:

join IRC #tizen on irc.freenode.net

join the dev tizen mailing list and mail to it: https://www.tizen.org/community/mailing-lists

i smell this may be a race condition. ie - due to timing the ordering things are sized up and calculated changes slightly (lots of calculations are deferred until "as late as possible" to avoid doing them multiple times).

Tamas Miklos

Thank you for your comment. Quite frankly, I don't mind talking to non-developers. But, when I bring up a clear issue of Samsung's online validation system or a platform bug, I expect non-developers to forward my issue to their developers.  Or at least someone who's competent enough to decide what can be done about my issue. Thank you for your tips about the IRC and mailing lists, but when I get no resolution on this forum, and the store support says I should come here, I've already burnt too much time dealing with the issue. I like the community here, and generally speaking, I like posting into forums to ask for help, but I have absolutely no more time to chase the right guys at Samsung just to resolve a clear issue of the Tizen platform that they (ie. Samsung developers) should have already got notified about via 2 different channels. Especially when someone is trying to push a native mobile app project which -- I assume -- is exactly the kind of project that Samsung should support 100%. And even though I never tried to develop for it, I don't think the Tizen web platform would be any different than the native platform anyway, at least when it comes to maturity and the quality of technical support.

Tamas Miklos

There's a potential workaround for this issue that I've recently discovered. If the text that is returned for elm.text.main.left.top and elm.text.sub.left.bottom portions of the 2line.top style are completely encompassed by the tags to make the potentially long text wrap to multiple lines, then the visual artifacts happen. But, if the text starts with a word, and only the rest of the text is encompassed by the tags, then it _seems_ to work fine. So far I only had a chance to test this on a Z1, since my Z3 hasn't arrived yet.

So, just to clarify, the following sample text causes the genlist issue:

"<wrap=mixed><ellipsis=-1.0>Very long text that should be displayed wrapped to multiple lines, even on a Z3 device</ellipsis></wrap>"

And the following sample text doesn't seem to cause an issue:

"Very <wrap=mixed><ellipsis=-1.0>long text that should be displayed wrapped to multiple lines, even on a Z3 device</ellipsis></wrap>"

I've managed to reproduce the issue by slightly modifying the built-in native mobile sample UIComponentsSample as well, so this is definitely not just an issue about my app or the way I handle the genlist.

I don't expect Samsung to jump on this issue (I only wish), but maybe this workaround could help others facing similar issues about genlist rendering.