Transform Image during transformPage in Viewpager Android -


i want transform image when view pager slides. have seen when viewpager slides

public void transformpage(view view, float f) 

is called. in function want add functionality when view slides 1 2 or 2 3 image 1st page should go 2nd screen.

i want implement functionality grofers android app welcome screen.

please me

i did using -

 public void transformpage(view view, float f) {             if(view.gettag() != null) {                 int = integer.parseint(string.valueof(view.gettag()));                 if (f >= -1f && f < 1.0f) {                     if (i == 0) {                         animateonfirstscreen(f);                     } else {                         if (i == 1) {                             animateonsecondscreen(f);                             return;                         }                         if (i == 2) {                             animateonthirdscreen(f);                             return;                         }                     }                 }             }         }  private void animateonfirstscreen(float f)     {         if (f <= 0.0f)         {             f = math.abs(f);             posx = (text_grocery_mart_final_x - text_grocery_mart_init_x) * f + text_grocery_mart_init_x;             textgrocerymart.settranslationx(posx);             posy = (text_grocery_mart_final_y - text_grocery_mart_init_y) * f + text_grocery_mart_init_y;             textgrocerymart.settranslationy(posy);                imagemuffin.setalpha(0.0f);                 imageenergydrink.setalpha(0.0f);                 imagemuffin.setscalex(0.0f);                 imageenergydrink.setscalex(0.0f);         }     } 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -