├── sample
├── web.png
├── logo.png
├── psd
│ ├── logo.psd
│ ├── web.psd
│ ├── icon_hdpi.psd
│ ├── icon_mdpi.psd
│ └── icon_xhdpi.psd
├── screens.png
├── libs
│ └── android-support-v4.jar
├── res
│ ├── drawable-hdpi
│ │ ├── icon.png
│ │ ├── perm_group_camera_normal.png
│ │ ├── perm_group_calendar_normal.png
│ │ ├── perm_group_camera_selected.png
│ │ ├── perm_group_location_normal.png
│ │ ├── custom_tab_indicator_divider.9.png
│ │ ├── custom_tab_indicator_focused.9.png
│ │ ├── perm_group_calendar_selected.png
│ │ ├── perm_group_location_selected.png
│ │ ├── custom_tab_indicator_selected.9.png
│ │ ├── perm_group_device_alarms_normal.png
│ │ ├── custom_tab_indicator_unselected.9.png
│ │ ├── perm_group_device_alarms_selected.png
│ │ ├── custom_tab_indicator_selected_pressed.9.png
│ │ ├── custom_tab_indicator_unselected_focused.9.png
│ │ └── custom_tab_indicator_unselected_pressed.9.png
│ ├── drawable-mdpi
│ │ ├── icon.png
│ │ ├── perm_group_camera_normal.png
│ │ ├── perm_group_calendar_normal.png
│ │ ├── perm_group_camera_selected.png
│ │ ├── perm_group_location_normal.png
│ │ ├── custom_tab_indicator_divider.9.png
│ │ ├── perm_group_calendar_selected.png
│ │ ├── perm_group_location_selected.png
│ │ ├── custom_tab_indicator_selected.9.png
│ │ ├── perm_group_device_alarms_normal.png
│ │ ├── custom_tab_indicator_unselected.9.png
│ │ ├── perm_group_device_alarms_selected.png
│ │ ├── custom_tab_indicator_selected_focused.9.png
│ │ ├── custom_tab_indicator_selected_pressed.9.png
│ │ ├── custom_tab_indicator_unselected_focused.9.png
│ │ └── custom_tab_indicator_unselected_pressed.9.png
│ ├── drawable-xhdpi
│ │ ├── icon.png
│ │ ├── perm_group_camera_normal.png
│ │ ├── perm_group_calendar_normal.png
│ │ ├── perm_group_camera_selected.png
│ │ ├── perm_group_location_normal.png
│ │ ├── perm_group_calendar_selected.png
│ │ ├── perm_group_location_selected.png
│ │ ├── custom_tab_indicator_divider.9.png
│ │ ├── custom_tab_indicator_selected.9.png
│ │ ├── perm_group_device_alarms_normal.png
│ │ ├── custom_tab_indicator_unselected.9.png
│ │ ├── perm_group_device_alarms_selected.png
│ │ ├── custom_tab_indicator_selected_focused.9.png
│ │ ├── custom_tab_indicator_selected_pressed.9.png
│ │ ├── custom_tab_indicator_unselected_focused.9.png
│ │ └── custom_tab_indicator_unselected_pressed.9.png
│ ├── drawable
│ │ ├── perm_group_camera.xml
│ │ ├── perm_group_calendar.xml
│ │ ├── perm_group_location.xml
│ │ ├── perm_group_device_alarms.xml
│ │ └── custom_tab_indicator.xml
│ ├── menu
│ │ └── menu.xml
│ ├── layout
│ │ ├── simple_underlines.xml
│ │ ├── simple_icons.xml
│ │ ├── simple_tabs.xml
│ │ ├── simple_lines.xml
│ │ ├── simple_circles.xml
│ │ ├── simple_titles.xml
│ │ ├── simple_circles_vertical.xml
│ │ ├── simple_titles_bottom.xml
│ │ ├── themed_underlines.xml
│ │ ├── themed_lines.xml
│ │ ├── themed_circles.xml
│ │ └── themed_titles.xml
│ └── values
│ │ └── styles.xml
├── project.properties
├── src
│ └── com
│ │ └── viewpagerindicator
│ │ └── sample
│ │ ├── SampleLinesDefault.java
│ │ ├── SampleIconsDefault.java
│ │ ├── SampleCirclesDefault.java
│ │ ├── SampleLinesStyledLayout.java
│ │ ├── SampleTitlesBottom.java
│ │ ├── SampleTitlesDefault.java
│ │ ├── SampleCirclesStyledLayout.java
│ │ ├── SampleTitlesStyledLayout.java
│ │ ├── SampleUnderlinesDefault.java
│ │ ├── SampleUnderlinesStyledLayout.java
│ │ ├── SampleLinesStyledTheme.java
│ │ ├── SampleCirclesSnap.java
│ │ ├── SampleCirclesStyledTheme.java
│ │ ├── SampleTitlesStyledTheme.java
│ │ ├── SampleUnderlinesStyledTheme.java
│ │ ├── SampleUnderlinesNoFade.java
│ │ ├── SampleCirclesInitialPage.java
│ │ ├── SampleTitlesInitialPage.java
│ │ ├── SampleTitlesTriangle.java
│ │ ├── SampleUnderlinesStyledMethods.java
│ │ ├── SampleLinesStyledMethods.java
│ │ ├── SampleCirclesStyledMethods.java
│ │ ├── SampleTitlesCenterClickListener.java
│ │ ├── SampleTitlesStyledMethods.java
│ │ ├── SampleCirclesWithListener.java
│ │ ├── SampleTitlesWithListener.java
│ │ ├── TestFragmentAdapter.java
│ │ ├── SampleTabsDefault.java
│ │ ├── SampleTabsStyled.java
│ │ ├── BaseSampleActivity.java
│ │ ├── SampleTabsWithIcons.java
│ │ ├── TestFragment.java
│ │ └── ListSamples.java
├── pom.xml
└── AndroidManifest.xml
├── library
├── libs
│ └── android-support-v4.jar
├── res
│ ├── drawable-hdpi
│ │ ├── vpi__tab_selected_holo.9.png
│ │ ├── vpi__tab_unselected_holo.9.png
│ │ ├── vpi__tab_selected_focused_holo.9.png
│ │ ├── vpi__tab_selected_pressed_holo.9.png
│ │ ├── vpi__tab_unselected_focused_holo.9.png
│ │ └── vpi__tab_unselected_pressed_holo.9.png
│ ├── drawable-mdpi
│ │ ├── vpi__tab_selected_holo.9.png
│ │ ├── vpi__tab_unselected_holo.9.png
│ │ ├── vpi__tab_selected_focused_holo.9.png
│ │ ├── vpi__tab_selected_pressed_holo.9.png
│ │ ├── vpi__tab_unselected_focused_holo.9.png
│ │ └── vpi__tab_unselected_pressed_holo.9.png
│ ├── drawable-xhdpi
│ │ ├── vpi__tab_selected_holo.9.png
│ │ ├── vpi__tab_unselected_holo.9.png
│ │ ├── vpi__tab_selected_focused_holo.9.png
│ │ ├── vpi__tab_selected_pressed_holo.9.png
│ │ ├── vpi__tab_unselected_focused_holo.9.png
│ │ └── vpi__tab_unselected_pressed_holo.9.png
│ ├── color
│ │ ├── vpi__dark_theme.xml
│ │ └── vpi__light_theme.xml
│ ├── values
│ │ ├── vpi__colors.xml
│ │ ├── vpi__styles.xml
│ │ ├── vpi__defaults.xml
│ │ └── vpi__attrs.xml
│ └── drawable
│ │ └── vpi__tab_indicator.xml
├── AndroidManifest.xml
├── src
│ └── com
│ │ └── viewpagerindicator
│ │ ├── IconPagerAdapter.java
│ │ ├── PageIndicator.java
│ │ ├── IconPageIndicator.java
│ │ ├── IcsLinearLayout.java
│ │ ├── TabPageIndicator.java
│ │ ├── UnderlinePageIndicator.java
│ │ └── LinePageIndicator.java
├── project.properties
└── pom.xml
├── .gitignore
├── checkstyle.xml
├── README.md
├── CHANGELOG.md
└── pom.xml
/sample/web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/web.png
--------------------------------------------------------------------------------
/sample/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/logo.png
--------------------------------------------------------------------------------
/sample/psd/logo.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/psd/logo.psd
--------------------------------------------------------------------------------
/sample/psd/web.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/psd/web.psd
--------------------------------------------------------------------------------
/sample/screens.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/screens.png
--------------------------------------------------------------------------------
/sample/psd/icon_hdpi.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/psd/icon_hdpi.psd
--------------------------------------------------------------------------------
/sample/psd/icon_mdpi.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/psd/icon_mdpi.psd
--------------------------------------------------------------------------------
/sample/psd/icon_xhdpi.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/psd/icon_xhdpi.psd
--------------------------------------------------------------------------------
/sample/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/sample/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/sample/res/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/sample/res/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/library/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/library/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/library/res/drawable-hdpi/vpi__tab_selected_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/library/res/drawable-hdpi/vpi__tab_selected_holo.9.png
--------------------------------------------------------------------------------
/library/res/drawable-mdpi/vpi__tab_selected_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/library/res/drawable-mdpi/vpi__tab_selected_holo.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-hdpi/perm_group_camera_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-hdpi/perm_group_camera_normal.png
--------------------------------------------------------------------------------
/sample/res/drawable-mdpi/perm_group_camera_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-mdpi/perm_group_camera_normal.png
--------------------------------------------------------------------------------
/sample/res/drawable-xhdpi/perm_group_camera_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-xhdpi/perm_group_camera_normal.png
--------------------------------------------------------------------------------
/library/res/drawable-hdpi/vpi__tab_unselected_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/library/res/drawable-hdpi/vpi__tab_unselected_holo.9.png
--------------------------------------------------------------------------------
/library/res/drawable-mdpi/vpi__tab_unselected_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/library/res/drawable-mdpi/vpi__tab_unselected_holo.9.png
--------------------------------------------------------------------------------
/library/res/drawable-xhdpi/vpi__tab_selected_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/library/res/drawable-xhdpi/vpi__tab_selected_holo.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-hdpi/perm_group_calendar_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-hdpi/perm_group_calendar_normal.png
--------------------------------------------------------------------------------
/sample/res/drawable-hdpi/perm_group_camera_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-hdpi/perm_group_camera_selected.png
--------------------------------------------------------------------------------
/sample/res/drawable-hdpi/perm_group_location_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-hdpi/perm_group_location_normal.png
--------------------------------------------------------------------------------
/sample/res/drawable-mdpi/perm_group_calendar_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-mdpi/perm_group_calendar_normal.png
--------------------------------------------------------------------------------
/sample/res/drawable-mdpi/perm_group_camera_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-mdpi/perm_group_camera_selected.png
--------------------------------------------------------------------------------
/sample/res/drawable-mdpi/perm_group_location_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-mdpi/perm_group_location_normal.png
--------------------------------------------------------------------------------
/sample/res/drawable-xhdpi/perm_group_calendar_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-xhdpi/perm_group_calendar_normal.png
--------------------------------------------------------------------------------
/sample/res/drawable-xhdpi/perm_group_camera_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-xhdpi/perm_group_camera_selected.png
--------------------------------------------------------------------------------
/sample/res/drawable-xhdpi/perm_group_location_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-xhdpi/perm_group_location_normal.png
--------------------------------------------------------------------------------
/library/res/drawable-xhdpi/vpi__tab_unselected_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/library/res/drawable-xhdpi/vpi__tab_unselected_holo.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-hdpi/custom_tab_indicator_divider.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-hdpi/custom_tab_indicator_divider.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-hdpi/custom_tab_indicator_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-hdpi/custom_tab_indicator_focused.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-hdpi/perm_group_calendar_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-hdpi/perm_group_calendar_selected.png
--------------------------------------------------------------------------------
/sample/res/drawable-hdpi/perm_group_location_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-hdpi/perm_group_location_selected.png
--------------------------------------------------------------------------------
/sample/res/drawable-mdpi/custom_tab_indicator_divider.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-mdpi/custom_tab_indicator_divider.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-mdpi/perm_group_calendar_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-mdpi/perm_group_calendar_selected.png
--------------------------------------------------------------------------------
/sample/res/drawable-mdpi/perm_group_location_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-mdpi/perm_group_location_selected.png
--------------------------------------------------------------------------------
/sample/res/drawable-xhdpi/perm_group_calendar_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-xhdpi/perm_group_calendar_selected.png
--------------------------------------------------------------------------------
/sample/res/drawable-xhdpi/perm_group_location_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-xhdpi/perm_group_location_selected.png
--------------------------------------------------------------------------------
/sample/res/drawable-hdpi/custom_tab_indicator_selected.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-hdpi/custom_tab_indicator_selected.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-hdpi/perm_group_device_alarms_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-hdpi/perm_group_device_alarms_normal.png
--------------------------------------------------------------------------------
/sample/res/drawable-mdpi/custom_tab_indicator_selected.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-mdpi/custom_tab_indicator_selected.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-mdpi/perm_group_device_alarms_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-mdpi/perm_group_device_alarms_normal.png
--------------------------------------------------------------------------------
/sample/res/drawable-xhdpi/custom_tab_indicator_divider.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-xhdpi/custom_tab_indicator_divider.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-xhdpi/custom_tab_indicator_selected.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-xhdpi/custom_tab_indicator_selected.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-xhdpi/perm_group_device_alarms_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-xhdpi/perm_group_device_alarms_normal.png
--------------------------------------------------------------------------------
/library/res/drawable-hdpi/vpi__tab_selected_focused_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/library/res/drawable-hdpi/vpi__tab_selected_focused_holo.9.png
--------------------------------------------------------------------------------
/library/res/drawable-hdpi/vpi__tab_selected_pressed_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/library/res/drawable-hdpi/vpi__tab_selected_pressed_holo.9.png
--------------------------------------------------------------------------------
/library/res/drawable-hdpi/vpi__tab_unselected_focused_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/library/res/drawable-hdpi/vpi__tab_unselected_focused_holo.9.png
--------------------------------------------------------------------------------
/library/res/drawable-hdpi/vpi__tab_unselected_pressed_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/library/res/drawable-hdpi/vpi__tab_unselected_pressed_holo.9.png
--------------------------------------------------------------------------------
/library/res/drawable-mdpi/vpi__tab_selected_focused_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/library/res/drawable-mdpi/vpi__tab_selected_focused_holo.9.png
--------------------------------------------------------------------------------
/library/res/drawable-mdpi/vpi__tab_selected_pressed_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/library/res/drawable-mdpi/vpi__tab_selected_pressed_holo.9.png
--------------------------------------------------------------------------------
/library/res/drawable-mdpi/vpi__tab_unselected_focused_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/library/res/drawable-mdpi/vpi__tab_unselected_focused_holo.9.png
--------------------------------------------------------------------------------
/library/res/drawable-mdpi/vpi__tab_unselected_pressed_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/library/res/drawable-mdpi/vpi__tab_unselected_pressed_holo.9.png
--------------------------------------------------------------------------------
/library/res/drawable-xhdpi/vpi__tab_selected_focused_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/library/res/drawable-xhdpi/vpi__tab_selected_focused_holo.9.png
--------------------------------------------------------------------------------
/library/res/drawable-xhdpi/vpi__tab_selected_pressed_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/library/res/drawable-xhdpi/vpi__tab_selected_pressed_holo.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-hdpi/custom_tab_indicator_unselected.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-hdpi/custom_tab_indicator_unselected.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-hdpi/perm_group_device_alarms_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-hdpi/perm_group_device_alarms_selected.png
--------------------------------------------------------------------------------
/sample/res/drawable-mdpi/custom_tab_indicator_unselected.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-mdpi/custom_tab_indicator_unselected.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-mdpi/perm_group_device_alarms_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-mdpi/perm_group_device_alarms_selected.png
--------------------------------------------------------------------------------
/sample/res/drawable-xhdpi/custom_tab_indicator_unselected.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-xhdpi/custom_tab_indicator_unselected.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-xhdpi/perm_group_device_alarms_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-xhdpi/perm_group_device_alarms_selected.png
--------------------------------------------------------------------------------
/library/res/drawable-xhdpi/vpi__tab_unselected_focused_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/library/res/drawable-xhdpi/vpi__tab_unselected_focused_holo.9.png
--------------------------------------------------------------------------------
/library/res/drawable-xhdpi/vpi__tab_unselected_pressed_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/library/res/drawable-xhdpi/vpi__tab_unselected_pressed_holo.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-hdpi/custom_tab_indicator_selected_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-hdpi/custom_tab_indicator_selected_pressed.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-mdpi/custom_tab_indicator_selected_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-mdpi/custom_tab_indicator_selected_focused.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-mdpi/custom_tab_indicator_selected_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-mdpi/custom_tab_indicator_selected_pressed.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-xhdpi/custom_tab_indicator_selected_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-xhdpi/custom_tab_indicator_selected_focused.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-xhdpi/custom_tab_indicator_selected_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-xhdpi/custom_tab_indicator_selected_pressed.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-hdpi/custom_tab_indicator_unselected_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-hdpi/custom_tab_indicator_unselected_focused.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-hdpi/custom_tab_indicator_unselected_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-hdpi/custom_tab_indicator_unselected_pressed.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-mdpi/custom_tab_indicator_unselected_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-mdpi/custom_tab_indicator_unselected_focused.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-mdpi/custom_tab_indicator_unselected_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-mdpi/custom_tab_indicator_unselected_pressed.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-xhdpi/custom_tab_indicator_unselected_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-xhdpi/custom_tab_indicator_unselected_focused.9.png
--------------------------------------------------------------------------------
/sample/res/drawable-xhdpi/custom_tab_indicator_unselected_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/Android-ViewPagerIndicator/HEAD/sample/res/drawable-xhdpi/custom_tab_indicator_unselected_pressed.9.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #Android generated
2 | bin
3 | gen
4 |
5 | #Eclipse
6 | .project
7 | .classpath
8 | .settings
9 |
10 | #IntelliJ IDEA
11 | .idea
12 | *.iml
13 | classes
14 |
15 | #Maven
16 | target
17 | release.properties
18 | pom.xml.*
19 |
20 | #Command line
21 | local.properties
22 | build.xml
23 | proguard-project.txt
24 |
--------------------------------------------------------------------------------
/library/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/library/src/com/viewpagerindicator/IconPagerAdapter.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator;
2 |
3 | public interface IconPagerAdapter {
4 | /**
5 | * Get icon representing the page at {@code index} in the adapter.
6 | */
7 | int getIconResId(int index);
8 |
9 | // From PagerAdapter
10 | int getCount();
11 | }
12 |
--------------------------------------------------------------------------------
/sample/res/drawable/perm_group_camera.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/sample/res/drawable/perm_group_calendar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/sample/res/drawable/perm_group_location.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/sample/res/menu/menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
--------------------------------------------------------------------------------
/sample/res/drawable/perm_group_device_alarms.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/library/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system use,
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 |
10 | android.library=true
11 | # Project target.
12 | target=android-16
13 |
--------------------------------------------------------------------------------
/sample/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system use,
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 |
10 | # Project target.
11 | target=android-16
12 | android.library.reference.1=../library
13 |
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleLinesDefault.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import com.viewpagerindicator.LinePageIndicator;
6 |
7 | public class SampleLinesDefault extends BaseSampleActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.simple_lines);
12 |
13 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
14 |
15 | mPager = (ViewPager)findViewById(R.id.pager);
16 | mPager.setAdapter(mAdapter);
17 |
18 | mIndicator = (LinePageIndicator)findViewById(R.id.indicator);
19 | mIndicator.setViewPager(mPager);
20 | }
21 | }
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleIconsDefault.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import com.viewpagerindicator.IconPageIndicator;
6 |
7 | public class SampleIconsDefault extends BaseSampleActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.simple_icons);
12 |
13 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
14 |
15 | mPager = (ViewPager)findViewById(R.id.pager);
16 | mPager.setAdapter(mAdapter);
17 |
18 | mIndicator = (IconPageIndicator)findViewById(R.id.indicator);
19 | mIndicator.setViewPager(mPager);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleCirclesDefault.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import com.viewpagerindicator.CirclePageIndicator;
6 |
7 | public class SampleCirclesDefault extends BaseSampleActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.simple_circles);
12 |
13 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
14 |
15 | mPager = (ViewPager)findViewById(R.id.pager);
16 | mPager.setAdapter(mAdapter);
17 |
18 | mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
19 | mIndicator.setViewPager(mPager);
20 | }
21 | }
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleLinesStyledLayout.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import com.viewpagerindicator.LinePageIndicator;
6 |
7 | public class SampleLinesStyledLayout extends BaseSampleActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.themed_lines);
12 |
13 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
14 |
15 | mPager = (ViewPager)findViewById(R.id.pager);
16 | mPager.setAdapter(mAdapter);
17 |
18 | mIndicator = (LinePageIndicator)findViewById(R.id.indicator);
19 | mIndicator.setViewPager(mPager);
20 | }
21 | }
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleTitlesBottom.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import com.viewpagerindicator.TitlePageIndicator;
6 |
7 | public class SampleTitlesBottom extends BaseSampleActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.simple_titles_bottom);
12 |
13 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
14 |
15 | mPager = (ViewPager)findViewById(R.id.pager);
16 | mPager.setAdapter(mAdapter);
17 |
18 | mIndicator = (TitlePageIndicator)findViewById(R.id.indicator);
19 | mIndicator.setViewPager(mPager);
20 | }
21 | }
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleTitlesDefault.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 |
6 | import com.viewpagerindicator.TitlePageIndicator;
7 |
8 | public class SampleTitlesDefault extends BaseSampleActivity {
9 | @Override
10 | protected void onCreate(Bundle savedInstanceState) {
11 | super.onCreate(savedInstanceState);
12 | setContentView(R.layout.simple_titles);
13 |
14 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
15 |
16 | mPager = (ViewPager)findViewById(R.id.pager);
17 | mPager.setAdapter(mAdapter);
18 |
19 | mIndicator = (TitlePageIndicator)findViewById(R.id.indicator);
20 | mIndicator.setViewPager(mPager);
21 | }
22 | }
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleCirclesStyledLayout.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import com.viewpagerindicator.CirclePageIndicator;
6 |
7 | public class SampleCirclesStyledLayout extends BaseSampleActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.themed_circles);
12 |
13 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
14 |
15 | mPager = (ViewPager)findViewById(R.id.pager);
16 | mPager.setAdapter(mAdapter);
17 |
18 | mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
19 | mIndicator.setViewPager(mPager);
20 | }
21 | }
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleTitlesStyledLayout.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 |
6 | import com.viewpagerindicator.TitlePageIndicator;
7 |
8 | public class SampleTitlesStyledLayout extends BaseSampleActivity {
9 | @Override
10 | protected void onCreate(Bundle savedInstanceState) {
11 | super.onCreate(savedInstanceState);
12 | setContentView(R.layout.themed_titles);
13 |
14 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
15 |
16 | mPager = (ViewPager)findViewById(R.id.pager);
17 | mPager.setAdapter(mAdapter);
18 |
19 | mIndicator = (TitlePageIndicator)findViewById(R.id.indicator);
20 | mIndicator.setViewPager(mPager);
21 | }
22 | }
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleUnderlinesDefault.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import com.viewpagerindicator.UnderlinePageIndicator;
6 |
7 | public class SampleUnderlinesDefault extends BaseSampleActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.simple_underlines);
12 |
13 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
14 |
15 | mPager = (ViewPager)findViewById(R.id.pager);
16 | mPager.setAdapter(mAdapter);
17 |
18 | mIndicator = (UnderlinePageIndicator)findViewById(R.id.indicator);
19 | mIndicator.setViewPager(mPager);
20 | }
21 | }
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleUnderlinesStyledLayout.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import com.viewpagerindicator.UnderlinePageIndicator;
6 |
7 | public class SampleUnderlinesStyledLayout extends BaseSampleActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.themed_underlines);
12 |
13 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
14 |
15 | mPager = (ViewPager)findViewById(R.id.pager);
16 | mPager.setAdapter(mAdapter);
17 |
18 | mIndicator = (UnderlinePageIndicator)findViewById(R.id.indicator);
19 | mIndicator.setViewPager(mPager);
20 | }
21 | }
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleLinesStyledTheme.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import com.viewpagerindicator.LinePageIndicator;
6 |
7 | public class SampleLinesStyledTheme extends BaseSampleActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 |
12 | //The look of this sample is set via a style in the manifest
13 | setContentView(R.layout.simple_lines);
14 |
15 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
16 |
17 | mPager = (ViewPager)findViewById(R.id.pager);
18 | mPager.setAdapter(mAdapter);
19 |
20 | mIndicator = (LinePageIndicator)findViewById(R.id.indicator);
21 | mIndicator.setViewPager(mPager);
22 | }
23 | }
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleCirclesSnap.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import com.viewpagerindicator.CirclePageIndicator;
6 |
7 | public class SampleCirclesSnap extends BaseSampleActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.simple_circles);
12 |
13 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
14 |
15 | mPager = (ViewPager)findViewById(R.id.pager);
16 | mPager.setAdapter(mAdapter);
17 |
18 | CirclePageIndicator indicator = (CirclePageIndicator)findViewById(R.id.indicator);
19 | mIndicator = indicator;
20 | indicator.setViewPager(mPager);
21 | indicator.setSnap(true);
22 | }
23 | }
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleCirclesStyledTheme.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import com.viewpagerindicator.CirclePageIndicator;
6 |
7 | public class SampleCirclesStyledTheme extends BaseSampleActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 |
12 | //The look of this sample is set via a style in the manifest
13 | setContentView(R.layout.simple_circles);
14 |
15 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
16 |
17 | mPager = (ViewPager)findViewById(R.id.pager);
18 | mPager.setAdapter(mAdapter);
19 |
20 | mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
21 | mIndicator.setViewPager(mPager);
22 | }
23 | }
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleTitlesStyledTheme.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 |
6 | import com.viewpagerindicator.TitlePageIndicator;
7 |
8 | public class SampleTitlesStyledTheme extends BaseSampleActivity {
9 | @Override
10 | protected void onCreate(Bundle savedInstanceState) {
11 | super.onCreate(savedInstanceState);
12 |
13 | //The look of this sample is set via a style in the manifest
14 | setContentView(R.layout.simple_titles);
15 |
16 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
17 |
18 | mPager = (ViewPager)findViewById(R.id.pager);
19 | mPager.setAdapter(mAdapter);
20 |
21 | mIndicator = (TitlePageIndicator)findViewById(R.id.indicator);
22 | mIndicator.setViewPager(mPager);
23 | }
24 | }
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleUnderlinesStyledTheme.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import com.viewpagerindicator.UnderlinePageIndicator;
6 |
7 | public class SampleUnderlinesStyledTheme extends BaseSampleActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 |
12 | //The look of this sample is set via a style in the manifest
13 | setContentView(R.layout.simple_underlines);
14 |
15 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
16 |
17 | mPager = (ViewPager)findViewById(R.id.pager);
18 | mPager.setAdapter(mAdapter);
19 |
20 | mIndicator = (UnderlinePageIndicator)findViewById(R.id.indicator);
21 | mIndicator.setViewPager(mPager);
22 | }
23 | }
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleUnderlinesNoFade.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import com.viewpagerindicator.UnderlinePageIndicator;
6 |
7 | public class SampleUnderlinesNoFade extends BaseSampleActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.simple_underlines);
12 |
13 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
14 |
15 | mPager = (ViewPager)findViewById(R.id.pager);
16 | mPager.setAdapter(mAdapter);
17 |
18 | UnderlinePageIndicator indicator = (UnderlinePageIndicator)findViewById(R.id.indicator);
19 | indicator.setViewPager(mPager);
20 | indicator.setFades(false);
21 | mIndicator = indicator;
22 | }
23 | }
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleCirclesInitialPage.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import com.viewpagerindicator.CirclePageIndicator;
6 |
7 | public class SampleCirclesInitialPage extends BaseSampleActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.simple_circles);
12 |
13 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
14 |
15 | mPager = (ViewPager)findViewById(R.id.pager);
16 | mPager.setAdapter(mAdapter);
17 |
18 | mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
19 | mIndicator.setViewPager(mPager);
20 | mIndicator.setCurrentItem(mAdapter.getCount() - 1);
21 |
22 | //You can also do: indicator.setViewPager(pager, initialPage);
23 | }
24 | }
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleTitlesInitialPage.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 |
6 | import com.viewpagerindicator.TitlePageIndicator;
7 |
8 | public class SampleTitlesInitialPage extends BaseSampleActivity {
9 | @Override
10 | protected void onCreate(Bundle savedInstanceState) {
11 | super.onCreate(savedInstanceState);
12 | setContentView(R.layout.simple_titles);
13 |
14 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
15 |
16 | mPager = (ViewPager)findViewById(R.id.pager);
17 | mPager.setAdapter(mAdapter);
18 |
19 | mIndicator = (TitlePageIndicator)findViewById(R.id.indicator);
20 | mIndicator.setViewPager(mPager);
21 | mIndicator.setCurrentItem(mAdapter.getCount() - 1);
22 |
23 | //You can also do: indicator.setViewPager(pager, initialPage);
24 | }
25 | }
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleTitlesTriangle.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 |
6 | import com.viewpagerindicator.TitlePageIndicator;
7 | import com.viewpagerindicator.TitlePageIndicator.IndicatorStyle;
8 |
9 | public class SampleTitlesTriangle extends BaseSampleActivity {
10 | @Override
11 | protected void onCreate(Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | setContentView(R.layout.simple_titles);
14 |
15 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
16 |
17 | mPager = (ViewPager)findViewById(R.id.pager);
18 | mPager.setAdapter(mAdapter);
19 |
20 | TitlePageIndicator indicator = (TitlePageIndicator)findViewById(R.id.indicator);
21 | indicator.setViewPager(mPager);
22 | indicator.setFooterIndicatorStyle(IndicatorStyle.Triangle);
23 | mIndicator = indicator;
24 | }
25 | }
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleUnderlinesStyledMethods.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import com.viewpagerindicator.UnderlinePageIndicator;
6 |
7 | public class SampleUnderlinesStyledMethods extends BaseSampleActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.simple_underlines);
12 |
13 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
14 |
15 | mPager = (ViewPager)findViewById(R.id.pager);
16 | mPager.setAdapter(mAdapter);
17 |
18 | UnderlinePageIndicator indicator = (UnderlinePageIndicator)findViewById(R.id.indicator);
19 | mIndicator = indicator;
20 | indicator.setViewPager(mPager);
21 | indicator.setSelectedColor(0xFFCC0000);
22 | indicator.setBackgroundColor(0xFFCCCCCC);
23 | indicator.setFadeDelay(1000);
24 | indicator.setFadeLength(1000);
25 | }
26 | }
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleLinesStyledMethods.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import com.viewpagerindicator.LinePageIndicator;
6 |
7 | public class SampleLinesStyledMethods extends BaseSampleActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.simple_lines);
12 |
13 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
14 |
15 | mPager = (ViewPager)findViewById(R.id.pager);
16 | mPager.setAdapter(mAdapter);
17 |
18 | LinePageIndicator indicator = (LinePageIndicator)findViewById(R.id.indicator);
19 | mIndicator = indicator;
20 | indicator.setViewPager(mPager);
21 |
22 | final float density = getResources().getDisplayMetrics().density;
23 | indicator.setSelectedColor(0x88FF0000);
24 | indicator.setUnselectedColor(0xFF888888);
25 | indicator.setStrokeWidth(4 * density);
26 | indicator.setLineWidth(30 * density);
27 | }
28 | }
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleCirclesStyledMethods.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import com.viewpagerindicator.CirclePageIndicator;
6 |
7 | public class SampleCirclesStyledMethods extends BaseSampleActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.simple_circles);
12 |
13 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
14 |
15 | mPager = (ViewPager)findViewById(R.id.pager);
16 | mPager.setAdapter(mAdapter);
17 |
18 | CirclePageIndicator indicator = (CirclePageIndicator)findViewById(R.id.indicator);
19 | mIndicator = indicator;
20 | indicator.setViewPager(mPager);
21 |
22 | final float density = getResources().getDisplayMetrics().density;
23 | indicator.setBackgroundColor(0xFFCCCCCC);
24 | indicator.setRadius(10 * density);
25 | indicator.setPageColor(0x880000FF);
26 | indicator.setFillColor(0xFF888888);
27 | indicator.setStrokeColor(0xFF000000);
28 | indicator.setStrokeWidth(2 * density);
29 | }
30 | }
--------------------------------------------------------------------------------
/sample/res/layout/simple_underlines.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
22 |
23 |
29 |
34 |
--------------------------------------------------------------------------------
/sample/res/layout/simple_icons.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
22 |
23 |
29 |
34 |
35 |
--------------------------------------------------------------------------------
/sample/res/layout/simple_tabs.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
22 |
23 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleTitlesCenterClickListener.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import android.widget.Toast;
6 |
7 | import com.viewpagerindicator.TitlePageIndicator;
8 | import com.viewpagerindicator.TitlePageIndicator.IndicatorStyle;
9 | import com.viewpagerindicator.TitlePageIndicator.OnCenterItemClickListener;
10 |
11 | public class SampleTitlesCenterClickListener extends BaseSampleActivity implements OnCenterItemClickListener {
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.simple_titles);
16 |
17 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
18 |
19 | mPager = (ViewPager)findViewById(R.id.pager);
20 | mPager.setAdapter(mAdapter);
21 |
22 | TitlePageIndicator indicator = (TitlePageIndicator)findViewById(R.id.indicator);
23 | indicator.setViewPager(mPager);
24 | indicator.setFooterIndicatorStyle(IndicatorStyle.Underline);
25 | indicator.setOnCenterItemClickListener(this);
26 | mIndicator = indicator;
27 | }
28 |
29 | @Override
30 | public void onCenterItemClick(int position) {
31 | Toast.makeText(this, "You clicked the center title!", Toast.LENGTH_SHORT).show();
32 | }
33 | }
--------------------------------------------------------------------------------
/sample/res/layout/simple_lines.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
22 |
23 |
29 |
35 |
--------------------------------------------------------------------------------
/sample/res/layout/simple_circles.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
22 |
23 |
29 |
35 |
--------------------------------------------------------------------------------
/sample/res/layout/simple_titles.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
22 |
23 |
29 |
35 |
36 |
--------------------------------------------------------------------------------
/sample/res/layout/simple_circles_vertical.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
22 |
23 |
29 |
35 |
--------------------------------------------------------------------------------
/library/res/color/vpi__dark_theme.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleTitlesStyledMethods.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 |
6 | import com.viewpagerindicator.TitlePageIndicator;
7 | import com.viewpagerindicator.TitlePageIndicator.IndicatorStyle;
8 |
9 | public class SampleTitlesStyledMethods extends BaseSampleActivity {
10 | @Override
11 | protected void onCreate(Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | setContentView(R.layout.simple_titles);
14 |
15 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
16 |
17 | mPager = (ViewPager)findViewById(R.id.pager);
18 | mPager.setAdapter(mAdapter);
19 |
20 | TitlePageIndicator indicator = (TitlePageIndicator)findViewById(R.id.indicator);
21 | mIndicator = indicator;
22 | indicator.setViewPager(mPager);
23 |
24 | final float density = getResources().getDisplayMetrics().density;
25 | indicator.setBackgroundColor(0x18FF0000);
26 | indicator.setFooterColor(0xFFAA2222);
27 | indicator.setFooterLineHeight(1 * density); //1dp
28 | indicator.setFooterIndicatorHeight(3 * density); //3dp
29 | indicator.setFooterIndicatorStyle(IndicatorStyle.Underline);
30 | indicator.setTextColor(0xAA000000);
31 | indicator.setSelectedColor(0xFF000000);
32 | indicator.setSelectedBold(true);
33 | }
34 | }
--------------------------------------------------------------------------------
/library/res/values/vpi__colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 | #ff000000
19 | #fff3f3f3
20 | @color/vpi__background_holo_light
21 | @color/vpi__background_holo_dark
22 | #ff4c4c4c
23 | #ffb2b2b2
24 | @color/vpi__bright_foreground_holo_light
25 | @color/vpi__bright_foreground_holo_dark
26 |
27 |
--------------------------------------------------------------------------------
/library/res/color/vpi__light_theme.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleCirclesWithListener.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import android.widget.Toast;
6 | import com.viewpagerindicator.CirclePageIndicator;
7 |
8 | public class SampleCirclesWithListener extends BaseSampleActivity {
9 | @Override
10 | protected void onCreate(Bundle savedInstanceState) {
11 | super.onCreate(savedInstanceState);
12 | setContentView(R.layout.simple_circles);
13 |
14 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
15 |
16 | mPager = (ViewPager)findViewById(R.id.pager);
17 | mPager.setAdapter(mAdapter);
18 |
19 | mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
20 | mIndicator.setViewPager(mPager);
21 |
22 | //We set this on the indicator, NOT the pager
23 | mIndicator.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
24 | @Override
25 | public void onPageSelected(int position) {
26 | Toast.makeText(SampleCirclesWithListener.this, "Changed to page " + position, Toast.LENGTH_SHORT).show();
27 | }
28 |
29 | @Override
30 | public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
31 | }
32 |
33 | @Override
34 | public void onPageScrollStateChanged(int state) {
35 | }
36 | });
37 | }
38 | }
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleTitlesWithListener.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import android.widget.Toast;
6 |
7 | import com.viewpagerindicator.TitlePageIndicator;
8 |
9 | public class SampleTitlesWithListener extends BaseSampleActivity {
10 | @Override
11 | protected void onCreate(Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | setContentView(R.layout.simple_titles);
14 |
15 | mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
16 |
17 | mPager = (ViewPager)findViewById(R.id.pager);
18 | mPager.setAdapter(mAdapter);
19 |
20 | mIndicator = (TitlePageIndicator)findViewById(R.id.indicator);
21 | mIndicator.setViewPager(mPager);
22 |
23 | //We set this on the indicator, NOT the pager
24 | mIndicator.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
25 | @Override
26 | public void onPageSelected(int position) {
27 | Toast.makeText(SampleTitlesWithListener.this, "Changed to page " + position, Toast.LENGTH_SHORT).show();
28 | }
29 |
30 | @Override
31 | public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
32 | }
33 |
34 | @Override
35 | public void onPageScrollStateChanged(int state) {
36 | }
37 | });
38 | }
39 | }
--------------------------------------------------------------------------------
/sample/res/layout/simple_titles_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
23 |
24 |
30 |
37 |
38 |
--------------------------------------------------------------------------------
/sample/res/layout/themed_underlines.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
23 |
24 |
30 |
39 |
40 |
--------------------------------------------------------------------------------
/sample/res/layout/themed_lines.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
23 |
24 |
30 |
40 |
41 |
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/TestFragmentAdapter.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.support.v4.app.Fragment;
4 | import android.support.v4.app.FragmentManager;
5 | import android.support.v4.app.FragmentPagerAdapter;
6 | import com.viewpagerindicator.IconPagerAdapter;
7 |
8 | class TestFragmentAdapter extends FragmentPagerAdapter implements IconPagerAdapter {
9 | protected static final String[] CONTENT = new String[] { "This", "Is", "A", "Test", };
10 | protected static final int[] ICONS = new int[] {
11 | R.drawable.perm_group_calendar,
12 | R.drawable.perm_group_camera,
13 | R.drawable.perm_group_device_alarms,
14 | R.drawable.perm_group_location
15 | };
16 |
17 | private int mCount = CONTENT.length;
18 |
19 | public TestFragmentAdapter(FragmentManager fm) {
20 | super(fm);
21 | }
22 |
23 | @Override
24 | public Fragment getItem(int position) {
25 | return TestFragment.newInstance(CONTENT[position % CONTENT.length]);
26 | }
27 |
28 | @Override
29 | public int getCount() {
30 | return mCount;
31 | }
32 |
33 | @Override
34 | public CharSequence getPageTitle(int position) {
35 | return TestFragmentAdapter.CONTENT[position % CONTENT.length];
36 | }
37 |
38 | @Override
39 | public int getIconResId(int index) {
40 | return ICONS[index % ICONS.length];
41 | }
42 |
43 | public void setCount(int count) {
44 | if (count > 0 && count <= 10) {
45 | mCount = count;
46 | notifyDataSetChanged();
47 | }
48 | }
49 | }
--------------------------------------------------------------------------------
/sample/res/layout/themed_circles.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
23 |
24 |
30 |
42 |
43 |
--------------------------------------------------------------------------------
/library/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 4.0.0
5 |
6 | library
7 | Android-ViewPagerIndicator
8 | apklib
9 |
10 |
11 | com.viewpagerindicator
12 | parent
13 | 2.4.1
14 | ../pom.xml
15 |
16 |
17 |
18 |
19 | com.google.android
20 | android
21 | provided
22 |
23 |
24 |
25 | com.google.android
26 | support-v4
27 |
28 |
29 |
30 |
31 | src
32 |
33 |
34 |
35 | com.jayway.maven.plugins.android.generation2
36 | android-maven-plugin
37 | true
38 |
39 |
40 |
41 | org.apache.maven.plugins
42 | maven-checkstyle-plugin
43 |
44 | ../checkstyle.xml
45 |
46 |
47 |
48 | verify
49 |
50 | checkstyle
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleTabsDefault.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.support.v4.app.FragmentActivity;
6 | import android.support.v4.app.FragmentManager;
7 | import android.support.v4.app.FragmentPagerAdapter;
8 | import android.support.v4.view.ViewPager;
9 | import com.viewpagerindicator.TabPageIndicator;
10 |
11 | public class SampleTabsDefault extends FragmentActivity {
12 | private static final String[] CONTENT = new String[] { "Recent", "Artists", "Albums", "Songs", "Playlists", "Genres" };
13 |
14 | @Override
15 | protected void onCreate(Bundle savedInstanceState) {
16 | super.onCreate(savedInstanceState);
17 | setContentView(R.layout.simple_tabs);
18 |
19 | FragmentPagerAdapter adapter = new GoogleMusicAdapter(getSupportFragmentManager());
20 |
21 | ViewPager pager = (ViewPager)findViewById(R.id.pager);
22 | pager.setAdapter(adapter);
23 |
24 | TabPageIndicator indicator = (TabPageIndicator)findViewById(R.id.indicator);
25 | indicator.setViewPager(pager);
26 | }
27 |
28 | class GoogleMusicAdapter extends FragmentPagerAdapter {
29 | public GoogleMusicAdapter(FragmentManager fm) {
30 | super(fm);
31 | }
32 |
33 | @Override
34 | public Fragment getItem(int position) {
35 | return TestFragment.newInstance(CONTENT[position % CONTENT.length]);
36 | }
37 |
38 | @Override
39 | public CharSequence getPageTitle(int position) {
40 | return CONTENT[position % CONTENT.length].toUpperCase();
41 | }
42 |
43 | @Override
44 | public int getCount() {
45 | return CONTENT.length;
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleTabsStyled.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.support.v4.app.FragmentActivity;
6 | import android.support.v4.app.FragmentManager;
7 | import android.support.v4.app.FragmentPagerAdapter;
8 | import android.support.v4.view.ViewPager;
9 | import com.viewpagerindicator.TabPageIndicator;
10 |
11 | public class SampleTabsStyled extends FragmentActivity {
12 | private static final String[] CONTENT = new String[] { "Recent", "Artists", "Albums", "Songs", "Playlists", "Genres" };
13 |
14 | @Override
15 | protected void onCreate(Bundle savedInstanceState) {
16 | super.onCreate(savedInstanceState);
17 | setContentView(R.layout.simple_tabs);
18 |
19 | FragmentPagerAdapter adapter = new GoogleMusicAdapter(getSupportFragmentManager());
20 |
21 | ViewPager pager = (ViewPager)findViewById(R.id.pager);
22 | pager.setAdapter(adapter);
23 |
24 | TabPageIndicator indicator = (TabPageIndicator)findViewById(R.id.indicator);
25 | indicator.setViewPager(pager);
26 | }
27 |
28 | class GoogleMusicAdapter extends FragmentPagerAdapter {
29 | public GoogleMusicAdapter(FragmentManager fm) {
30 | super(fm);
31 | }
32 |
33 | @Override
34 | public Fragment getItem(int position) {
35 | return TestFragment.newInstance(CONTENT[position % CONTENT.length]);
36 | }
37 |
38 | @Override
39 | public CharSequence getPageTitle(int position) {
40 | return CONTENT[position % CONTENT.length].toUpperCase();
41 | }
42 |
43 | @Override
44 | public int getCount() {
45 | return CONTENT.length;
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/sample/res/layout/themed_titles.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
23 |
24 |
38 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/BaseSampleActivity.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import java.util.Random;
4 |
5 | import com.viewpagerindicator.PageIndicator;
6 |
7 | import android.support.v4.app.FragmentActivity;
8 | import android.support.v4.view.ViewPager;
9 | import android.view.Menu;
10 | import android.view.MenuItem;
11 | import android.widget.Toast;
12 |
13 | public abstract class BaseSampleActivity extends FragmentActivity {
14 | private static final Random RANDOM = new Random();
15 |
16 | TestFragmentAdapter mAdapter;
17 | ViewPager mPager;
18 | PageIndicator mIndicator;
19 |
20 | @Override
21 | public boolean onCreateOptionsMenu(Menu menu) {
22 | getMenuInflater().inflate(R.menu.menu, menu);
23 | return true;
24 | }
25 |
26 | @Override
27 | public boolean onOptionsItemSelected(MenuItem item) {
28 | switch (item.getItemId()) {
29 | case R.id.random:
30 | final int page = RANDOM.nextInt(mAdapter.getCount());
31 | Toast.makeText(this, "Changing to page " + page, Toast.LENGTH_SHORT);
32 | mPager.setCurrentItem(page);
33 | return true;
34 |
35 | case R.id.add_page:
36 | if (mAdapter.getCount() < 10) {
37 | mAdapter.setCount(mAdapter.getCount() + 1);
38 | mIndicator.notifyDataSetChanged();
39 | }
40 | return true;
41 |
42 | case R.id.remove_page:
43 | if (mAdapter.getCount() > 1) {
44 | mAdapter.setCount(mAdapter.getCount() - 1);
45 | mIndicator.notifyDataSetChanged();
46 | }
47 | return true;
48 | }
49 | return super.onOptionsItemSelected(item);
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/library/src/com/viewpagerindicator/PageIndicator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 Patrik Akerfeldt
3 | * Copyright (C) 2011 Jake Wharton
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package com.viewpagerindicator;
19 |
20 | import android.support.v4.view.ViewPager;
21 |
22 | /**
23 | * A PageIndicator is responsible to show an visual indicator on the total views
24 | * number and the current visible view.
25 | */
26 | public interface PageIndicator extends ViewPager.OnPageChangeListener {
27 | /**
28 | * Bind the indicator to a ViewPager.
29 | *
30 | * @param view
31 | */
32 | void setViewPager(ViewPager view);
33 |
34 | /**
35 | * Bind the indicator to a ViewPager.
36 | *
37 | * @param view
38 | * @param initialPosition
39 | */
40 | void setViewPager(ViewPager view, int initialPosition);
41 |
42 | /**
43 | * Set the current page of both the ViewPager and indicator.
44 | *
45 | * This must be used if you need to set the page before
46 | * the views are drawn on screen (e.g., default start page).
47 | *
48 | * @param item
49 | */
50 | void setCurrentItem(int item);
51 |
52 | /**
53 | * Set a page change listener which will receive forwarded events.
54 | *
55 | * @param listener
56 | */
57 | void setOnPageChangeListener(ViewPager.OnPageChangeListener listener);
58 |
59 | /**
60 | * Notify the indicator that the fragment list has changed.
61 | */
62 | void notifyDataSetChanged();
63 | }
64 |
--------------------------------------------------------------------------------
/library/res/values/vpi__styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
22 |
23 |
25 |
26 |
37 |
38 |
42 |
43 |
47 |
48 |
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/SampleTabsWithIcons.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.support.v4.app.FragmentActivity;
6 | import android.support.v4.app.FragmentManager;
7 | import android.support.v4.app.FragmentPagerAdapter;
8 | import android.support.v4.view.ViewPager;
9 | import com.viewpagerindicator.IconPagerAdapter;
10 | import com.viewpagerindicator.TabPageIndicator;
11 |
12 | public class SampleTabsWithIcons extends FragmentActivity {
13 | private static final String[] CONTENT = new String[] { "Calendar", "Camera", "Alarms", "Location" };
14 | private static final int[] ICONS = new int[] {
15 | R.drawable.perm_group_calendar,
16 | R.drawable.perm_group_camera,
17 | R.drawable.perm_group_device_alarms,
18 | R.drawable.perm_group_location,
19 | };
20 |
21 | @Override
22 | protected void onCreate(Bundle savedInstanceState) {
23 | super.onCreate(savedInstanceState);
24 | setContentView(R.layout.simple_tabs);
25 |
26 | FragmentPagerAdapter adapter = new GoogleMusicAdapter(getSupportFragmentManager());
27 |
28 | ViewPager pager = (ViewPager)findViewById(R.id.pager);
29 | pager.setAdapter(adapter);
30 |
31 | TabPageIndicator indicator = (TabPageIndicator)findViewById(R.id.indicator);
32 | indicator.setViewPager(pager);
33 | }
34 |
35 | class GoogleMusicAdapter extends FragmentPagerAdapter implements IconPagerAdapter {
36 | public GoogleMusicAdapter(FragmentManager fm) {
37 | super(fm);
38 | }
39 |
40 | @Override
41 | public Fragment getItem(int position) {
42 | return TestFragment.newInstance(CONTENT[position % CONTENT.length]);
43 | }
44 |
45 | @Override
46 | public CharSequence getPageTitle(int position) {
47 | return CONTENT[position % CONTENT.length].toUpperCase();
48 | }
49 |
50 | @Override public int getIconResId(int index) {
51 | return ICONS[index];
52 | }
53 |
54 | @Override
55 | public int getCount() {
56 | return CONTENT.length;
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/library/res/drawable/vpi__tab_indicator.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/TestFragment.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.view.Gravity;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.LinearLayout;
10 | import android.widget.LinearLayout.LayoutParams;
11 | import android.widget.TextView;
12 |
13 | public final class TestFragment extends Fragment {
14 | private static final String KEY_CONTENT = "TestFragment:Content";
15 |
16 | public static TestFragment newInstance(String content) {
17 | TestFragment fragment = new TestFragment();
18 |
19 | StringBuilder builder = new StringBuilder();
20 | for (int i = 0; i < 20; i++) {
21 | builder.append(content).append(" ");
22 | }
23 | builder.deleteCharAt(builder.length() - 1);
24 | fragment.mContent = builder.toString();
25 |
26 | return fragment;
27 | }
28 |
29 | private String mContent = "???";
30 |
31 | @Override
32 | public void onCreate(Bundle savedInstanceState) {
33 | super.onCreate(savedInstanceState);
34 |
35 | if ((savedInstanceState != null) && savedInstanceState.containsKey(KEY_CONTENT)) {
36 | mContent = savedInstanceState.getString(KEY_CONTENT);
37 | }
38 | }
39 |
40 | @Override
41 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
42 | TextView text = new TextView(getActivity());
43 | text.setGravity(Gravity.CENTER);
44 | text.setText(mContent);
45 | text.setTextSize(20 * getResources().getDisplayMetrics().density);
46 | text.setPadding(20, 20, 20, 20);
47 |
48 | LinearLayout layout = new LinearLayout(getActivity());
49 | layout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
50 | layout.setGravity(Gravity.CENTER);
51 | layout.addView(text);
52 |
53 | return layout;
54 | }
55 |
56 | @Override
57 | public void onSaveInstanceState(Bundle outState) {
58 | super.onSaveInstanceState(outState);
59 | outState.putString(KEY_CONTENT, mContent);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/sample/res/drawable/custom_tab_indicator.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/library/res/values/vpi__defaults.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 | true
19 | #FFFFFFFF
20 | #00000000
21 | 0
22 | 3dp
23 | false
24 | #FFDDDDDD
25 | 1dp
26 |
27 | 12dp
28 | 4dp
29 | 1dp
30 | #FF33B5E5
31 | #FFBBBBBB
32 | true
33 |
34 | 4dp
35 | #FF33B5E5
36 | 2dp
37 | 2
38 | 4dp
39 | 20dp
40 | 7dp
41 | 0
42 | #FFFFFFFF
43 | true
44 | #BBFFFFFF
45 | 15dp
46 | 5dp
47 | 7dp
48 |
49 | true
50 | 300
51 | 400
52 | #FF33B5E5
53 |
--------------------------------------------------------------------------------
/sample/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 4.0.0
5 |
6 | sample
7 | Android-ViewPagerIndicator Sample
8 | apk
9 |
10 |
11 | com.viewpagerindicator
12 | parent
13 | 2.4.1
14 | ../pom.xml
15 |
16 |
17 |
18 |
19 | com.google.android
20 | android
21 | provided
22 |
23 |
24 |
25 | com.google.android
26 | support-v4
27 |
28 |
29 |
30 | com.viewpagerindicator
31 | library
32 | ${project.version}
33 | apklib
34 |
35 |
36 |
37 |
38 | src
39 | ${project.artifactId}-unaligned
40 |
41 |
42 |
43 | com.jayway.maven.plugins.android.generation2
44 | android-maven-plugin
45 | true
46 |
47 |
48 |
49 | org.apache.maven.plugins
50 | maven-checkstyle-plugin
51 |
52 | ../checkstyle.xml
53 |
54 |
55 |
56 | verify
57 |
58 | checkstyle
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 | release
69 |
70 |
71 | performRelease
72 | true
73 |
74 |
75 |
76 |
77 |
78 | com.jayway.maven.plugins.android.generation2
79 | android-maven-plugin
80 | ${android-maven.version}
81 | true
82 |
83 |
84 | ${project.build.directory}/${project.build.finalName}.apk
85 | ${project.build.directory}/${project.artifactId}.apk
86 |
87 |
88 |
89 |
90 | alignApk
91 | package
92 |
93 | zipalign
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/sample/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
25 |
26 |
36 |
37 |
43 |
44 |
51 |
52 |
65 |
66 |
69 |
70 |
76 |
77 |
--------------------------------------------------------------------------------
/checkstyle.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Android ViewPagerIndicator
2 | ==========================
3 |
4 | Paging indicator widgets that are compatible with the `ViewPager` from the
5 | [Android Support Library][2] to improve discoverability of content.
6 |
7 | Try out the sample application [on the Android Market][10].
8 |
9 | ![ViewPagerIndicator Sample Screenshots][9]
10 |
11 | These widgets can also be used in conjunction with [ActionBarSherlock][3]!
12 |
13 |
14 |
15 | Usage
16 | =====
17 |
18 | *For a working implementation of this project see the `sample/` folder.*
19 |
20 | 1. Include one of the widgets in your view. This should usually be placed
21 | adjacent to the `ViewPager` it represents.
22 |
23 |
27 |
28 | 2. In your `onCreate` method (or `onCreateView` for a fragment), bind the
29 | indicator to the `ViewPager`.
30 |
31 | //Set the pager with an adapter
32 | ViewPager pager = (ViewPager)findViewById(R.id.pager);
33 | pager.setAdapter(new TestAdapter(getSupportFragmentManager()));
34 |
35 | //Bind the title indicator to the adapter
36 | TitlePageIndicator titleIndicator = (TitlePageIndicator)findViewById(R.id.titles);
37 | titleIndicator.setViewPager(pager);
38 |
39 | 3. *(Optional)* If you use an `OnPageChangeListener` with your view pager
40 | you should set it in the indicator rather than on the pager directly.
41 |
42 | //continued from above
43 | titleIndicator.setOnPageChangeListener(mPageChangeListener);
44 |
45 |
46 | Theming
47 | -------
48 |
49 | There are three ways to style the look of the indicators.
50 |
51 | 1. **Theme XML**. An attribute for each type of indicator is provided in which
52 | you can specify a custom style.
53 | 2. **Layout XML**. Through the use of a custom namespace you can include any
54 | desired styles.
55 | 3. **Object methods**. Both styles have getters and setters for each style
56 | attribute which can be changed at any point.
57 |
58 | Each indicator has a demo which creates the same look using each of these
59 | methods.
60 |
61 |
62 | Including In Your Project
63 | -------------------------
64 |
65 | Android-ViewPagerIndicator is presented as an [Android library project][7]. A
66 | standalone JAR is not possible due to the theming capabilities offered by the
67 | indicator widgets.
68 |
69 | You can include this project by [referencing it as a library project][8] in
70 | Eclipse or ant.
71 |
72 | If you are a Maven user you can easily include the library by specifying it as
73 | a dependency:
74 |
75 |
76 | com.viewpagerindicator
77 | library
78 | 2.4.1
79 | apklib
80 |
81 |
82 | This project depends on the `ViewPager` class which is available in the
83 | [Android Support Library][2] or [ActionBarSherlock][3]. Details for
84 | including one of those libraries is available on their respecitve web sites.
85 |
86 |
87 |
88 |
89 | Developed By
90 | ============
91 |
92 | * Jake Wharton -
93 |
94 |
95 | Credits
96 | -------
97 |
98 | * [Patrik Åkerfeldt][1] - Author of [ViewFlow][4], a precursor to the ViewPager,
99 | which supports paged views and is the original source of both the title
100 | and circle indicators.
101 | * [Francisco Figueiredo Jr.][5] - Idea and [first implementation][6] for
102 | fragment support via ViewPager.
103 |
104 |
105 |
106 |
107 | License
108 | =======
109 |
110 | Copyright 2012 Jake Wharton
111 | Copyright 2011 Patrik Åkerfeldt
112 | Copyright 2011 Francisco Figueiredo Jr.
113 |
114 | Licensed under the Apache License, Version 2.0 (the "License");
115 | you may not use this file except in compliance with the License.
116 | You may obtain a copy of the License at
117 |
118 | http://www.apache.org/licenses/LICENSE-2.0
119 |
120 | Unless required by applicable law or agreed to in writing, software
121 | distributed under the License is distributed on an "AS IS" BASIS,
122 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
123 | See the License for the specific language governing permissions and
124 | limitations under the License.
125 |
126 |
127 |
128 |
129 |
130 |
131 | [1]: https://github.com/pakerfeldt
132 | [2]: http://developer.android.com/sdk/compatibility-library.html
133 | [3]: http://actionbarsherlock.com
134 | [4]: https://github.com/pakerfeldt/android-viewflow
135 | [5]: https://github.com/franciscojunior
136 | [6]: https://gist.github.com/1122947
137 | [7]: http://developer.android.com/guide/developing/projects/projects-eclipse.html
138 | [8]: http://developer.android.com/guide/developing/projects/projects-eclipse.html#ReferencingLibraryProject
139 | [9]: https://raw.github.com/JakeWharton/Android-ViewPagerIndicator/master/sample/screens.png
140 | [10]: https://play.google.com/store/apps/details?id=com.viewpagerindicator.sample
141 |
--------------------------------------------------------------------------------
/sample/src/com/viewpagerindicator/sample/ListSamples.java:
--------------------------------------------------------------------------------
1 | package com.viewpagerindicator.sample;
2 |
3 | import java.text.Collator;
4 | import java.util.ArrayList;
5 | import java.util.Collections;
6 | import java.util.Comparator;
7 | import java.util.HashMap;
8 | import java.util.List;
9 | import java.util.Map;
10 | import android.app.ListActivity;
11 | import android.content.Intent;
12 | import android.content.pm.PackageManager;
13 | import android.content.pm.ResolveInfo;
14 | import android.os.Bundle;
15 | import android.view.View;
16 | import android.widget.ListView;
17 | import android.widget.SimpleAdapter;
18 |
19 | public class ListSamples extends ListActivity {
20 |
21 | @Override
22 | public void onCreate(Bundle savedInstanceState) {
23 | super.onCreate(savedInstanceState);
24 |
25 | Intent intent = getIntent();
26 | String path = intent.getStringExtra("com.jakewharton.android.viewpagerindicator.sample.Path");
27 |
28 | if (path == null) {
29 | path = "";
30 | }
31 |
32 | setListAdapter(new SimpleAdapter(this, getData(path),
33 | android.R.layout.simple_list_item_1, new String[] { "title" },
34 | new int[] { android.R.id.text1 }));
35 | getListView().setTextFilterEnabled(true);
36 | }
37 |
38 | protected List