Bug 1293790 - Increase separation between circles in indicator r?sebastian
MozReview-Commit-ID: 5Ovn3wi4qAr
--- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/CirclePageIndicator.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/CirclePageIndicator.java
@@ -39,16 +39,25 @@ import static android.graphics.Paint.ANT
import static android.widget.LinearLayout.HORIZONTAL;
import static android.widget.LinearLayout.VERTICAL;
/**
* Draws circles (one for each view). The current view position is filled and
* others are only stroked.
*/
public class CirclePageIndicator extends View implements PageIndicator {
+ /**
+ * Separation between circles, as a factor of the circle radius. By default CirclePageIndicator
+ * shipped with a separation factor of 3, however we want to be able to tweak this for
+ * ActivityStream.
+ *
+ * If/when we reuse this indicator elsewhere, this should probably become a configurable property.
+ */
+ private static final int SEPARATION_FACTOR = 7;
+
private static final int INVALID_POINTER = -1;
private float mRadius;
private final Paint mPaintPageFill = new Paint(ANTI_ALIAS_FLAG);
private final Paint mPaintStroke = new Paint(ANTI_ALIAS_FLAG);
private final Paint mPaintFill = new Paint(ANTI_ALIAS_FLAG);
private ViewPager mViewPager;
private ViewPager.OnPageChangeListener mListener;
@@ -224,17 +233,17 @@ public class CirclePageIndicator extends
shortPaddingBefore = getPaddingTop();
} else {
longSize = getHeight();
longPaddingBefore = getPaddingTop();
longPaddingAfter = getPaddingBottom();
shortPaddingBefore = getPaddingLeft();
}
- final float threeRadius = mRadius * 3;
+ final float threeRadius = mRadius * SEPARATION_FACTOR;
final float shortOffset = shortPaddingBefore + mRadius;
float longOffset = longPaddingBefore + mRadius;
if (mCentered) {
longOffset += ((longSize - longPaddingBefore - longPaddingAfter) / 2.0f) - ((count * threeRadius) / 2.0f);
}
float dX;
float dY;