Skip to content

Commit 9cb7b5a

Browse files
committed
example edited.
1 parent 433bee3 commit 9cb7b5a

File tree

2 files changed

+41
-5
lines changed

2 files changed

+41
-5
lines changed

app/src/main/res/layout/activity_main.xml

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,45 @@
1010
android:id="@+id/pb1"
1111
android:layout_width="wrap_content"
1212
android:layout_height="wrap_content"
13+
android:layout_marginStart="60dp"
14+
android:layout_marginTop="60dp"
1315
app:innerAnimInterpolator="linear"
14-
app:innerLoaderStrokeWidth="4dp"
1516
app:layout_constraintStart_toStartOf="parent"
1617
app:layout_constraintTop_toTopOf="parent"
1718
app:outerAnimInterpolator="linear"
18-
app:outerLoaderAnimDuration="1500"
19-
app:outerLoaderStrokeWidth="1dp"
20-
app:spaceBetweenCircles="1dp"/>
19+
app:outerLoaderAnimDuration="1500" />
20+
21+
<com.sn.lib.NestedProgress
22+
android:id="@+id/pb2"
23+
android:layout_width="wrap_content"
24+
android:layout_height="wrap_content"
25+
app:innerAnimInterpolator="linear"
26+
app:innerLoaderAnimDuration="1500"
27+
app:innerLoaderColor="@color/purple_700"
28+
app:innerLoaderLength="180"
29+
app:layout_constraintStart_toEndOf="@+id/pb1"
30+
app:layout_constraintTop_toTopOf="@id/pb1"
31+
app:outerLoaderAnimDuration="2000"
32+
app:outerLoaderColor="@color/blue"
33+
app:outerLoaderLength="360"
34+
app:outerLoaderStrokeWidth="5dp" />
35+
36+
<com.sn.lib.NestedProgress
37+
android:id="@+id/pb3"
38+
android:layout_width="wrap_content"
39+
android:layout_height="wrap_content"
40+
app:innerAnimInterpolator="overshoot"
41+
app:innerLoaderAnimDuration="2000"
42+
app:innerLoaderColor="@color/red"
43+
app:innerLoaderLength="360"
44+
app:innerLoaderStrokeWidth="1.5dp"
45+
app:layout_constraintStart_toEndOf="@+id/pb2"
46+
app:layout_constraintTop_toTopOf="@id/pb2"
47+
app:outerAnimInterpolator="anticipateOvershoot"
48+
app:outerLoaderAnimDuration="1000"
49+
app:outerLoaderColor="@color/red_soft"
50+
app:outerLoaderLength="200"
51+
app:outerLoaderStrokeWidth="10dp" />
2152

2253

2354
</androidx.constraintlayout.widget.ConstraintLayout>

lib/src/main/java/com/sn/lib/NestedProgress.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class NestedProgress @JvmOverloads constructor(
8686
var innerLoaderLength: Float = INNER_LOADER_LENGTH
8787
var outerLoaderLength: Float = OUTER_LOADER_LENGTH
8888

89-
/** Stroke can be in the range 0 to 10, otherwise the illegal argument exception error is thrown.
89+
/** Strokes can be in the range 1 to 10, otherwise the illegal argument exception error is thrown.
9090
* @throws IllegalArgumentException
9191
* - innerLoaderStrokeWidth
9292
* - outerLoaderStrokeWidth
@@ -114,6 +114,11 @@ class NestedProgress @JvmOverloads constructor(
114114
) else value
115115
}
116116

117+
/** Set the distance between the two loaders. The higher this value, the smaller the "internal loader".
118+
* Space between circles can be in the range 1 to 10, otherwise the illegal argument exception error is thrown.
119+
* @throws IllegalArgumentException
120+
* - spaceBetweenCircles
121+
*/
117122
@Dimension
118123
var spaceBetweenCircles = SPACE_BETWEEN_CIRCLES.dp
119124
set(value) {

0 commit comments

Comments
 (0)