Languages

Menu
Sites
Language
Cancel Naviframe pop item behavior

Hi,all
​   Now I have two naviframe item --view1,view2, view1 navigated to view2,  currently view2 is the top item of the naviframe, I have a such function:

1.when user press hardware back button only one time, the naviframe don't pop item, and

2. if press hardware back button twice time quickly,naviframe pop view2 and navigated to view1.

How can I do that ,thanks.

 

 

Responses

3 Replies
jian chen

elm_naviframe_item_pop_cb_set(nf_it,naviframe_pop_cb,nf); 

static Eina_Bool naviframe_pop_cb(void *data, Elm_Object_Item *it) {
 /* By returning FALSE, you can reject the popping the item */

if(press 2 times quickly)
   return EINA_TRUE;

else

  return  EINA_FALSE;
}

 

Mehedi Alamgir

Create a global variable. Increment  that variable value in pop callback function (Eina_Bool naviframe_pop_cb). Return true when global variable value is 2 
within a specific time.

int cnt = 0;

static Eina_Bool naviframe_pop_cb(void *data, Elm_Object_Item *it) 
{
 /* By returning FALSE, you can reject the popping the item */
 
cnt++;

if(cnt==2)
   return EINA_TRUE;
else
  return  EINA_FALSE;

}

 

 

jian chen

Yes~~