1- package com . gigamole . arcprogressstackview ;
1+ package devlight . io . sample ;
22
33import android .animation .Animator ;
44import android .animation .AnimatorListenerAdapter ;
55import android .animation .ValueAnimator ;
6+ import android .content .Intent ;
67import android .graphics .Color ;
78import android .os .Bundle ;
89import android .support .v7 .app .AppCompatActivity ;
1718
1819import com .commonsware .cwac .colormixer .ColorMixer ;
1920import com .commonsware .cwac .colormixer .ColorMixerDialog ;
20- import com .gigamole .library .ArcProgressStackView ;
2121
2222import java .util .ArrayList ;
2323import java .util .Random ;
2424
25+ import devlight .io .library .ArcProgressStackView ;
26+
2527public class MainActivity extends AppCompatActivity implements
2628 View .OnClickListener ,
2729 CompoundButton .OnCheckedChangeListener ,
@@ -59,7 +61,7 @@ private void init() {
5961 mArcProgressStackView = (ArcProgressStackView ) findViewById (R .id .apsv );
6062
6163 // Get colors
62- final String [] startColors = getResources ().getStringArray (R .array .polluted_waves );
64+ final String [] startColors = getResources ().getStringArray (R .array .devlight );
6365 final String [] endColors = getResources ().getStringArray (R .array .default_preview );
6466 final String [] bgColors = getResources ().getStringArray (R .array .medical_express );
6567
@@ -71,10 +73,10 @@ private void init() {
7173
7274 // Set models
7375 final ArrayList <ArcProgressStackView .Model > models = new ArrayList <>();
74- models .add (new ArcProgressStackView .Model ("Circle " , 0 , Color .parseColor (bgColors [0 ]), mStartColors [0 ]));
75- models .add (new ArcProgressStackView .Model ("Progress " , 0 , Color .parseColor (bgColors [1 ]), mStartColors [1 ]));
76- models .add (new ArcProgressStackView .Model ("Stack " , 0 , Color .parseColor (bgColors [2 ]), mStartColors [2 ]));
77- models .add (new ArcProgressStackView .Model ("View " , 0 , Color .parseColor (bgColors [3 ]), mStartColors [3 ]));
76+ models .add (new ArcProgressStackView .Model ("Strategy " , 0 , Color .parseColor (bgColors [0 ]), mStartColors [0 ]));
77+ models .add (new ArcProgressStackView .Model ("Design " , 0 , Color .parseColor (bgColors [1 ]), mStartColors [1 ]));
78+ models .add (new ArcProgressStackView .Model ("Development " , 0 , Color .parseColor (bgColors [2 ]), mStartColors [2 ]));
79+ models .add (new ArcProgressStackView .Model ("QA " , 0 , Color .parseColor (bgColors [3 ]), mStartColors [3 ]));
7880 mArcProgressStackView .setModels (models );
7981
8082 // Get wrappers
@@ -86,6 +88,7 @@ private void init() {
8688 final CheckBox cbDragging = (CheckBox ) findViewById (R .id .cb_dragging );
8789 final CheckBox cbShadowing = (CheckBox ) findViewById (R .id .cb_shadowing );
8890 final CheckBox cbRounding = (CheckBox ) findViewById (R .id .cb_rounding );
91+ final CheckBox cbLeveling = (CheckBox ) findViewById (R .id .cb_leveling );
8992 final CheckBox cbShowModelBg = (CheckBox ) findViewById (R .id .cb_show_model_bg );
9093 final CheckBox cbUseCustomTypeface = (CheckBox ) findViewById (R .id .cb_use_custom_typeface );
9194 final CheckBox cbUseOvershootInterpolator = (CheckBox ) findViewById (R .id .cb_use_overshoot_interpolator );
@@ -98,6 +101,7 @@ private void init() {
98101 cbShadowing .setOnCheckedChangeListener (this );
99102 cbRounding .setOnCheckedChangeListener (this );
100103 cbShowModelBg .setOnCheckedChangeListener (this );
104+ cbLeveling .setOnCheckedChangeListener (this );
101105 cbUseCustomTypeface .setOnCheckedChangeListener (this );
102106 cbUseOvershootInterpolator .setOnCheckedChangeListener (this );
103107 cbUseVerticalOrientation .setOnCheckedChangeListener (this );
@@ -107,6 +111,7 @@ private void init() {
107111 onCheckedChanged (cbDragging , cbDragging .isChecked ());
108112 onCheckedChanged (cbShadowing , cbShadowing .isChecked ());
109113 onCheckedChanged (cbRounding , cbRounding .isChecked ());
114+ onCheckedChanged (cbLeveling , cbLeveling .isChecked ());
110115 onCheckedChanged (cbShowModelBg , cbShowModelBg .isChecked ());
111116 onCheckedChanged (cbUseCustomTypeface , cbUseCustomTypeface .isChecked ());
112117 onCheckedChanged (cbUseOvershootInterpolator , cbUseOvershootInterpolator .isChecked ());
@@ -117,12 +122,14 @@ private void init() {
117122 mBtnTextColor = (Button ) findViewById (R .id .btn_text_color );
118123 mBtnShadowColor = (Button ) findViewById (R .id .btn_shadow_color );
119124 final Button btnAnimate = (Button ) findViewById (R .id .btn_animate );
125+ final Button btnPresentation = (Button ) findViewById (R .id .btn_presentation );
120126 final Button btnReset = (Button ) findViewById (R .id .btn_reset );
121127
122128 // Set buttons
123129 mBtnTextColor .setOnClickListener (this );
124130 mBtnShadowColor .setOnClickListener (this );
125131 btnAnimate .setOnClickListener (this );
132+ btnPresentation .setOnClickListener (this );
126133 btnReset .setOnClickListener (this );
127134
128135 // Set default colors
@@ -187,13 +194,16 @@ public void onCheckedChanged(final CompoundButton buttonView, final boolean isCh
187194 break ;
188195 case R .id .cb_shadowing :
189196 mArcProgressStackView .setIsShadowed (isChecked );
190- mArcProgressStackView .postInvalidate ();
197+ mArcProgressStackView .requestLayout ();
191198 mWrapperShadow .setVisibility (isChecked ? View .VISIBLE : View .GONE );
192199 break ;
193200 case R .id .cb_rounding :
194201 mArcProgressStackView .setIsRounded (isChecked );
195202 mArcProgressStackView .postInvalidate ();
196203 break ;
204+ case R .id .cb_leveling :
205+ mArcProgressStackView .setIsLeveled (isChecked );
206+ break ;
197207 case R .id .cb_show_model_bg :
198208 mArcProgressStackView .setModelBgEnabled (isChecked );
199209 break ;
@@ -242,6 +252,9 @@ public void onClick(final View v) {
242252 finish ();
243253 startActivity (getIntent ());
244254 break ;
255+ case R .id .btn_presentation :
256+ startActivity (new Intent (MainActivity .this , PresentationActivity .class ));
257+ break ;
245258 default :
246259 break ;
247260 }
0 commit comments