2

I need to develop a component similar to iOS Facebook app event component. It should be a ViewPager that also reveals the next and previous (if position > 0) items.

The actual items should always be in the centre except the first item that should stick to the left and the last item that should stick to the right.

When overriding getPageWidth - it indeed also shows the next and previous, but all the actual items stick to the left.

   @Override
    public float getPageWidth(int position) {
       return (float) (0.7);
    }

This library for example, centres all items including the first, which is not what I want

NoDataDumpNoContribution
  • 10,591
  • 9
  • 64
  • 104
dor506
  • 5,246
  • 9
  • 44
  • 79

1 Answers1

1

Well, I ended up using RecyclerView (yes... RecyclerView) with overriding "onFling" method, as can bee seen in this post: RecyclerView horizontal scroll snap in center

Community
  • 1
  • 1
dor506
  • 5,246
  • 9
  • 44
  • 79