|
|
@@ -1,5 +1,6 @@
|
|
|
package kr.co.zumo.app.lifeplus.view.custom.main.banner;
|
|
|
|
|
|
+import android.content.Context;
|
|
|
import android.content.res.Resources;
|
|
|
import android.graphics.Canvas;
|
|
|
import android.graphics.Paint;
|
|
|
@@ -18,9 +19,10 @@ import android.view.View;
|
|
|
* @since 2018-11-01
|
|
|
*/
|
|
|
public class MainBannerViewItemDotIndicator extends RecyclerView.ItemDecoration {
|
|
|
+
|
|
|
+ private Context context;
|
|
|
private int colorActive = 0xFFFFFFFF;
|
|
|
private int colorInactive = 0x4DFFFFFF;
|
|
|
-
|
|
|
private static final float DP = Resources.getSystem().getDisplayMetrics().density;
|
|
|
|
|
|
/**
|
|
|
@@ -51,6 +53,7 @@ public class MainBannerViewItemDotIndicator extends RecyclerView.ItemDecoration
|
|
|
private final Paint mPaint = new Paint();
|
|
|
|
|
|
public MainBannerViewItemDotIndicator() {
|
|
|
+ //this.context = context;
|
|
|
mPaint.setStrokeCap(Paint.Cap.ROUND);
|
|
|
mPaint.setStrokeWidth(mIndicatorStrokeWidth);
|
|
|
mPaint.setStyle(Paint.Style.STROKE);
|
|
|
@@ -105,6 +108,7 @@ public class MainBannerViewItemDotIndicator extends RecyclerView.ItemDecoration
|
|
|
// draw the line for every item
|
|
|
if (itemCount != 1) {
|
|
|
c.drawCircle(start, indicatorPosY, mIndicatorItemLength / 2F, mPaint);
|
|
|
+
|
|
|
start += itemWidth;
|
|
|
}
|
|
|
}
|
|
|
@@ -120,7 +124,7 @@ public class MainBannerViewItemDotIndicator extends RecyclerView.ItemDecoration
|
|
|
|
|
|
// no swipe, draw a normal indicator
|
|
|
float highlightStart = indicatorStartX + itemWidth * highlightPosition;
|
|
|
- c.drawCircle(highlightStart, indicatorPosY, mIndicatorItemLength / 2F, mPaint);
|
|
|
+ c.drawCircle(highlightStart, indicatorPosY, mIndicatorItemLength / 2F, mPaint);
|
|
|
|
|
|
// draw the highlight overlapping to the next item as well
|
|
|
if (highlightPosition < itemCount - 1) {
|