|
@@ -48,7 +48,6 @@ public class MainBannerViewItemDotIndicator extends RecyclerView.ItemDecoration
|
|
|
/**
|
|
/**
|
|
|
* Some more natural animation interpolation
|
|
* Some more natural animation interpolation
|
|
|
*/
|
|
*/
|
|
|
- //private final Interpolator mInterpolator = new AccelerateDecelerateInterpolator();
|
|
|
|
|
|
|
|
|
|
private final Paint mPaint = new Paint();
|
|
private final Paint mPaint = new Paint();
|
|
|
|
|
|
|
@@ -70,9 +69,9 @@ public class MainBannerViewItemDotIndicator extends RecyclerView.ItemDecoration
|
|
|
float paddingBetweenItems = Math.max(0, itemCount - 1) * mIndicatorItemPadding;
|
|
float paddingBetweenItems = Math.max(0, itemCount - 1) * mIndicatorItemPadding;
|
|
|
float indicatorTotalWidth = totalLength + paddingBetweenItems;
|
|
float indicatorTotalWidth = totalLength + paddingBetweenItems;
|
|
|
float indicatorStartX = (parent.getWidth() - indicatorTotalWidth) / 2F;
|
|
float indicatorStartX = (parent.getWidth() - indicatorTotalWidth) / 2F;
|
|
|
-
|
|
|
|
|
float indicatorPosY = parent.getHeight() - mIndicatorHeight / 2F;
|
|
float indicatorPosY = parent.getHeight() - mIndicatorHeight / 2F;
|
|
|
|
|
|
|
|
|
|
+
|
|
|
drawInactiveIndicators(c, indicatorStartX, indicatorPosY, itemCount);
|
|
drawInactiveIndicators(c, indicatorStartX, indicatorPosY, itemCount);
|
|
|
|
|
|
|
|
|
|
|
|
@@ -95,10 +94,9 @@ public class MainBannerViewItemDotIndicator extends RecyclerView.ItemDecoration
|
|
|
|
|
|
|
|
float start = indicatorStartX;
|
|
float start = indicatorStartX;
|
|
|
for (int i = 0; i < itemCount; i++) {
|
|
for (int i = 0; i < itemCount; i++) {
|
|
|
- // draw the line for every item
|
|
|
|
|
|
|
+ // itemCount 1은 안띄움
|
|
|
if (itemCount != 1) {
|
|
if (itemCount != 1) {
|
|
|
c.drawCircle(start, indicatorPosY, mIndicatorItemLength / 2F, mPaint);
|
|
c.drawCircle(start, indicatorPosY, mIndicatorItemLength / 2F, mPaint);
|
|
|
-
|
|
|
|
|
start += itemWidth;
|
|
start += itemWidth;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -110,7 +108,7 @@ public class MainBannerViewItemDotIndicator extends RecyclerView.ItemDecoration
|
|
|
|
|
|
|
|
// width of item indicator including padding
|
|
// width of item indicator including padding
|
|
|
final float itemWidth = mIndicatorItemLength + mIndicatorItemPadding;
|
|
final float itemWidth = mIndicatorItemLength + mIndicatorItemPadding;
|
|
|
-
|
|
|
|
|
|
|
+ Log.e("APP# MainBannerViewItemDotIndicator | drawHighlights", "|" + highlightPosition);
|
|
|
|
|
|
|
|
// no swipe, draw a normal indicator
|
|
// no swipe, draw a normal indicator
|
|
|
float highlightStart = indicatorStartX + itemWidth * highlightPosition;
|
|
float highlightStart = indicatorStartX + itemWidth * highlightPosition;
|