Commit 5fd49b3e authored by Ludovic Fauvet's avatar Ludovic Fauvet

utils: add naviframe helpers

parent a7287b0f
......@@ -38,6 +38,7 @@
#include "sidebar.h"
#include "audio_player.h"
#include "playback_service.h"
#include "utils.h"
#include "views/audio_view.h"
#include "views/video_view.h"
......@@ -201,11 +202,7 @@ intf_show_view(interface *intf, view_e view_type)
static void
intf_pop_view(interface *intf)
{
Eina_List* nf_items = elm_naviframe_items_get(intf->nf_content);
unsigned int nf_items_count = eina_list_count(nf_items);
eina_list_free(nf_items);
if (nf_items_count == 1)
if (naviframe_count(intf->nf_content) == 1)
{
playback_service *p_ps = application_get_playback_service(intf->p_app);
......
......@@ -76,3 +76,22 @@ media_timetostr(int64_t time)
asprintf(&str, "%02lld:%02lld", d.rem, sec);
return str;
}
void
naviframe_clear(Evas_Object *nf)
{
Evas_Object* obj;
do
{
obj = elm_naviframe_item_pop(nf);
} while (obj != NULL);
}
unsigned int
naviframe_count(Evas_Object *nf)
{
Eina_List* nf_items = elm_naviframe_items_get(nf);
unsigned int nf_items_count = eina_list_count(nf_items);
eina_list_free(nf_items);
return nf_items_count;
}
......@@ -35,5 +35,11 @@ create_image(Evas_Object *parent, const char *image_path);
char *
media_timetostr(int64_t time);
void
naviframe_clear(Evas_Object *nf);
unsigned int
naviframe_count(Evas_Object *nf);
#endif /* UTILS_H_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment