diff options
author | Tony Wickham <twickham@google.com> | 2016-05-16 09:54:06 -0700 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2016-05-17 18:53:57 -0700 |
commit | f549dab31d0fa3e4d0cf8d6025b20e49aafb2d59 (patch) | |
tree | a10ccc74b4d0ad6f353a0a6853950335156c748b /src/com/android/launcher3/pageindicators/PageIndicator.java | |
parent | 192ae6ca71b0a1401ad44020b631c634a348597e (diff) | |
download | android_packages_apps_Trebuchet-f549dab31d0fa3e4d0cf8d6025b20e49aafb2d59.tar.gz android_packages_apps_Trebuchet-f549dab31d0fa3e4d0cf8d6025b20e49aafb2d59.tar.bz2 android_packages_apps_Trebuchet-f549dab31d0fa3e4d0cf8d6025b20e49aafb2d59.zip |
Add PageIndicator interface and custom PageIndicatorLine view.
- The current PageIndicator has been renamed to PageIndicatorDots
and PageIndicatorMarker has been renamed to PageIndicatorDot.
- PageIndicatorDots and PageIndicatorLine implement PageIndicator.
- PageIndicatorLine uses scroll progress and number of pages to
draw a line of the correct size and position.
- All of these page indicator files are now in a pageindicators package.
Bug: 27227498
Change-Id: I9230d2e0600ce583989bd31d0b0e252b148d15c2
Diffstat (limited to 'src/com/android/launcher3/pageindicators/PageIndicator.java')
-rw-r--r-- | src/com/android/launcher3/pageindicators/PageIndicator.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/com/android/launcher3/pageindicators/PageIndicator.java b/src/com/android/launcher3/pageindicators/PageIndicator.java new file mode 100644 index 000000000..6348b123b --- /dev/null +++ b/src/com/android/launcher3/pageindicators/PageIndicator.java @@ -0,0 +1,31 @@ +package com.android.launcher3.pageindicators; + +import android.view.View; + +import java.util.ArrayList; + +public interface PageIndicator { + View getView(); + void setProgress(float progress); + + void removeAllMarkers(boolean allowAnimations); + void addMarkers(ArrayList<PageMarkerResources> markers, boolean allowAnimations); + void setActiveMarker(int activePage); + void addMarker(int pageIndex, PageMarkerResources pageIndicatorMarker, boolean allowAnimations); + void removeMarker(int pageIndex, boolean allowAnimations); + void updateMarker(int pageIndex, PageMarkerResources pageIndicatorMarker); + + /** + * Contains two resource ids for each page indicator marker (e.g. dots): + * one for when the page is active and one for when the page is inactive. + */ + class PageMarkerResources { + int activeId; + int inactiveId; + + public PageMarkerResources(int aId, int iaId) { + activeId = aId; + inactiveId = iaId; + } + } +} |