android - Implement openAphid Flip animation(flipboard) for scrollable grid screen -


hi stuck problem in implementing flipboard app page fold animation. using openaphid/android-flip library this. able implement animations screen displays list of items using gridview, library shows fold animation screen having adapters only, showing fold animation individual item of adapter. want show animation single screen either fragment or activity , possible since animation implemented in "havells mcatalogue app". if has worked library animation , knows how implement animation screen showing several items in gridview please let me know how work on thing. adding photos reference of animation app. , here's link animation library

https://github.com/openaphid/android-flipimage 1[![][1]]2

well able implement required function inflating fragment shows gridview adapter inside getview method of 1 adapter class extends base adapter. since flip couldn't flip next items of fragment having grid view, needed go different technique. i.e had create hard coded screens , define hard coded count adapter used set flip view controller , inside view method of adapter depending on position load different xml , accordingly instantiate views. know bad technique , exhaustive solution found.

here's codes

fragmentloaderadapterfragment.java

public class fragmentloaderadapterfragment extends fragment {  private flipviewcontroller flipview;  public fragmentloaderadapterfragment() { }  @override public view oncreateview(layoutinflater inflater, viewgroup container,                          bundle savedinstancestate) {     flipview = new flipviewcontroller(inflater.getcontext());     flipview.setadapter(new singlefragmentdisplayadapter());      return flipview;  }  @override public void onresume() {     super.onresume();     flipview.onresume(); }  @override public void onpause() {     super.onpause();     flipview.onpause(); }  @override public void ondestroy() {     super.ondestroy();     flipview = null; }  private class singlefragmentdisplayadapter extends baseadapter {       public singlefragmentdisplayadapter() {     }      @override     public int getcount() {         return 2;     }      @override     public object getitem(int i) {         return i;     }      @override     public long getitemid(int i) {         return i;     }      @override     public view getview(int i, view view, viewgroup viewgroup) {         if (i==0){             view = view.inflate(getactivity(),r.layout.fragment_consumer_products,null);             linearlayout cablelinearlayout = (linearlayout) view.findviewbyid(r.id.cableslayout);             cablelinearlayout.setonclicklistener(new view.onclicklistener() {                 @override                 public void onclick(view view) {                     toast.maketext(getactivity(), "clicked", toast.length_short).show();                 }             });             return view;         } if (i==1){             view = view.inflate(getactivity(),r.layout.fragment_consumer_products2,null);             linearlayout cablelinearlayout = (linearlayout) view.findviewbyid(r.id.cableslayout);             cablelinearlayout.setonclicklistener(new view.onclicklistener() {                 @override                 public void onclick(view view) {                     toast.maketext(getactivity(), "clicked", toast.length_short).show();                 }             });             return view;         } else {             return null;         }     }  } } 

enter image description here


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -