Browse Source

remove Useless progress dependence

1145873331@qq.com 6 years ago
parent
commit
769fee91b8

+ 0 - 4
app/build.gradle

@ -244,7 +244,6 @@ dependencies {
244 244
    compile files('libs/badgeview.jar')
245 245
    compile project(':autolayout')
246 246
247
    //    compile project(':circleprogressbarlibrary')
248 247
    compile files('libs/universal-image-loader-1.9.1.jar')
249 248
    compile files('libs/eventbus-2.4.0.jar')
250 249
@ -259,15 +258,12 @@ dependencies {
259 258
    compile files('libs/jg_filter_sdk_1.1.jar')
260 259
261 260
    //    compile files('libs/Xg_sdk_v2.42_20160111_1539.jar')
262
263
    //        compile 'com.loonggg.godcoder.view:circleprogressbarlibrary:1.0.1'
264 261
    compile files('libs/wup-1.0.0.E-SNAPSHOT.jar')
265 262
    compile files('libs/pinyin4j-2.5.0.jar')
266 263
    compile files('libs/pinyin4android1.0.jar')
267 264
268 265
    compile files('libs/Msc.jar')
269 266
270
    compile project(path: ':circleprogressbarlibraryy')
271 267
    compile files('libs/libammsdk.jar')
272 268
    compile files('libs/alipaySdk-20160427.jar')
273 269
    compile 'com.google.zxing:core:+'

+ 1 - 9
app/src/main/java/com/electric/chargingpile/activity/ChargingStatusActivity.java

@ -6,19 +6,14 @@ import android.app.AlertDialog;
6 6
import android.content.Context;
7 7
import android.content.DialogInterface;
8 8
import android.content.Intent;
9
import android.content.SharedPreferences;
10 9
import android.net.Uri;
11 10
import android.os.Build;
12 11
import android.os.Bundle;
13 12
import android.os.Handler;
14 13
import android.os.Message;
15 14
import android.provider.Settings;
16
17
import android.support.v7.app.AppCompatActivity;
18 15
import android.view.KeyEvent;
19 16
import android.view.View;
20
import android.view.animation.Animation;
21
import android.view.animation.AnimationUtils;
22 17
import android.widget.ImageView;
23 18
import android.widget.TextView;
24 19
import android.widget.Toast;
@ -36,11 +31,10 @@ import com.electric.chargingpile.manager.ProfileManager;
36 31
import com.electric.chargingpile.util.BarColorUtil;
37 32
import com.electric.chargingpile.util.JsonUtils;
38 33
import com.electric.chargingpile.util.LoadingDialog;
39
import com.electric.chargingpile.util.Md5Util;
40 34
import com.electric.chargingpile.util.NotificationsUtils;
41 35
import com.electric.chargingpile.util.ToastUtil;
36
import com.electric.chargingpile.view.CircleProgressBar;
42 37
import com.google.zxing.client.android.CaptureActivity;
43
import com.loonggg.circleprogressbarlibrary.view.CircleProgressBar;
44 38
import com.squareup.picasso.Picasso;
45 39
import com.tencent.bugly.crashreport.CrashReport;
46 40
import com.umeng.analytics.MobclickAgent;
@ -48,8 +42,6 @@ import com.zhy.http.okhttp.OkHttpUtils;
48 42
import com.zhy.http.okhttp.callback.StringCallback;
49 43
50 44
import java.text.SimpleDateFormat;
51
import java.util.Formatter;
52
import java.util.Locale;
53 45
import java.util.TimeZone;
54 46
import java.util.Timer;
55 47
import java.util.TimerTask;

+ 1 - 1
app/src/main/java/com/electric/chargingpile/activity/MainScanActivity.java

@ -40,11 +40,11 @@ import com.electric.chargingpile.util.LoadingDialog;
40 40
import com.electric.chargingpile.util.Md5Util;
41 41
import com.electric.chargingpile.util.ToastUtil;
42 42
import com.electric.chargingpile.view.AlertDialogTwo;
43
import com.electric.chargingpile.view.CircleProgressBar;
43 44
import com.electric.chargingpile.view.OperatorDialog;
44 45
import com.electric.chargingpile.view.WaveView;
45 46
import com.google.gson.Gson;
46 47
import com.google.gson.reflect.TypeToken;
47
import com.loonggg.circleprogressbarlibrary.view.CircleProgressBar;
48 48
import com.tencent.bugly.crashreport.BuglyLog;
49 49
import com.tencent.bugly.crashreport.CrashReport;
50 50
import com.umeng.analytics.MobclickAgent;

+ 1 - 1
app/src/main/java/com/electric/chargingpile/activity/TLDLoadingActivity.java

@ -23,9 +23,9 @@ import com.electric.chargingpile.util.BarColorUtil;
23 23
import com.electric.chargingpile.util.JsonUtils;
24 24
import com.electric.chargingpile.util.Md5Util;
25 25
import com.electric.chargingpile.util.ToastUtil;
26
import com.electric.chargingpile.view.CircleProgressBar;
26 27
import com.google.zxing.client.android.CaptureActivity;
27 28
import com.google.zxing.client.android.constant.UrlConstants;
28
import com.loonggg.circleprogressbarlibrary.view.CircleProgressBar;
29 29
import com.tencent.bugly.crashreport.CrashReport;
30 30
import com.zhy.http.okhttp.OkHttpUtils;
31 31
import com.zhy.http.okhttp.callback.StringCallback;

+ 10 - 16
app/src/main/res/layout/activity_tldloading.xml

@ -1,11 +1,11 @@
1 1
<?xml version="1.0" encoding="utf-8"?>
2 2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 3
    xmlns:app="http://schemas.android.com/apk/res-auto"
4
    xmlns:loonggg="http://schemas.android.com/apk/res-auto"
4 5
    xmlns:tools="http://schemas.android.com/tools"
5 6
    android:layout_width="match_parent"
6 7
    android:layout_height="match_parent"
7 8
    android:background="@color/white"
8
    xmlns:loonggg="http://schemas.android.com/apk/res-auto"
9 9
    tools:context="com.electric.chargingpile.activity.TLDLoadingActivity">
10 10
11 11
    <RelativeLayout
@ -15,7 +15,7 @@
15 15
        android:layout_centerHorizontal="true"
16 16
        android:layout_marginTop="170dp">
17 17
18
        <com.loonggg.circleprogressbarlibrary.view.CircleProgressBar
18
        <com.electric.chargingpile.view.CircleProgressBar
19 19
            android:id="@+id/pb"
20 20
            android:layout_width="150dp"
21 21
            android:layout_height="150dp"
@ -26,44 +26,38 @@
26 26
            android:id="@+id/tv_count"
27 27
            android:layout_width="wrap_content"
28 28
            android:layout_height="wrap_content"
29
            android:layout_centerInParent="true"
29 30
            android:text=""
30 31
            android:textColor="@color/ui_65"
31
            android:textSize="27sp"
32
            android:layout_centerInParent="true"/>
32
            android:textSize="27sp" />
33 33
34 34
    </RelativeLayout>
35 35
36 36
    <LinearLayout
37 37
        android:layout_width="wrap_content"
38 38
        android:layout_height="wrap_content"
39
        android:layout_centerHorizontal="true"
40 39
        android:layout_below="@+id/rl"
40
        android:layout_centerHorizontal="true"
41 41
        android:layout_marginTop="59dp"
42 42
        android:orientation="vertical">
43 43
44 44
        <TextView
45 45
            android:layout_width="wrap_content"
46 46
            android:layout_height="wrap_content"
47
            android:text="客官别急,马上来电!"
48 47
            android:layout_gravity="center_horizontal"
49
            android:textSize="18sp"
50
            android:textColor="@color/ui_62"/>
48
            android:text="客官别急,马上来电!"
49
            android:textColor="@color/ui_62"
50
            android:textSize="18sp" />
51 51
52 52
        <TextView
53 53
            android:layout_width="wrap_content"
54 54
            android:layout_height="wrap_content"
55
            android:layout_marginTop="18dp"
55 56
            android:text="电桩开启需要时间,请您耐心等待..."
56
            android:textSize="14sp"
57 57
            android:textColor="@color/ui_65"
58
            android:layout_marginTop="18dp"/>
58
            android:textSize="14sp" />
59 59
60 60
    </LinearLayout>
61 61
62 62
63
64
65
66
67
68
69 63
</RelativeLayout>

+ 6 - 0
app/src/main/res/values/attr.xml

@ -1,5 +1,11 @@
1 1
<?xml version="1.0" encoding="utf-8"?>
2 2
<resources>
3
    <declare-styleable name="CircleProgressBar">
4
        <attr name="circleStrokeWidth" format="dimension" />
5
        <attr name="bgProgressBarColor" format="color" />
6
    </declare-styleable>
7

8

3 9

4 10
    <declare-styleable name="RatingBarView">
5 11


+ 0 - 1
circleprogressbarlibrary/.gitignore

@ -1 +0,0 @@
1
/build

+ 0 - 24
circleprogressbarlibrary/build.gradle

@ -1,24 +0,0 @@
1
apply plugin: 'com.android.library'
2
3
android {
4
    compileSdkVersion 22
5
    buildToolsVersion '28.0.3'
6
7
    defaultConfig {
8
        minSdkVersion 15
9
        targetSdkVersion 23
10
        versionCode 1
11
        versionName "1.0"
12
    }
13
    buildTypes {
14
        release {
15
            minifyEnabled false
16
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17
        }
18
    }
19
}
20
21
dependencies {
22
    compile fileTree(include: ['*.jar'], dir: 'libs')
23
    testCompile 'junit:junit:4.12'
24
}

+ 0 - 17
circleprogressbarlibrary/proguard-rules.pro

@ -1,17 +0,0 @@
1
# Add project specific ProGuard rules here.
2
# By default, the flags in this file are appended to flags specified
3
# in C:\as/tools/proguard/proguard-android.txt
4
# You can edit the include path and order by changing the proguardFiles
5
# directive in build.gradle.
6
#
7
# For more details, see
8
#   http://developer.android.com/guide/developing/tools/proguard.html
9
10
# Add any project specific keep options here:
11
12
# If your project uses WebView with JS, uncomment the following
13
# and specify the fully qualified class name to the JavaScript interface
14
# class:
15
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16
#   public *;
17
#}

+ 0 - 13
circleprogressbarlibrary/src/androidTest/java/com/loonggg/circleprogressbarlibrary/ApplicationTest.java

@ -1,13 +0,0 @@
1
package com.loonggg.circleprogressbarlibrary;
2
3
import android.app.Application;
4
import android.test.ApplicationTestCase;
5
6
/**
7
 * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
8
 */
9
public class ApplicationTest extends ApplicationTestCase<Application> {
10
    public ApplicationTest() {
11
        super(Application.class);
12
    }
13
}

+ 0 - 11
circleprogressbarlibrary/src/main/AndroidManifest.xml

@ -1,11 +0,0 @@
1
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
    package="com.loonggg.circleprogressbarlibrary">
3
4
    <application
5
        android:allowBackup="true"
6
        android:label="@string/app_name"
7
        android:supportsRtl="true">
8
9
    </application>
10
11
</manifest>

+ 0 - 148
circleprogressbarlibrary/src/main/java/com/loonggg/circleprogressbarlibrary/view/CircleProgressBar.java

@ -1,148 +0,0 @@
1
package com.loonggg.circleprogressbarlibrary.view;
2
3
import android.content.Context;
4
import android.content.res.TypedArray;
5
import android.graphics.Canvas;
6
import android.graphics.Color;
7
import android.graphics.Paint;
8
import android.graphics.RectF;
9
import android.graphics.Shader;
10
import android.graphics.SweepGradient;
11
import android.util.AttributeSet;
12
import android.view.View;
13
import android.view.animation.Animation;
14
import android.view.animation.Transformation;
15
16
import com.loonggg.circleprogressbarlibrary.R;
17
18
19
/**
20
 * Created by loonggg on 2016/5/6.
21
 */
22
public class CircleProgressBar extends View {
23
    private Context context;
24
    private Paint paint;
25
    private Paint bgPaint;
26
    private float mStrokeWidth;
27
28
    private int contentWidth = 100;
29
    private int contentHeight = 100;
30
    private int defaultBgColor = 0xffefefef;
31
    private int sweepAngle;
32
    private int animAngle;
33
    private ProgressBarAnimation anim;
34
35
36
    private int
37
            startColor = Color.parseColor("#3CBFF8"),
38
            endColor = Color.parseColor("#64E1B5"),
39
            intermediateOne = Color.parseColor("#41C6E8"),
40
            intermediateTwo = Color.parseColor("#48D0D0"),
41
            intermediateThree = Color.parseColor("#54DABD");
42
43
44
    public CircleProgressBar(Context context) {
45
        super(context);
46
        this.context = context;
47
        init(null, 0);
48
    }
49
50
    public CircleProgressBar(Context context, AttributeSet attrs) {
51
        super(context, attrs);
52
        this.context = context;
53
        init(attrs, 0);
54
    }
55
56
    public CircleProgressBar(Context context, AttributeSet attrs, int defStyleAttr) {
57
        super(context, attrs, defStyleAttr);
58
        this.context = context;
59
        init(attrs, defStyleAttr);
60
    }
61
62
    private void init(AttributeSet attrs, int defStyle) {
63
        TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.CircleProgressBar);
64
        mStrokeWidth = typedArray.getDimension(R.styleable.CircleProgressBar_circleStrokeWidth, 5);
65
        defaultBgColor = typedArray.getColor(R.styleable.CircleProgressBar_bgProgressBarColor, 0xffefefef);
66
        typedArray.recycle();
67
        anim = new ProgressBarAnimation();
68
    }
69
70
71
    private void initPaint() {
72
        paint = new Paint();
73
        paint.setFlags(Paint.ANTI_ALIAS_FLAG);
74
        paint.setStrokeWidth(mStrokeWidth);
75
        paint.setStyle(Paint.Style.STROKE);
76
        paint.setStrokeCap(Paint.Cap.ROUND);
77
78
        int[] mColors = new int[]{intermediateOne, intermediateTwo, intermediateThree, endColor, startColor, intermediateOne};
79
        float[] positions = new float[]{0f, 0.25f, 0.5f, 0.75f, 0.75f, 1f};
80
        Shader s = new SweepGradient(contentWidth / 2, contentHeight / 2, mColors, positions);
81
        paint.setShader(s);
82
83
        bgPaint = new Paint();
84
        bgPaint.setFlags(Paint.ANTI_ALIAS_FLAG);
85
        bgPaint.setStrokeWidth(mStrokeWidth);
86
        bgPaint.setStyle(Paint.Style.STROKE);
87
        bgPaint.setColor(defaultBgColor);
88
    }
89
90
91
    @Override
92
    protected void onDraw(Canvas canvas) {
93
        super.onDraw(canvas);
94
        contentWidth = getWidth();
95
        contentHeight = getHeight();
96
        initPaint();
97
        /**
98
         * left - The X coordinate of the left side of the rectagle
99
         * top - The Y coordinate of the top of the rectangle
100
         * right - The X coordinate of the right side of the rectagle
101
         * bottom - The Y coordinate of the bottom of the rectangle
102
         */
103
        RectF oval = new RectF(0 + mStrokeWidth / 2, 0 + mStrokeWidth / 2, 0 + contentWidth - mStrokeWidth / 2, 0 + contentHeight - mStrokeWidth / 2);
104
        canvas.drawArc(oval, 0, 360, false, bgPaint);
105
        canvas.drawArc(oval, -90, sweepAngle, false, paint);
106
    }
107
108
    @Override
109
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
110
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
111
        int widthSpecMode = MeasureSpec.getMode(widthMeasureSpec);
112
        int widthSpecSize = MeasureSpec.getSize(widthMeasureSpec);
113
114
        int heightSpecMode = MeasureSpec.getMode(heightMeasureSpec);
115
        int heightSpecSize = MeasureSpec.getSize(heightMeasureSpec);
116
117
        if (widthSpecMode == MeasureSpec.AT_MOST && heightSpecMode == MeasureSpec.AT_MOST) {
118
            setMeasuredDimension(getMeasuredWidth() / 2, getMeasuredHeight() / 2);
119
        } else if (widthSpecMode == MeasureSpec.AT_MOST) {
120
            setMeasuredDimension(getMeasuredWidth() / 2, heightSpecSize);
121
        } else if (heightSpecMode == MeasureSpec.AT_MOST) {
122
            setMeasuredDimension(widthSpecSize, getMeasuredHeight() / 2);
123
        }
124
    }
125
126
    /**
127
     * @author loonggg
128
     */
129
    public class ProgressBarAnimation extends Animation {
130
        public ProgressBarAnimation() {
131
132
        }
133
134
        @Override
135
        protected void applyTransformation(float interpolatedTime,
136
                                           Transformation t) {
137
            super.applyTransformation(interpolatedTime, t);
138
            sweepAngle = (int) (interpolatedTime * animAngle);
139
            postInvalidate();
140
        }
141
    }
142
143
    public void setProgress(float progress, int time) {
144
        animAngle = (int) (progress * 360f);
145
        anim.setDuration(time);
146
        this.startAnimation(anim);
147
    }
148
}

+ 0 - 8
circleprogressbarlibrary/src/main/res/values/attrs.xml

@ -1,8 +0,0 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<resources>
3
    <declare-styleable name="CircleProgressBar">
4
        <attr name="circleStrokeWidth" format="dimension" />
5
        <attr name="bgProgressBarColor" format="color" />
6
    </declare-styleable>
7
8
</resources>

+ 0 - 3
circleprogressbarlibrary/src/main/res/values/strings.xml

@ -1,3 +0,0 @@
1
<resources>
2
    <string name="app_name">CircleProgressBar Library</string>
3
</resources>

+ 0 - 15
circleprogressbarlibrary/src/test/java/com/loonggg/circleprogressbarlibrary/ExampleUnitTest.java

@ -1,15 +0,0 @@
1
package com.loonggg.circleprogressbarlibrary;
2
3
import org.junit.Test;
4
5
import static org.junit.Assert.*;
6
7
/**
8
 * To work on unit tests, switch the Test Artifact in the Build Variants view.
9
 */
10
public class ExampleUnitTest {
11
    @Test
12
    public void addition_isCorrect() throws Exception {
13
        assertEquals(4, 2 + 2);
14
    }
15
}

+ 1 - 2
settings.gradle

@ -1,4 +1,3 @@
1
include ':app', ':autolayout', ':circleprogressbarlibraryy', ':xrichtextt', ':zxing', ':XRefreshView'
2
project(':circleprogressbarlibraryy').projectDir = new File('circleprogressbarlibrary')
1
include ':app', ':autolayout', ':xrichtextt', ':zxing', ':XRefreshView'
3 2
include ':library'
4 3
project(':xrichtextt').projectDir = new File('xrichtext')