Viewpager with circle and title indicator
Asked Answered
R

2

0

I'm using Viewpager and the Circle and Title view pager from JakeWharton The viewpager with the circle indicator is working fine, but while using the view pager with both circle and title indicator both indicators are not working. Here is a screenshow of the issue:

enter image description here So is it possible to use both indicators at the same time, and if so how can I do that? Also does anyone knows how can I style the title indicator? Right now it shows a blue line and no text..

Here is my code:

adapter = new ContractsPagerAdapter(getActivity(), topContracts, selected);     
        pager.setAdapter(adapter);
        indicator.setViewPager(pager);
        titleIndicator.setTextColor(getResources().getColor(R.color.white));
        titleIndicator.setViewPager(pager);
Ricercar answered 28/9, 2015 at 18:18 Comment(1)
From a user interface perspective, why is it necessary to use both a title indicator AND a circle indicator? Pick one instead of using both in my opinion. Is the title indicator broken by itself?Friedland
V
3

Hi you can do it logically. I have implemented it using ViewPager and frame layout. Frame layout to show the indictor. Indicator is basically two image for off and on. You can download the complete code and change accordingly. http://javaant.com/viewpager-with-circle-indicator-in-android/#.VpdtjMB943g Hope this will help you.

Vlad answered 14/1, 2016 at 9:44 Comment(0)
T
0

I can only offer an alternative library. I am currently using this Material Design Library which has a ViewPagerWithIndicator activity layout. It uses fragments and right off the bat does exactly what you're asking. It changes the ActionBarTitle along with the indicator. It is very easy to implement and lightweight.

Thereabouts answered 28/9, 2015 at 20:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.