0

Im having trouble in using this library. I want to implement it in our capstone project (Students Handbook in Android). I've only manage to import the library in my Android studio. I cant figure out what to do next.

I've already search for tutorials but I only got this. I believe that this tutorials lacks information I need. Can anyone help me how would I apply this library to our application?

vhu
  • 12,244
  • 11
  • 38
  • 48
jeromeee
  • 11
  • 5

1 Answers1

0

If you managed to import the library successfully, then to make this component work its pretty much like using a ListView. Just instantiate your view, add it to your ViewGroup and bind it with your adapter (say ArrayAdapter) that will contain your pages.

FlipViewController flipView = new FlipViewController(yourContext, FlipViewController.HORIZONTAL);
yourContainer.addView(flipView);

yourAdapter.addAll(yourItems);
flipView.setAdapter(yourAdapter);
Stephen Vinouze
  • 1,815
  • 1
  • 17
  • 28
  • where would i put this code?(in my mainActiviity?)and what kind of view will i use for my pages? – jeromeee Jul 28 '15 at 22:03
  • can you give me a link with similar tutorial using listview? – jeromeee Jul 28 '15 at 22:05
  • This [link](https://github.com/codepath/android_guides/wiki/Using-an-ArrayAdapter-with-ListView) (amongs many tutorial) gives you the basics of how to build a ListView using an ArrayAdapter – Stephen Vinouze Jul 29 '15 at 10:02
  • ok,thank you,ive already make it work,the next thing is how will i use it with fragments? – jeromeee Aug 03 '15 at 06:02
  • If you managed to make it work from inside your Activity, then you just need to move your code into your Fragment. A Fragment has the same lifecycle as an Activity. Then add your fragment into your activity and you should be all set ;) – Stephen Vinouze Aug 03 '15 at 08:40