5
5
import android .support .design .widget .Snackbar ;
6
6
import android .support .v7 .app .AppCompatActivity ;
7
7
import android .support .v7 .widget .Toolbar ;
8
- import android .view .View ;
9
8
import android .view .Menu ;
10
9
import android .view .MenuItem ;
10
+ import android .view .View ;
11
11
12
+ import com .app .progresviews .ProgressLine ;
12
13
import com .app .progresviews .ProgressWheel ;
13
14
14
15
import java .text .DecimalFormat ;
@@ -20,6 +21,9 @@ public class MainActivity extends AppCompatActivity {
20
21
private int step = 20000 ;
21
22
private DecimalFormat mformatter ;
22
23
24
+ private ProgressLine mProgressLine ;
25
+ private int mValue = 90000 ;
26
+
23
27
@ Override
24
28
protected void onCreate (Bundle savedInstanceState ) {
25
29
super .onCreate (savedInstanceState );
@@ -38,6 +42,7 @@ public void onClick(View view) {
38
42
});
39
43
40
44
mProgressWheel = (ProgressWheel ) findViewById (R .id .progress );
45
+ mProgressLine = (ProgressLine ) findViewById (R .id .progress_line );
41
46
42
47
mformatter = new DecimalFormat ("#,###,###" );
43
48
@@ -81,4 +86,16 @@ public void change(View view) {
81
86
mProgressWheel .setPercentage (per = per + 72 );
82
87
mProgressWheel .setStepCountText (mformatter .format (step = step + 20000 ));
83
88
}
89
+
90
+ public void changeLine (View view ) {
91
+ mValue += 10000 ;
92
+ mProgressLine .setmValueText (String .valueOf (mValue ));
93
+ }
94
+
95
+ public void clearAllData (View view ) {
96
+ mValue = 0 ;
97
+ per = 0 ;
98
+ step = 0 ;
99
+ mProgressLine .setmValueText (String .valueOf (mValue ));
100
+ }
84
101
}
0 commit comments