语言

Menu
Sites
Language
Proper way to use a layout for progress indication

Hello, I'm looking to figure out how to use a layout to contain a circle progress bar and a label. It's a countdown indicator, and I can't figure out how to make both a progress bar and label show together in a naviframe. I'm missing something, but I just can't figure out what. I'm using the naviframe with a bunch of lists to make cascading selections, and then I want to show a countdown at the end. I can't get either the circle or label to show when I pop the last list off.

The naviframe works great for the lists. But I need it to lead somewhere. I have one more function that pops the last list off which I would expect to show the layout. But, it doesn't. Any help would be appreciated.

static void gt_create_progressbar(appdata_s *ad)
{
    ad->circle_surface = eext_circle_surface_conformant_add(ad->countdown_layout);
    ad->circle_progressbar = eext_circle_object_progressbar_add(ad->countdown_layout, ad->circle_surface);
    evas_object_hide(ad->circle_progressbar);
}

static void gt_create_label(appdata_s *ad)
{
    ad->countdown_label =  elm_label_add(ad->countdown_layout);
    evas_object_size_hint_weight_set(ad->countdown_label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(ad->countdown_label, EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_size_hint_align_set(ad->countdown_label, 0.5, 0.5);
}

static void gt_create_countdown_layout(appdata_s *ad)
{
    ad->countdown_layout = elm_layout_add(ad->naviframe);
    gt_create_progressbar(ad);  
    gt_create_label(ad);
}

static void gt_create_conform(appdate_s *ad)
{
    ad->conform = elm_conformant_add(ad->win);

	evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);

    gt_naviframe_create(ad);
	gt_create_countdown_layout(ad);
	gt_list_create(ad);

    elm_naviframe_item_push(ad->naviframe, "Countdown", NULL, NULL, ad->countdown_layout, NULL);
    elm_naviframe_item_push(ad->naviframe, "Z", NULL, NULL, ad->list4, NULL);
    elm_naviframe_item_push(ad->naviframe, "Y", NULL, NULL, ad->list3, NULL);
    elm_naviframe_item_push(ad->naviframe, "X", NULL, NULL, ad->list2, NULL);
    elm_naviframe_item_push(ad->naviframe, "W", NULL, NULL, ad->list1, NULL);

}

 

编辑者为: Peter Buelow 20 9月, 2018

响应

3 回复
K Johnson

Hello Peter Buelow,

Would you please share the reason why do you need to show the label with progress bar? You may show the progress bar percentage value as example image in below link instead of using an additional label.

https://developer.tizen.org/ko/development/guides/native-application/user-interface/efl/ui-components/wearable-ui-components/circle-progressbar?langredirect=1

Peter Buelow

I am doing this as I want to show a bunch of data along with the progress bar. I found a demo app here though that helps me out. Basically, it's a countdown timer that I also wanted some sort of visual indication. My new design isn't perfect, but works reasonably well. I can't find the demo app I used to link here unfortunately, but it's a small native app that lets you set a countdown value and shows countdown progress.

K Johnson

Would you please share your code and screenshot of the design you want?