|
|
@@ -51,13 +51,13 @@ public class CustomIndicator extends View {
|
|
|
private final Paint mPaint = new Paint();
|
|
|
|
|
|
public void setIndicatorSetting(RecyclerView recyclerview, int inActiveColor, int activeColor, int bottomOffset) {
|
|
|
- this.recyclerView = recyclerview;
|
|
|
- this.inActiveColor = inActiveColor;
|
|
|
- this.activeColor = activeColor;
|
|
|
- this.bottomOffset = bottomOffset;
|
|
|
- mPaint.setStrokeCap(Paint.Cap.ROUND);
|
|
|
- mPaint.setStrokeWidth(mIndicatorStrokeWidth);
|
|
|
- mPaint.setStyle(Paint.Style.FILL);
|
|
|
+ this.recyclerView = recyclerview;
|
|
|
+ this.inActiveColor = inActiveColor;
|
|
|
+ this.activeColor = activeColor;
|
|
|
+ this.bottomOffset = bottomOffset;
|
|
|
+ mPaint.setStrokeCap(Paint.Cap.ROUND);
|
|
|
+ mPaint.setStrokeWidth(mIndicatorStrokeWidth);
|
|
|
+ mPaint.setStyle(Paint.Style.FILL);
|
|
|
}
|
|
|
|
|
|
public void onChangedIndex(int firstVisibleItemPosition) {
|
|
|
@@ -92,7 +92,7 @@ public class CustomIndicator extends View {
|
|
|
for (int i = 0; i < itemCount; i++) {
|
|
|
// itemCount 1은 안띄움
|
|
|
if (itemCount != 1) {
|
|
|
- c.drawCircle(start, indicatorPosY, mIndicatorItemLength / 2, mPaint);
|
|
|
+ c.drawCircle(start, indicatorPosY, DP * 3, mPaint);
|
|
|
start += itemWidth;
|
|
|
}
|
|
|
}
|
|
|
@@ -102,12 +102,12 @@ public class CustomIndicator extends View {
|
|
|
int highlightPosition, int itemCount) {
|
|
|
mPaint.setColor(context.getResources().getColor(activeColor));
|
|
|
|
|
|
- final float itemWidth = mIndicatorItemLength + mIndicatorItemPadding;
|
|
|
+ final float itemWidth = mIndicatorItemLength + mIndicatorItemPadding;
|
|
|
|
|
|
float start = indicatorStartX;
|
|
|
for (int i = 0; i < itemCount; i++) {
|
|
|
if (itemCount != 1 && i == highlightPosition) {
|
|
|
- canvas.drawCircle(start, indicatorPosY, mIndicatorItemLength /2, mPaint);
|
|
|
+ canvas.drawCircle(start, indicatorPosY, DP * 3, mPaint);
|
|
|
}
|
|
|
start += itemWidth;
|
|
|
}
|