list) {
+ mList.clear();
+ mList.addAll(list);
+ if (mList.size() > 1) {
+ setIndicatorValues();
+ } else if (mIndicatorView != null) {
+ mIndicatorView.setPageSize(mList.size());
+ }
+ if (mList.size() > 0 && isCanLoop()) {
+ currentPosition = MAX_VALUE / 2 - ((MAX_VALUE / 2) % mList.size()) + 1;
}
}
@@ -206,7 +203,6 @@ private void setIndicatorValues() {
if (bannerOptions.isCustomIndicator() && null != mIndicatorView) {
initIndicator(mIndicatorView);
} else {
-// initIndicator(IndicatorFactory.createIndicatorView(getContext(), bannerOptions.getIndicatorStyle()));
initIndicator(new IndicatorView(getContext()));
}
mIndicatorView.setIndicatorOptions(bannerOptions.getIndicatorOptions());
diff --git a/bannerview/src/main/java/com/zhpan/bannerview/indicator/drawer/BaseDrawer.java b/bannerview/src/main/java/com/zhpan/bannerview/indicator/drawer/BaseDrawer.java
index 419d837e..13782c6f 100644
--- a/bannerview/src/main/java/com/zhpan/bannerview/indicator/drawer/BaseDrawer.java
+++ b/bannerview/src/main/java/com/zhpan/bannerview/indicator/drawer/BaseDrawer.java
@@ -27,11 +27,11 @@ public abstract class BaseDrawer implements IDrawer {
public class MeasureResult {
- public int measureWidth;
+ int measureWidth;
- public int measureHeight;
+ int measureHeight;
- public void setMeasureResult(int measureWidth, int measureHeight) {
+ void setMeasureResult(int measureWidth, int measureHeight) {
this.measureWidth = measureWidth;
this.measureHeight = measureHeight;
}
diff --git a/bannerview/src/main/java/com/zhpan/bannerview/indicator/drawer/CircleDrawer.java b/bannerview/src/main/java/com/zhpan/bannerview/indicator/drawer/CircleDrawer.java
index a9ae59e5..5f77976e 100644
--- a/bannerview/src/main/java/com/zhpan/bannerview/indicator/drawer/CircleDrawer.java
+++ b/bannerview/src/main/java/com/zhpan/bannerview/indicator/drawer/CircleDrawer.java
@@ -16,7 +16,7 @@ public class CircleDrawer extends BaseDrawer {
private float minWidth;
- public CircleDrawer(IndicatorOptions indicatorOptions) {
+ CircleDrawer(IndicatorOptions indicatorOptions) {
super(indicatorOptions);
}
diff --git a/bannerview/src/main/java/com/zhpan/bannerview/indicator/drawer/DashDrawer.java b/bannerview/src/main/java/com/zhpan/bannerview/indicator/drawer/DashDrawer.java
index 61b456a5..31562db6 100644
--- a/bannerview/src/main/java/com/zhpan/bannerview/indicator/drawer/DashDrawer.java
+++ b/bannerview/src/main/java/com/zhpan/bannerview/indicator/drawer/DashDrawer.java
@@ -17,7 +17,7 @@ public class DashDrawer extends BaseDrawer {
private float minWidth;
- public DashDrawer(IndicatorOptions indicatorOptions) {
+ DashDrawer(IndicatorOptions indicatorOptions) {
super(indicatorOptions);
}
diff --git a/bannerview/src/main/java/com/zhpan/bannerview/indicator/drawer/DrawerFactory.java b/bannerview/src/main/java/com/zhpan/bannerview/indicator/drawer/DrawerFactory.java
new file mode 100644
index 00000000..3b23f09d
--- /dev/null
+++ b/bannerview/src/main/java/com/zhpan/bannerview/indicator/drawer/DrawerFactory.java
@@ -0,0 +1,23 @@
+package com.zhpan.bannerview.indicator.drawer;
+
+import com.zhpan.bannerview.manager.IndicatorOptions;
+
+import static com.zhpan.bannerview.constants.IndicatorStyle.DASH;
+
+/**
+ *
+ * Created by zhpan on 2019/11/24.
+ * Description: Indicator Drawer Factory.
+ *
+ */
+class DrawerFactory {
+ static IDrawer createDrawer(IndicatorOptions indicatorOptions) {
+ IDrawer drawer;
+ if (indicatorOptions.getIndicatorStyle() == DASH) {
+ drawer = new DashDrawer(indicatorOptions);
+ } else {
+ drawer = new CircleDrawer(indicatorOptions);
+ }
+ return drawer;
+ }
+}
diff --git a/bannerview/src/main/java/com/zhpan/bannerview/indicator/drawer/DrawerProxy.java b/bannerview/src/main/java/com/zhpan/bannerview/indicator/drawer/DrawerProxy.java
index b1456e27..377e9921 100644
--- a/bannerview/src/main/java/com/zhpan/bannerview/indicator/drawer/DrawerProxy.java
+++ b/bannerview/src/main/java/com/zhpan/bannerview/indicator/drawer/DrawerProxy.java
@@ -13,8 +13,8 @@
* Description: Indicator Drawer Proxy.
*
*/
-public class DrawerProxy implements IDrawer{
-
+public class DrawerProxy implements IDrawer {
+
private IDrawer mIDrawer;
public DrawerProxy(IndicatorOptions indicatorOptions) {
@@ -22,14 +22,7 @@ public DrawerProxy(IndicatorOptions indicatorOptions) {
}
private void init(IndicatorOptions indicatorOptions) {
- switch (indicatorOptions.getIndicatorStyle()) {
- case CIRCLE:
- mIDrawer = new CircleDrawer(indicatorOptions);
- break;
- case DASH:
- mIDrawer = new DashDrawer(indicatorOptions);
- break;
- }
+ mIDrawer = DrawerFactory.createDrawer(indicatorOptions);
}
public void setIndicatorOptions(IndicatorOptions indicatorOptions) {
diff --git a/download/app.apk b/download/app.apk
index 9f6ab0bd..d4b35a9d 100644
Binary files a/download/app.apk and b/download/app.apk differ
diff --git a/image/qq_group.png b/image/qq_group.png
new file mode 100644
index 00000000..88a2e7c1
Binary files /dev/null and b/image/qq_group.png differ