|
2 | 2 |
|
3 | 3 | import android.support.v7.app.AppCompatActivity; |
4 | 4 | import android.os.Bundle; |
| 5 | +import android.util.Log; |
5 | 6 | import android.view.View; |
6 | 7 | import android.widget.Button; |
7 | 8 | import android.widget.TextView; |
8 | 9 |
|
9 | 10 | import com.allen.androidcustomview.R; |
10 | 11 | import com.allen.androidcustomview.widget.CircleProgressBarView; |
11 | 12 | import com.allen.androidcustomview.widget.HorizontalProgressBar; |
| 13 | +import com.allen.androidcustomview.widget.LoadingView; |
| 14 | +import com.allen.androidcustomview.widget.ProductProgressBar; |
12 | 15 |
|
13 | 16 | public class ProgressBarActivity extends AppCompatActivity { |
14 | 17 |
|
15 | 18 | CircleProgressBarView circleProgressBarView; |
16 | 19 | HorizontalProgressBar horizontalProgressBar; |
| 20 | + ProductProgressBar productProgressBar; |
| 21 | + LoadingView loadingView; |
17 | 22 | TextView textView; |
18 | 23 |
|
19 | 24 | Button button; |
| 25 | + |
20 | 26 | @Override |
21 | 27 | protected void onCreate(Bundle savedInstanceState) { |
22 | 28 | super.onCreate(savedInstanceState); |
@@ -25,6 +31,8 @@ protected void onCreate(Bundle savedInstanceState) { |
25 | 31 | circleProgressBarView = (CircleProgressBarView) findViewById(R.id.circle_progress_view); |
26 | 32 |
|
27 | 33 | horizontalProgressBar = (HorizontalProgressBar) findViewById(R.id.horizontal_progress_view); |
| 34 | + productProgressBar = (ProductProgressBar) findViewById(R.id.product_progress_view); |
| 35 | + loadingView = (LoadingView) findViewById(R.id.loading_view); |
28 | 36 |
|
29 | 37 | textView = (TextView) findViewById(R.id.progress_tv); |
30 | 38 | button = (Button) findViewById(R.id.startAnimationBtn); |
@@ -45,11 +53,21 @@ public void currentProgressListener(float currentProgress) { |
45 | 53 | }); |
46 | 54 | horizontalProgressBar.startProgressAnimation(); |
47 | 55 |
|
| 56 | + productProgressBar.setProgress(60).setProgressListener(new ProductProgressBar.ProgressListener() { |
| 57 | + @Override |
| 58 | + public void currentProgressListener(float currentProgress) { |
| 59 | + Log.e("allen", "currentProgressListener: " + currentProgress); |
| 60 | + } |
| 61 | + }); |
| 62 | + |
| 63 | + loadingView.startAnimation(); |
48 | 64 |
|
49 | 65 | button.setOnClickListener(new View.OnClickListener() { |
50 | 66 | @Override |
51 | 67 | public void onClick(View v) { |
| 68 | + loadingView.startAnimation(); |
52 | 69 | horizontalProgressBar.setProgressWithAnimation(100); |
| 70 | + productProgressBar.setProgress(100); |
53 | 71 | circleProgressBarView.setProgressWithAnimation(60).startProgressAnimation(); |
54 | 72 | circleProgressBarView.setProgressListener(new CircleProgressBarView.ProgressListener() { |
55 | 73 | @Override |
|