aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/src/com/viewpagerindicator/TitlePageIndicator.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/main/src/com/viewpagerindicator/TitlePageIndicator.java b/main/src/com/viewpagerindicator/TitlePageIndicator.java
index 17ec2bd..49b158a 100644
--- a/main/src/com/viewpagerindicator/TitlePageIndicator.java
+++ b/main/src/com/viewpagerindicator/TitlePageIndicator.java
@@ -89,7 +89,7 @@ public class TitlePageIndicator extends View implements PageIndicator {
private boolean mBoldText;
private int mColorText;
private int mColorSelected;
- private Path mPath;
+ private Path mPath = new Path();
private final Paint mPaintFooterLine;
private IndicatorStyle mFooterIndicatorStyle;
private final Paint mPaintFooterIndicator;
@@ -405,7 +405,7 @@ public class TitlePageIndicator extends View implements PageIndicator {
}
//Draw the footer line
- mPath = new Path();
+ mPath.reset();
mPath.moveTo(0, height - mFooterLineHeight / 2f);
mPath.lineTo(width, height - mFooterLineHeight / 2f);
mPath.close();
@@ -413,7 +413,7 @@ public class TitlePageIndicator extends View implements PageIndicator {
switch (mFooterIndicatorStyle) {
case Triangle:
- mPath = new Path();
+ mPath.reset();
mPath.moveTo(halfWidth, height - mFooterLineHeight - mFooterIndicatorHeight);
mPath.lineTo(halfWidth + mFooterIndicatorHeight, height - mFooterLineHeight);
mPath.lineTo(halfWidth - mFooterIndicatorHeight, height - mFooterLineHeight);
@@ -427,7 +427,7 @@ public class TitlePageIndicator extends View implements PageIndicator {
}
RectF underlineBounds = bounds.get(page);
- mPath = new Path();
+ mPath.reset();
mPath.moveTo(underlineBounds.left - mFooterIndicatorUnderlinePadding, height - mFooterLineHeight);
mPath.lineTo(underlineBounds.right + mFooterIndicatorUnderlinePadding, height - mFooterLineHeight);
mPath.lineTo(underlineBounds.right + mFooterIndicatorUnderlinePadding, height - mFooterLineHeight - mFooterIndicatorHeight);
@@ -501,7 +501,9 @@ public class TitlePageIndicator extends View implements PageIndicator {
mIsDragging = false;
mActivePointerId = INVALID_POINTER;
- if (mViewPager.isFakeDragging()) mViewPager.endFakeDrag();
+ if (mViewPager.isFakeDragging()) {
+ mViewPager.endFakeDrag();
+ }
break;
case MotionEventCompat.ACTION_POINTER_DOWN: {