Skip to content

Commit a47360e

Browse files
committed
Update 1.0.4.
1 parent 4bb2b24 commit a47360e

File tree

21 files changed

+428
-172
lines changed

21 files changed

+428
-172
lines changed

README.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,9 @@ Present your progress bars in arc mode with information and total control.
2121
     
2222
[![Codacy](https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScSHhmckZyeGJDcXc)](https://www.codacy.com/app/gigamole53/ArcProgressStackView?utm_source=github.com&utm_medium=referral&utm_content=DevLight-Mobile-Agency/ArcProgressStackView&utm_campaign=Badge_Grade)
2323

24-
<table align="center">
25-
<tr>
26-
<td><img src="https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScTm9ZSlBMVlhmQ0k"/></td>
27-
<td><img src="https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScVXhJN0xQUThwVmc"/></td>
28-
<td><img src="https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScMjMydHVxOU5veWc"/></td>
29-
<td><img src="https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScM2NYdGQ5aEVsWTQ"/></td>
30-
<td><img src="https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScRTJMTF91V0NaYVE"/></td>
31-
</tr>
32-
</table>
24+
<p align="center">
25+
<img src="https://drive.google.com/uc?export=download&id=0BxPO_UeS7wScSURfZExTWTdvN2c"/>
26+
</p>
3327

3428
You can check the sample app [here](https://github.com/DevLight-Mobile-Agency/ArcProgressStackView/tree/master/app).
3529

@@ -172,14 +166,14 @@ Other methods check out in sample.
172166
And `XML` init:
173167

174168
```xml
175-
<com.gigamole.samples.ArcProgressStackView
176-
android:id="@+id/apsv"
169+
<<devlight.io.library.ArcProgressStackView
177170
android:layout_width="match_parent"
178171
android:layout_height="match_parent"
179172
app:apsv_rounded="true"
180173
app:apsv_shadowed="true"
181174
app:apsv_animated="true"
182175
app:apsv_dragged="true"
176+
app:apsv_leveled="true"
183177
app:apsv_typeface="fonts/agency.ttf"
184178
app:apsv_text_color="#fff"
185179
app:apsv_shadow_distance="5dp"

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ repositories {
3737
dependencies {
3838
compile fileTree(dir: 'libs', include: ['*.jar'])
3939
// compile(name:'apsv', ext:'aar')
40-
compile project(':library')
40+
compile project(':arcprogressstackview')
4141

4242
// Support
4343
compile 'com.android.support:appcompat-v7:23.1.0'

library/src/androidTest/java/com/gigamole/library/ApplicationTest.java renamed to app/src/androidTest/java/devlight/io/sample/ApplicationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.gigamole.library;
1+
package devlight.io.sample;
22

33
import android.app.Application;
44
import android.test.ApplicationTestCase;

app/src/main/AndroidManifest.xml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest package="com.gigamole.arcprogressstackview"
3-
xmlns:android="http://schemas.android.com/apk/res/android">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="devlight.io.sample">
44

5-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
5+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
66

77
<application
88
android:allowBackup="true"
9+
android:hardwareAccelerated="true"
910
android:icon="@mipmap/ic_launcher"
1011
android:label="@string/app_name"
11-
android:hardwareAccelerated="true"
1212
android:theme="@style/AppTheme">
13-
<activity android:name=".MainActivity">
13+
<activity
14+
android:name="devlight.io.sample.MainActivity"
15+
android:screenOrientation="portrait">
1416
<intent-filter>
1517
<action android:name="android.intent.action.MAIN"/>
1618

1719
<category android:name="android.intent.category.LAUNCHER"/>
1820
</intent-filter>
1921
</activity>
22+
23+
<activity
24+
android:name=".PresentationActivity"
25+
android:screenOrientation="sensorLandscape"/>
2026
</application>
2127

2228
</manifest>

app/src/main/java/com/gigamole/arcprogressstackview/MainActivity.java renamed to app/src/main/java/devlight/io/sample/MainActivity.java

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
package com.gigamole.arcprogressstackview;
1+
package devlight.io.sample;
22

33
import android.animation.Animator;
44
import android.animation.AnimatorListenerAdapter;
55
import android.animation.ValueAnimator;
6+
import android.content.Intent;
67
import android.graphics.Color;
78
import android.os.Bundle;
89
import android.support.v7.app.AppCompatActivity;
@@ -17,11 +18,12 @@
1718

1819
import com.commonsware.cwac.colormixer.ColorMixer;
1920
import com.commonsware.cwac.colormixer.ColorMixerDialog;
20-
import com.gigamole.library.ArcProgressStackView;
2121

2222
import java.util.ArrayList;
2323
import java.util.Random;
2424

25+
import devlight.io.library.ArcProgressStackView;
26+
2527
public 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
}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
package devlight.io.sample;
2+
3+
import android.animation.Animator;
4+
import android.animation.AnimatorListenerAdapter;
5+
import android.animation.ValueAnimator;
6+
import android.app.Activity;
7+
import android.graphics.Color;
8+
import android.os.Bundle;
9+
import android.view.View;
10+
11+
import java.util.ArrayList;
12+
13+
import devlight.io.library.ArcProgressStackView;
14+
15+
import static devlight.io.library.ArcProgressStackView.Model;
16+
import static devlight.io.sample.MainActivity.MODEL_COUNT;
17+
18+
/**
19+
* Created by GIGAMOLE on 9/21/16.
20+
*/
21+
22+
public class PresentationActivity extends Activity {
23+
24+
private int mCounter = 0;
25+
26+
private ArcProgressStackView mArcProgressStackView;
27+
28+
@Override
29+
protected void onCreate(final Bundle savedInstanceState) {
30+
super.onCreate(savedInstanceState);
31+
setContentView(R.layout.activity_presentation);
32+
33+
mArcProgressStackView = (ArcProgressStackView) findViewById(R.id.apsv_presentation);
34+
mArcProgressStackView.setShadowColor(Color.argb(200, 0, 0, 0));
35+
mArcProgressStackView.setAnimationDuration(1000);
36+
mArcProgressStackView.setSweepAngle(270);
37+
38+
final String[] stringColors = getResources().getStringArray(R.array.devlight);
39+
final String[] stringBgColors = getResources().getStringArray(R.array.bg);
40+
41+
final int[] colors = new int[MODEL_COUNT];
42+
final int[] bgColors = new int[MODEL_COUNT];
43+
for (int i = 0; i < MODEL_COUNT; i++) {
44+
colors[i] = Color.parseColor(stringColors[i]);
45+
bgColors[i] = Color.parseColor(stringBgColors[i]);
46+
}
47+
48+
final ArrayList<ArcProgressStackView.Model> models = new ArrayList<>();
49+
models.add(new Model("STRATEGY", 1, bgColors[0], colors[0]));
50+
models.add(new Model("DESIGN", 1, bgColors[1], colors[1]));
51+
models.add(new Model("DEVELOPMENT", 1, bgColors[2], colors[2]));
52+
models.add(new Model("QA", 1, bgColors[3], colors[3]));
53+
mArcProgressStackView.setModels(models);
54+
55+
final ValueAnimator valueAnimator = ValueAnimator.ofFloat(1.0F, 105.0F);
56+
valueAnimator.setDuration(800);
57+
valueAnimator.setStartDelay(200);
58+
valueAnimator.setRepeatMode(ValueAnimator.RESTART);
59+
valueAnimator.setRepeatCount(MODEL_COUNT - 1);
60+
valueAnimator.addListener(new AnimatorListenerAdapter() {
61+
@Override
62+
public void onAnimationEnd(final Animator animation) {
63+
animation.removeListener(this);
64+
animation.addListener(this);
65+
mCounter = 0;
66+
67+
for (final Model model : mArcProgressStackView.getModels()) model.setProgress(1);
68+
mArcProgressStackView.animateProgress();
69+
}
70+
71+
@Override
72+
public void onAnimationRepeat(final Animator animation) {
73+
mCounter++;
74+
}
75+
});
76+
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
77+
@Override
78+
public void onAnimationUpdate(final ValueAnimator animation) {
79+
mArcProgressStackView.getModels().get(Math.min(mCounter, MODEL_COUNT - 1))
80+
.setProgress((Float) animation.getAnimatedValue());
81+
mArcProgressStackView.postInvalidate();
82+
}
83+
});
84+
85+
mArcProgressStackView.setOnClickListener(new View.OnClickListener() {
86+
@Override
87+
public void onClick(final View v) {
88+
if (valueAnimator.isRunning()) return;
89+
if (mArcProgressStackView.getProgressAnimator().isRunning()) return;
90+
valueAnimator.start();
91+
}
92+
});
93+
}
94+
}

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

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
android:layout_height="wrap_content"
1515
android:padding="15dp">
1616

17-
<com.gigamole.library.ArcProgressStackView
17+
<devlight.io.library.ArcProgressStackView
1818
android:id="@+id/apsv"
1919
android:layout_width="match_parent"
2020
android:layout_height="match_parent"
2121
android:layout_gravity="center"
22-
app:apsv_preview_colors="@array/polluted_waves"
22+
app:apsv_preview_colors="@array/devlight"
2323
app:apsv_model_bg_enabled="true"/>
2424

2525
</FrameLayout>
@@ -98,6 +98,20 @@
9898

9999
</LinearLayout>
100100

101+
<LinearLayout
102+
android:layout_width="match_parent"
103+
android:layout_height="wrap_content"
104+
android:layout_weight="1"
105+
android:orientation="vertical">
106+
107+
<CheckBox
108+
android:id="@+id/cb_leveling"
109+
style="@style/PreviewStyle"
110+
android:text="Leveling"/>
111+
112+
</LinearLayout>
113+
114+
101115
<LinearLayout
102116
android:layout_width="match_parent"
103117
android:layout_height="wrap_content"
@@ -260,10 +274,16 @@
260274

261275
</LinearLayout>
262276

277+
<Button
278+
android:id="@+id/btn_presentation"
279+
style="@style/PreviewStyle"
280+
android:text="PRESENTATION"/>
281+
263282
<Button
264283
android:id="@+id/btn_reset"
265284
style="@style/PreviewStyle"
266285
android:text="RESET"/>
286+
267287
</LinearLayout>
268288

269289
</ScrollView>

0 commit comments

Comments
 (0)