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
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index 53522fb..e3b959b 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -798,7 +798,14 @@
* If value is less than lowerBound, return lowerBound; else if value is greater than upperBound,
* return upperBound; else return value unchanged.
*/
- public static int boundInRange(int value, int lowerBound, int upperBound) {
+ public static int boundToRange(int value, int lowerBound, int upperBound) {
+ return Math.max(lowerBound, Math.min(value, upperBound));
+ }
+
+ /**
+ * @see #boundToRange(int, int, int).
+ */
+ public static float boundToRange(float value, float lowerBound, float upperBound) {
return Math.max(lowerBound, Math.min(value, upperBound));
}