214
				//
215
				// if (startPosition != -1
216
				// && selectionStart == endPosition) {
217
				//
218
				// Log.w("tag", "--����--" + startPosition + "---"
219
				// + endPosition);
220
				// // ѡ�л���
221
				// setSelection(startPosition, endPosition);
222
				// // ���ñ���ɫ
223
				// Editable editable = getText();
224
				// editable.setSpan(new BackgroundColorSpan(
225
				// mBackgroundColor), startPosition,
226
				// endPosition,
227
				// Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
228
				// return true;
229
				//
230
				// }
231
				// }
232
				//
233
				// }
234

235
				return false;
236
			}
237
		});
238

239
	}
240

241
	/**
242
	 * EditText�����޸�֮��ˢ��UI
243
	 * 
244
	 * @param content���������
245
	 */
246
	private void refreshEditTextUI(String content) {
247

248
		/**
249
		 * ���ݱ仯ʱ����<br/>
250
		 * 1.����ƥ�����л������� <br/>
251
		 * 2.���û�������������ɫ
252
		 */
253

254
		if (mRObjectsList.size() == 0)
255
			return;
256

257
		if (TextUtils.isEmpty(content)) {
258
			mRObjectsList.clear();
259
			return;
260
		}
261

262
		/**
263
		 * ��������span
264
		 */
265
		Editable editable = getText();
266
		int findPosition = 0;
267
		for (int i = 0; i < mRObjectsList.size(); i++) {
268
			final RObject object = mRObjectsList.get(i);
269
			String objectText = object.getObjectText();// �ı�
270
			findPosition = content.indexOf(objectText);// ��ȡ�ı���ʼ�±�
271

272
			if (findPosition != -1) {// ���û�������ǰ��ɫ����
273

274
				ForegroundColorSpan colorSpan = new ForegroundColorSpan(
275
						getResources().getColor(R.color.blue));
276
				editable.setSpan(colorSpan, findPosition, findPosition
277
						+ objectText.length(),
278
						Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
279

280
			}
281
		}
282

283
	}
284

285
	/**
286
	 * ����/���û���
287
	 * 
288
	 * @param object�������
289
	 */
290
	public void setObject(RObject object) {
291

292
		if (object == null)
293
			return;
294

295
		String objectRule = object.getObjectRule();
296
		String objectText = object.getObjectText();
297
		if (TextUtils.isEmpty(objectText) || TextUtils.isEmpty(objectRule))
298
			return;
299

300
		// ƴ���ַ�# %s #,������
301
		objectText = objectRule + objectText + objectRule;
302
		object.setObjectText(objectText);
303

304
		/**
305
		 * ��ӻ���<br/>
306
		 * 1.������������ӵ����ݼ�����<br/>
307
		 * 2.������������ӵ�EditText��չʾ
308
		 */
309

310
		/**
311
		 * 1.��ӻ������ݵ����ݼ���
312
		 */
313
		mRObjectsList.add(object);
314

315
		/**
316
		 * 2.������������ӵ�EditText��չʾ
317
		 */
318
		int selectionStart = getSelectionStart();// ����
319
		Editable editable = getText();// ԭ������
320

321
		if (selectionStart >= 0) {
322
			editable.insert(selectionStart, objectText);// �ڹ��λ�ò�������
323
			editable.insert(getSelectionStart(), " ");// ����������ո�,������Ҫ
324
			setSelection(getSelectionStart());// �ƶ���굽��ӵ����ݺ���
325
		}
326

327
	}
328

329
	/**
330
	 * ��ȡobject�б�����
331
	 */
332
	public List<RObject> getObjects() {
333
		List<RObject> objectsList = new ArrayList<RObject>();
334
		// ���ڱ���ʱ���ı����������ƥ���ַ�#,�˴�ȥ��,��ԭ����
335
		if (mRObjectsList != null && mRObjectsList.size() > 0) {
336
			for (int i = 0; i < mRObjectsList.size(); i++) {
337
				RObject object = mRObjectsList.get(i);
338
				String objectText = object.getObjectText();
339
				String objectRule = object.getObjectRule();
340
				object.setObjectText(objectText.replace(objectRule, ""));// ��ƥ������ַ��滻
341
				objectsList.add(object);
342
			}
343
		}
344
		return objectsList;
345
	}
346

347
}

+ 0 - 231
app/src/main/java/com/electric/chargingpile/view/CustomImageView.java

@ -1,231 +0,0 @@
1
package com.electric.chargingpile.view;
2
3
/**
4
 * Created by Demon on 15/8/11.
5
 */
6
7
import com.electric.chargingpile.R;
8
9
import android.content.Context;
10
import android.content.res.TypedArray;
11
import android.graphics.Bitmap;
12
import android.graphics.BitmapFactory;
13
import android.graphics.Canvas;
14
import android.graphics.Paint;
15
import android.graphics.PorterDuff;
16
import android.graphics.PorterDuffXfermode;
17
import android.graphics.RectF;
18
import android.graphics.Bitmap.Config;
19
import android.graphics.drawable.BitmapDrawable;
20
import android.graphics.drawable.Drawable;
21
import android.util.AttributeSet;
22
import android.util.Log;
23
import android.util.TypedValue;
24
import android.view.View;
25
import android.view.View.MeasureSpec;
26
27
/**
28
 * 自定义View,实现圆角,圆形等效果
29
 *
30
 * @author zhy
31
 *
32
 */
33
public class CustomImageView extends View
34
{
35
36
    /**
37
     * TYPE_CIRCLE / TYPE_ROUND
38
     */
39
    private int type;
40
    private static final int TYPE_CIRCLE = 0;
41
    private static final int TYPE_ROUND = 1;
42
43
    /**
44
     * 图片
45
     */
46
    private Bitmap mSrc;
47
48
    /**
49
     * 圆角的大小
50
     */
51
    private int mRadius;
52
53
    /**
54
     * 控件的宽度
55
     */
56
    private int mWidth;
57
    /**
58
     * 控件的高度
59
     */
60
    private int mHeight;
61
62
    public CustomImageView(Context context, AttributeSet attrs)
63
    {
64
        this(context, attrs, 0);
65
    }
66
67
    public CustomImageView(Context context)
68
    {
69
        this(context, null);
70
    }
71
72
    /**
73
     * 初始化一些自定义的参数
74
     *
75
     * @param context
76
     * @param attrs
77
     * @param defStyle
78
     */
79
    public CustomImageView(Context context, AttributeSet attrs, int defStyle)
80
    {
81
        super(context, attrs, defStyle);
82
83
        TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.CustomImageView, defStyle, 0);
84
85
        int n = a.getIndexCount();
86
        for (int i = 0; i < n; i++)
87
        {
88
            int attr = a.getIndex(i);
89
            switch (attr)
90
            {
91
                case R.styleable.CustomImageView_src:
92
                    mSrc = BitmapFactory.decodeResource(getResources(), a.getResourceId(attr, 0));
93
                    break;
94
                case R.styleable.CustomImageView_type:
95
                    type = a.getInt(attr, 0);// 默认为Circle
96
                    break;
97
                case R.styleable.CustomImageView_borderRadius:
98
                    type = a.getDimensionPixelSize(attr, (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10f,
99
                            getResources().getDisplayMetrics()));// 默认为10DP
100
                    break;
101
            }
102
        }
103
        a.recycle();
104
    }
105
106
    /**
107
     * 计算控件的高度和宽度
108
     */
109
    @Override
110
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
111
    {
112
        // super.onMeasure(widthMeasureSpec, heightMeasureSpec);
113
114
        /**
115
         * 设置宽度
116
         */
117
        int specMode = MeasureSpec.getMode(widthMeasureSpec);
118
        int specSize = MeasureSpec.getSize(widthMeasureSpec);
119
120
        if (specMode == MeasureSpec.EXACTLY)// match_parent , accurate
121
        {
122
            mWidth = specSize;
123
        } else
124
        {
125
            // 由图片决定的宽
126
            int desireByImg = getPaddingLeft() + getPaddingRight() + mSrc.getWidth();
127
            if (specMode == MeasureSpec.AT_MOST)// wrap_content
128
            {
129
                mWidth = Math.min(desireByImg, specSize);
130
            }
131
        }
132
133
        /***
134
         * 设置高度
135
         */
136
137
        specMode = MeasureSpec.getMode(heightMeasureSpec);
138
        specSize = MeasureSpec.getSize(heightMeasureSpec);
139
        if (specMode == MeasureSpec.EXACTLY)// match_parent , accurate
140
        {
141
            mHeight = specSize;
142
        } else
143
        {
144
            int desire = getPaddingTop() + getPaddingBottom() + mSrc.getHeight();
145
            if (specMode == MeasureSpec.AT_MOST)// wrap_content
146
            {
147
                mHeight = Math.min(desire, specSize);
148
            }
149
        }
150
        setMeasuredDimension(mWidth, mHeight);
151
152
    }
153
154
    /**
155
     * 绘制
156
     */
157
    @Override
158
    protected void onDraw(Canvas canvas)
159
    {
160
161
        switch (type)
162
        {
163
            // 如果是TYPE_CIRCLE绘制圆形
164
            case TYPE_CIRCLE:
165
166
                int min = Math.min(mWidth, mHeight);
167
                /**
168
                 * 长度如果不一致,按小的值进行压缩
169
                 */
170
                mSrc = Bitmap.createScaledBitmap(mSrc, min, min, false);
171
172
                canvas.drawBitmap(createCircleImage(mSrc, min), 0, 0, null);
173
                break;
174
            case TYPE_ROUND:
175
                canvas.drawBitmap(createRoundConerImage(mSrc), 0, 0, null);
176
                break;
177
178
        }
179
180
    }
181
182
    /**
183
     * 根据原图和变长绘制圆形图片
184
     *
185
     * @param source
186
     * @param min
187
     * @return
188
     */
189
    private Bitmap createCircleImage(Bitmap source, int min)
190
    {
191
        final Paint paint = new Paint();
192
        paint.setAntiAlias(true);
193
        Bitmap target = Bitmap.createBitmap(min, min, Config.ARGB_8888);
194
        /**
195
         * 产生一个同样大小的画布
196
         */
197
        Canvas canvas = new Canvas(target);
198
        /**
199
         * 首先绘制圆形
200
         */
201
        canvas.drawCircle(min / 2, min / 2, min / 2, paint);
202
        /**
203
         * 使用SRC_IN,参考上面的说明
204
         */
205
        paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
206
        /**
207
         * 绘制图片
208
         */
209
        canvas.drawBitmap(source, 0, 0, paint);
210
        return target;
211
    }
212
213
    /**
214
     * 根据原图添加圆角
215
     *
216
     * @param source
217
     * @return
218
     */
219
    private Bitmap createRoundConerImage(Bitmap source)
220
    {
221
        final Paint paint = new Paint();
222
        paint.setAntiAlias(true);
223
        Bitmap target = Bitmap.createBitmap(mWidth, mHeight, Config.ARGB_8888);
224
        Canvas canvas = new Canvas(target);
225
        RectF rect = new RectF(0, 0, source.getWidth(), source.getHeight());
226
        canvas.drawRoundRect(rect, 50f, 50f, paint);
227
        paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
228
        canvas.drawBitmap(source, 0, 0, paint);
229
        return target;
230
    }
231
}

+ 0 - 97
app/src/main/java/com/electric/chargingpile/view/RefundDialog.java

@ -1,97 +0,0 @@
1
package com.electric.chargingpile.view;
2
3
import android.app.Activity;
4
import android.content.Context;
5
import android.view.Display;
6
import android.view.LayoutInflater;
7
import android.view.View;
8
import android.view.WindowManager;
9
import android.view.inputmethod.InputMethodManager;
10
import android.widget.EditText;
11
import android.widget.FrameLayout;
12
import android.widget.LinearLayout;
13
import android.widget.TextView;
14
15
import com.electric.chargingpile.R;
16
17
/**
18
 * Created by demon on 2018/3/14.
19
 */
20
21
public class RefundDialog {
22
    private Context context;
23
    private Activity activity;
24
    private android.app.Dialog dialog;
25
    private Display display;
26
    private TextView dialog_cancel,dialog_sure;
27
    private FrameLayout dialog_bg;
28
    private EditText dialog_et;
29
30
31
    public RefundDialog(Context context,Activity activity) {
32
        this.context = context;
33
        this.activity = activity;
34
        WindowManager windowManager = (WindowManager) context
35
                .getSystemService(Context.WINDOW_SERVICE);
36
        display = windowManager.getDefaultDisplay();
37
    }
38
39
    public RefundDialog builder() {
40
        // 获取Dialog布局
41
        View view = LayoutInflater.from(context).inflate(
42
                R.layout.layout_refund_dialog, null);
43
44
        // 获取自定义Dialog布局中的控件
45
        dialog_bg = (FrameLayout) view.findViewById(R.id.dialog_bg);
46
        dialog_cancel = (TextView) view.findViewById(R.id.dialog_tv_cancel);
47
        dialog_sure = (TextView) view.findViewById(R.id.dialog_tv_sure);
48
        dialog_et = (EditText) view.findViewById(R.id.dialog_et_account);
49
50
        // 定义Dialog布局和参数
51
        dialog = new android.app.Dialog(context, R.style.AlertDialogStyle);
52
        dialog.setContentView(view);
53
54
        // 调整dialog背景大小
55
        dialog_bg.setLayoutParams(new FrameLayout.LayoutParams((int) (display
56
                .getWidth() * 0.85), LinearLayout.LayoutParams.WRAP_CONTENT));
57
58
        return this;
59
    }
60
61
    public RefundDialog setCancelable(boolean cancel) {
62
        dialog.setCancelable(cancel);
63
        dialog.setCanceledOnTouchOutside(cancel);
64
        return this;
65
    }
66
67
    public void show() {
68
        dialog_cancel.setOnClickListener(new View.OnClickListener() {
69
            @Override
70
            public void onClick(View v) {
71
                try {
72
                    hideInput();
73
                    dialog.dismiss();
74
                } catch (Exception e) {
75
                    e.printStackTrace();
76
                }
77
            }
78
        });
79
80
        dialog.show();
81
//        showInput(dialog_et);
82
83
    }
84
85
    public void hideInput() {
86
        View view = activity.getWindow().peekDecorView();
87
        if (view != null) {
88
            InputMethodManager inputmanger = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
89
            inputmanger.hideSoftInputFromWindow(view.getWindowToken(), 0);
90
        }
91
    }
92
93
    public void showInput(View view){
94
        InputMethodManager inputmanger = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
95
        inputmanger.showSoftInput(view, 0);
96
    }
97
}

+ 0 - 25
app/src/main/java/com/electric/chargingpile/view/SaundProgressIndicator.java

@ -1,25 +0,0 @@
1
package com.electric.chargingpile.view;
2
3
/**
4
 * Created by demon on 2017/5/18.
5
 */
6
7
import android.content.Context;
8
import android.util.AttributeSet;
9
import android.widget.TextView;
10
11
public class SaundProgressIndicator extends TextView {
12
13
    public SaundProgressIndicator(Context context) {
14
        this(context, null);
15
    }
16
17
    public SaundProgressIndicator(Context context, AttributeSet attrs) {
18
        this(context, attrs, 0);
19
    }
20
21
    public SaundProgressIndicator(Context context, AttributeSet attrs,
22
                                  int defStyle) {
23
        super(context, attrs, defStyle);
24
    }
25
}

+ 0 - 36
app/src/main/java/com/electric/chargingpile/view/SearchDialog.java

@ -1,36 +0,0 @@
1
package com.electric.chargingpile.view;
2

3
import com.electric.chargingpile.R;
4

5
import android.app.Dialog;
6
import android.content.Context;
7
import android.os.Bundle;
8
import android.widget.TextView;
9

10
public class SearchDialog extends Dialog {
11
	private TextView zhan, search;
12
	Context context;
13

14
	public SearchDialog(Context context) {
15
		super(context);
16
		this.context = context;
17
	}
18

19
	@Override
20
	protected void onCreate(Bundle savedInstanceState) {
21
		super.onCreate(savedInstanceState);
22
		this.setContentView(R.layout.dialog_search);
23

24
		zhan = (TextView) findViewById(R.id.dialog_search_zhan);
25
		search = (TextView) findViewById(R.id.dialog_search_address);
26
	}
27

28
	public TextView getZhan() {
29
		return zhan;
30
	}
31

32
	public TextView getSearch() {
33
		return search;
34
	}
35

36
}

+ 0 - 268
app/src/main/java/com/electric/chargingpile/view/WaterWaveView.java

@ -1,268 +0,0 @@
1
package com.electric.chargingpile.view;
2
3
import android.content.Context;
4
import android.graphics.Canvas;
5
import android.graphics.Color;
6
import android.graphics.Paint;
7
import android.graphics.Path;
8
import android.graphics.Rect;
9
import android.graphics.RectF;
10
import android.os.SystemClock;
11
import android.util.AttributeSet;
12
import android.view.View;
13
14
/**
15
 * Created by demon on 2017/6/2.
16
 */
17
18
public class WaterWaveView extends View {
19
    //边框宽度
20
    private int STROKE_WIDTH;
21
    //组件的宽,高
22
    private int width, height;
23
    /**
24
     * 进度条最大值和当前进度值
25
     */
26
    private float max, progress;
27
28
    /**
29
     * 绘制波浪的画笔
30
     */
31
    private Paint progressPaint;
32
33
    //波纹振幅与半径之比。(建议设置:<0.1)
34
    private static final float A = 0.05f;
35
    //绘制文字的画笔
36
    private Paint textPaint;
37
    //绘制边框的画笔
38
    private Paint circlePaint;
39
40
    /**
41
     * 圆弧圆心位置
42
     */
43
    private int centerX, centerY;
44
45
    //内圆所在的矩形
46
    private RectF circleRectF;
47
48
    public WaterWaveView(Context context) {
49
        super(context);
50
        init();
51
    }
52
53
    public WaterWaveView(Context context, AttributeSet attrs) {
54
        super(context, attrs);
55
        init();
56
    }
57
58
    public WaterWaveView(Context context, AttributeSet attrs, int defStyleAttr) {
59
        super(context, attrs, defStyleAttr);
60
        init();
61
    }
62
63
    //初始化
64
    private void init() {
65
        progressPaint = new Paint();
66
        progressPaint.setColor(Color.parseColor("#77cccc88"));
67
        progressPaint.setAntiAlias(true);
68
69
        textPaint = new Paint();
70
        textPaint.setColor(Color.WHITE);
71
        textPaint.setAntiAlias(true);
72
73
        circlePaint = new Paint();
74
        circlePaint.setStyle(Paint.Style.STROKE);
75
        circlePaint.setAntiAlias(true);
76
        circlePaint.setColor(Color.parseColor("#33333333"));
77
78
        autoRefresh();
79
    }
80
81
    @Override
82
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
83
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
84
85
        if (width == 0 || height == 0) {
86
            width = getWidth();
87
            height = getHeight();
88
89
            //计算圆弧半径和圆心点
90
            int circleRadius = Math.min(width, height) >> 1;
91
            STROKE_WIDTH = circleRadius / 10;
92
            circlePaint.setStrokeWidth(STROKE_WIDTH);
93
94
            centerX = width / 2;
95
            centerY = height / 2;
96
97
            VALID_RADIUS = circleRadius - STROKE_WIDTH;
98
            RADIANS_PER_X = (float) (Math.PI / VALID_RADIUS);
99
            circleRectF = new RectF(centerX - VALID_RADIUS, centerY - VALID_RADIUS,
100
                    centerX + VALID_RADIUS, centerY + VALID_RADIUS);
101
        }
102
    }
103
104
    private Rect textBounds = new Rect();
105
106
    //x方向偏移量
107
    private int xOffset;
108
109
    @Override
110
    protected void onDraw(Canvas canvas) {
111
        super.onDraw(canvas);
112
113
        //绘制圆形边框
114
        canvas.drawCircle(centerX, centerY, VALID_RADIUS + (STROKE_WIDTH >> 1), circlePaint);
115
        //绘制水波曲线
116
        canvas.drawPath(getWavePath(xOffset), progressPaint);
117
118
        //绘制文字
119
        textPaint.setTextSize(VALID_RADIUS >> 1);
120
        String text1 = String.valueOf(progress);
121
        //测量文字长度
122
        float w1 = textPaint.measureText(text1);
123
        //测量文字高度
124
        textPaint.getTextBounds("8", 0, 1, textBounds);
125
        float h1 = textBounds.height();
126
        float extraW = textPaint.measureText("8") / 3;
127
        canvas.drawText(text1, centerX - w1 / 2 - extraW, centerY + h1 / 2, textPaint);
128
129
        textPaint.setTextSize(VALID_RADIUS / 6);
130
        textPaint.getTextBounds("M", 0, 1, textBounds);
131
        float h2 = textBounds.height();
132
        canvas.drawText("M", centerX + w1 / 2 - extraW + 5, centerY - (h1 / 2 - h2), textPaint);
133
134
        String text3 = "共" + String.valueOf(max) + "M";
135
        float w3 = textPaint.measureText(text3, 0, text3.length());
136
        textPaint.getTextBounds("M", 0, 1, textBounds);
137
        float h3 = textBounds.height();
138
        canvas.drawText(text3, centerX - w3 / 2, centerY + (VALID_RADIUS >> 1) + h3 / 2, textPaint);
139
140
        String text4 = "流量剩余";
141
        float w4 = textPaint.measureText(text4, 0, text4.length());
142
        textPaint.getTextBounds(text4, 0, text4.length(), textBounds);
143
        float h4 = textBounds.height();
144
        canvas.drawText(text4, centerX - w4 / 2, centerY - (VALID_RADIUS >> 1) + h4 / 2, textPaint);
145
146
    }
147
148
    //绘制水波的路径
149
    private Path wavePath;
150
    //每一个像素对应的弧度数
151
    private float RADIANS_PER_X;
152
    //去除边框后的半径(即内圆半径)
153
    private int VALID_RADIUS;
154
155
    /**
156
     * 获取水波曲线(包含圆弧部分)的Path.
157
     *
158
     * @param xOffset x方向像素偏移量.
159
     */
160
    private Path getWavePath(int xOffset) {
161
        if (wavePath == null) {
162
            wavePath = new Path();
163
        } else {
164
            wavePath.reset();
165
        }
166
167
        float[] startPoint = new float[2];  //波浪线起点
168
        float[] endPoint = new float[2];  //波浪线终点
169
170
        for (int i = 0; i <= VALID_RADIUS * 2; i += 2) {
171
            float x = centerX - VALID_RADIUS + i;
172
            float y = (float) (centerY + VALID_RADIUS * (1.0f + A) * 2 * (0.5f - progress / max)
173
                    + VALID_RADIUS * A * Math.sin((xOffset + i) * RADIANS_PER_X));
174
175
            //只计算内圆内部的点,边框上的忽略
176
            if (calDistance(x, y, centerX, centerY) > VALID_RADIUS) {
177
                if (x < centerX) {
178
                    continue;  //左边框,继续循环
179
                } else {
180
                    break; //右边框,结束循环
181
                }
182
            }
183
184
            //第1个点
185
            if (wavePath.isEmpty()) {
186
                startPoint[0] = x;
187
                startPoint[1] = y;
188
                wavePath.moveTo(x, y);
189
            } else {
190
                wavePath.lineTo(x, y);
191
            }
192
193
            endPoint[0] = x;
194
            endPoint[1] = y;
195
        }
196
197
        if (wavePath.isEmpty()) {
198
            if (progress / max >= 0.5f) {
199
                //满格
200
                wavePath.moveTo(centerX, centerY - VALID_RADIUS);
201
                wavePath.addCircle(centerX, centerY, VALID_RADIUS, Path.Direction.CW);
202
            } else {
203
                //空格
204
                return wavePath;
205
            }
206
        } else {
207
            //添加圆弧部分
208
            float startDegree = calDegreeByPosition(startPoint[0], startPoint[1]);  //0~180
209
            float endDegree = calDegreeByPosition(endPoint[0], endPoint[1]); //180~360
210
            wavePath.arcTo(circleRectF, endDegree - 360, startDegree - (endDegree - 360));
211
        }
212
213
        return wavePath;
214
    }
215
216
    private float calDistance(float x1, float y1, float x2, float y2) {
217
        return (float) Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
218
    }
219
220
    //根据当前位置,计算出进度条已经转过的角度。
221
    private float calDegreeByPosition(float currentX, float currentY) {
222
        float a1 = (float) (Math.atan(1.0f * (centerX - currentX) / (currentY - centerY)) / Math.PI * 180);
223
        if (currentY < centerY) {
224
            a1 += 180;
225
        } else if (currentY > centerY && currentX > centerX) {
226
            a1 += 360;
227
        }
228
229
        return a1 + 90;
230
    }
231
232
    public void setMax(int max) {
233
        this.max = max;
234
        invalidate();
235
    }
236
237
    //直接设置进度值(同步)
238
    public void setProgressSync(float progress) {
239
        this.progress = progress;
240
        invalidate();
241
    }
242
243
    /**
244
     * 自动刷新页面,创造水波效果。组件销毁后该线城将自动停止。
245
     */
246
    private void autoRefresh() {
247
        new Thread(new Runnable() {
248
            @Override
249
            public void run() {
250
                while (!detached) {
251
                    xOffset += (VALID_RADIUS >> 4);
252
                    SystemClock.sleep(100);
253
                    postInvalidate();
254
                }
255
            }
256
        }).start();
257
    }
258
259
    //标记View是否已经销毁
260
    private boolean detached = false;
261
262
    @Override
263
    protected void onDetachedFromWindow() {
264
        super.onDetachedFromWindow();
265
266
        detached = true;
267
    }
268
}

+ 0 - 37
app/src/main/res/layout/baifenbi.xml

@ -1,37 +0,0 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="wrap_content"
4
    android:layout_height="wrap_content"
5
    android:padding="10dp" >
6

7
    <TextView
8
        android:id="@+id/zhuang_name"
9
        android:layout_width="wrap_content"
10
        android:layout_height="wrap_content"
11
        android:layout_alignParentBottom="true"
12
        android:layout_centerHorizontal="true"
13
        android:text="1号"
14
        android:textColor="@color/white"
15
        android:textSize="12sp" />
16

17
    <TextView
18
        android:id="@+id/zhuang_content"
19
        android:layout_width="20dp"
20
        android:layout_height="wrap_content"
21
        android:layout_above="@id/zhuang_name"
22
        android:layout_centerHorizontal="true"
23
        android:layout_marginBottom="10dp"
24
        android:background="@drawable/radius_bkg_one" />
25

26
    <TextView
27
        android:id="@+id/zhuang_baifen"
28
        android:layout_width="wrap_content"
29
        android:layout_height="wrap_content"
30
        android:layout_above="@id/zhuang_content"
31
        android:layout_centerHorizontal="true"
32
        android:layout_marginBottom="10dp"
33
        android:text="100%"
34
        android:textColor="@color/white"
35
        android:textSize="12sp" />
36

37
</RelativeLayout>

+ 0 - 108
app/src/main/res/layout/bubble_details_view.xml

@ -1,108 +0,0 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="wrap_content"
4
    android:layout_height="wrap_content"
5
    android:background="@drawable/login_edit_normal" >
6

7
    <TextView
8
        android:id="@+id/detail_name"
9
        android:layout_width="wrap_content"
10
        android:layout_height="wrap_content"
11
        android:layout_marginLeft="10dp"
12
        android:layout_marginTop="5dp"
13
        android:ellipsize="end"
14
        android:maxLines="2"
15
        android:text="国贸充电站"
16
        android:textSize="15sp" />
17

18
    <LinearLayout
19
        android:id="@+id/linear"
20
        android:layout_width="wrap_content"
21
        android:layout_height="wrap_content"
22
        android:layout_below="@id/detail_name"
23
        android:layout_marginTop="3dp"
24
        android:orientation="horizontal" >
25

26
        <TextView
27
            android:id="@+id/detail_address"
28
            android:layout_width="0dp"
29
            android:layout_weight="1"
30
            android:layout_height="wrap_content"
31
            android:layout_gravity="center_vertical"
32
            android:layout_marginLeft="10dp"
33
            android:drawableLeft="@drawable/icon_address"
34
            android:drawablePadding="2dp"
35
            android:ellipsize="end"
36
            android:maxLines="2"
37
            android:text="大望路20号万达广场"
38
            android:textColor="#dbdbdb"
39
            android:textSize="12sp" />
40

41
        <View
42
            android:layout_width="1dp"
43
            android:layout_height="14dp"
44
            android:layout_gravity="center_vertical"
45
            android:layout_marginLeft="5dp"
46
            android:layout_marginRight="5dp"
47
            android:background="#dbdbdb" />
48

49
        <TextView
50
            android:id="@+id/detail_distance"
51
            android:layout_width="wrap_content"
52
            android:layout_height="wrap_content"
53
            android:layout_gravity="center_vertical"
54

55
            android:drawablePadding="2dp"
56
            android:text="3.5km"
57
            android:textColor="#dbdbdb"
58
            android:textSize="12sp" />
59
    </LinearLayout>
60

61
    <View
62
        android:id="@+id/view_line"
63
        android:layout_width="fill_parent"
64
        android:layout_height="1dp"
65
        android:layout_below="@id/linear"
66
        android:layout_marginTop="2dp"
67
        android:background="#dbdbdb" />
68

69
    <LinearLayout
70
        android:layout_width="fill_parent"
71
        android:layout_height="wrap_content"
72
        android:layout_below="@id/view_line"
73
        android:gravity="center_vertical"
74
        android:orientation="horizontal" >
75

76
        <TextView
77
            android:id="@+id/detail_daohang"
78
            android:layout_width="fill_parent"
79
            android:layout_height="wrap_content"
80
            android:layout_weight="1"
81
            android:gravity="center"
82
            android:paddingBottom="5dp"
83
            android:paddingLeft="30dp"
84
            android:paddingRight="30dp"
85
            android:paddingTop="5dp"
86
            android:text="导航"
87
            android:textColor="@color/bkg_button_green" />
88

89
        <View
90
            android:layout_width="1dp"
91
            android:layout_height="15dp"
92
            android:background="#dbdbdb" />
93

94
        <TextView
95
            android:id="@+id/detail_yue"
96
            android:layout_width="fill_parent"
97
            android:layout_height="wrap_content"
98
            android:layout_weight="1"
99
            android:gravity="center"
100
            android:paddingBottom="5dp"
101
            android:paddingLeft="30dp"
102
            android:paddingRight="30dp"
103
            android:paddingTop="5dp"
104
            android:text="详情"
105
            android:textColor="@color/bkg_button_green" />
106
    </LinearLayout>
107

108
</RelativeLayout>

+ 0 - 64
app/src/main/res/layout/dialog_search.xml

@ -1,64 +0,0 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="730px"
4
    android:layout_height="300px"
5
    android:layout_gravity="center"
6
    android:background="@drawable/login_edit_normal"
7
    android:orientation="vertical" >
8

9

10
    <TextView
11
        android:layout_width="wrap_content"
12
        android:layout_height="0dp"
13
        android:layout_weight="1"
14
        android:background="@color/white"
15
        android:padding="10dp"
16
        android:layout_gravity="center"
17
        android:text="请选择您要搜索的类型"
18
        android:textSize="20sp" />
19

20
    <View
21
        android:layout_width="wrap_content"
22
        android:layout_height="1dp"
23
        android:background="@color/bkg_line"/>
24

25

26
    <LinearLayout
27
        android:layout_width="fill_parent"
28
        android:layout_height="0dp"
29
        android:layout_weight="0.9"
30
        android:layout_marginTop="1dp"
31
        android:orientation="horizontal" >
32

33
        <Button
34
            android:id="@+id/dialog_search_zhan"
35
            android:layout_width="wrap_content"
36
            android:layout_height="wrap_content"
37
            android:layout_weight="1"
38
            android:background="@drawable/bkg_press_white_grey"
39
             android:textColor="@color/bkg_button_green"
40
            android:text="搜站名"
41
            android:gravity="center"
42
            android:textSize="15sp"
43
            />
44

45
        <!-- 搜地址按钮 -->
46
        <View
47
            android:layout_width="1dp"
48
            android:layout_height="wrap_content"
49
            android:background="@color/bkg_line"/>
50

51
        <Button
52
            android:id="@+id/dialog_search_address"
53
            android:layout_width="wrap_content"
54
            android:layout_height="wrap_content"
55
            android:layout_weight="1"
56
            android:gravity="center"
57
            android:background="@drawable/bkg_press_white_grey"
58
            android:textColor="@color/bkg_button_green"
59
            android:text="搜地址"
60
            android:textSize="15sp" />
61

62
    </LinearLayout>
63

64
</LinearLayout>

+ 0 - 50
app/src/main/res/layout/view_actionsheet.xml

@ -1,50 +0,0 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="match_parent"
4
    android:layout_height="wrap_content"
5
    android:orientation="vertical"
6
    android:padding="8dp" >
7

8
    <TextView
9
        android:id="@+id/txt_title"
10
        android:layout_width="match_parent"
11
        android:layout_height="wrap_content"
12
        android:background="@drawable/actionsheet_top_normal"
13
        android:gravity="center"
14
        android:minHeight="45dp"
15
        android:paddingTop="10dp"
16
        android:paddingBottom="10dp"
17
        android:paddingLeft="15dp"
18
        android:paddingRight="15dp"
19
        android:textColor="@color/actionsheet_gray"
20
        android:textSize="13sp"
21
        android:visibility="gone" />
22

23
    <ScrollView
24
        android:id="@+id/sLayout_content"
25
        android:layout_width="match_parent"
26
        android:layout_height="wrap_content"
27
        android:fadingEdge="none"
28
         >
29

30
        <LinearLayout
31
            android:id="@+id/lLayout_content"
32
            android:layout_width="match_parent"
33
            android:layout_height="wrap_content"
34
            android:orientation="vertical" >
35
        </LinearLayout>
36
    </ScrollView>
37

38
    <TextView
39
        android:id="@+id/txt_cancel"
40
        android:layout_width="match_parent"
41
        android:layout_height="45dp"
42
        android:layout_marginTop="8dp"
43
        android:background="@drawable/actionsheet_single_selector"
44
        android:gravity="center"
45
        android:text="取消"
46
        android:textColor="@color/actionsheet_green"
47
        android:textSize="18sp"
48
        android:textStyle="bold" />
49

50
</LinearLayout>

+ 0 - 40
app/src/main/res/layout/view_time_pager.xml

@ -1,40 +0,0 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="match_parent"
4
    android:layout_height="match_parent"
5
    android:orientation="vertical" >
6

7
    <RadioGroup
8
        android:id="@+id/rg_time"
9
        android:layout_width="fill_parent"
10
        android:layout_height="wrap_content"
11
        android:orientation="horizontal" >
12

13
        <RadioButton
14
            android:id="@+id/rb_time_one"
15
            style="@style/appointent_time_item_style"
16
            android:layout_weight="1.0"
17
            android:checked="true"
18
            android:text="09:00-15:00" />
19

20
        <RadioButton
21
            android:id="@+id/rb_time_two"
22
            style="@style/appointent_time_item_style"
23
            android:layout_weight="1.0"
24
            android:text="15:30-23:00" />
25
    </RadioGroup>
26

27
    <GridView
28
        android:id="@+id/gv_time"
29
        android:layout_width="fill_parent"
30
        android:layout_height="wrap_content"
31
        android:layout_below="@id/rg_time"
32
        android:background="@color/transparent"
33
        android:gravity="center"
34
        android:horizontalSpacing="5dp"
35
        android:numColumns="4"
36
        android:padding="10dp"
37
        android:stretchMode="columnWidth"
38
        android:verticalSpacing="5dp" />
39

40
</RelativeLayout>

+ 0 - 6
app/src/main/res/layout/yuanjiao.xml

@ -1,6 +0,0 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:orientation="vertical" android:layout_width="match_parent"
4
    android:layout_height="match_parent">
5
6
</LinearLayout>

+ 0 - 19
app/src/main/res/layout/zoom_controls_layout.xml

@ -1,19 +0,0 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_alignWithParentIfMissing="true"
4
    android:layout_width="wrap_content"
5
    android:layout_height="wrap_content" >
6

7
    <Button
8
        android:id="@+id/zoomin"
9
        android:layout_width="wrap_content"
10
        android:layout_height="wrap_content"
11
        android:background="@drawable/zoomin_seletor" />
12

13
    <Button
14
        android:id="@+id/zoomout"
15
        android:layout_width="wrap_content"
16
        android:layout_height="wrap_content"
17
        android:layout_below="@+id/zoomin"
18
        android:background="@drawable/zoomout_seletor" />
19
</RelativeLayout>

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

@ -62,12 +62,6 @@
62 62
        <attr name="border_color" format="color" />
63 63
    </declare-styleable>
64 64

65

66
    <declare-styleable name="CustomImageView">
67
        <attr name="borderRadius" />
68
        <attr name="type" />
69
        <attr name="src" />
70
    </declare-styleable>
71 65
    <declare-styleable name="RoundAngleImageView">
72 66
        <attr name="roundWidth" format="dimension" />
73 67
        <attr name="roundHeight" format="dimension" />

+ 1 - 2
settings.gradle

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

完成评论视频详情页 · 36bde9dbe0 - Gogs: Go Git Service
Explorar el Código

完成评论视频详情页

hy %!s(int64=3) %!d(string=hace) años
padre
commit
36bde9dbe0

+ 4 - 1
app/build.gradle

@ -222,7 +222,10 @@ dependencies {
222 222
    //    compile 'com.google.zxing:android-core:+'
223 223
    implementation 'com.blankj:utilcode:1.9.8'
224 224
    implementation 'androidx.multidex:multidex:2.0.1'
225
    implementation 'com.umeng.analytics:analytics:latest.integration'
225
    
226
    implementation  'com.umeng.umsdk:common:9.4.7'// 必选
227
    implementation  'com.umeng.umsdk:asms:1.4.1'// 必选
228
226 229
    implementation 'com.google.code.gson:gson:2.8.6'
227 230
    //    compile 'com.squareup.okhttp:okhttp:3.14.0'
228 231
    implementation 'com.squareup.okhttp:okhttp:2.0.0'

+ 39 - 5
app/src/main/java/com/electric/chargingpile/activity/MainMapActivity.java

@ -88,6 +88,7 @@ import com.amap.api.services.weather.LocalWeatherLive;
88 88
import com.amap.api.services.weather.LocalWeatherLiveResult;
89 89
import com.amap.api.services.weather.WeatherSearch;
90 90
import com.amap.api.services.weather.WeatherSearchQuery;
91
import com.andview.refreshview.callback.IFooterCallBack;
91 92
import com.blankj.utilcode.util.ActivityUtils;
92 93
import com.blankj.utilcode.util.AppUtils;
93 94
import com.blankj.utilcode.util.EmptyUtils;
@ -915,6 +916,7 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
915 916
916 917
        showPostDelayedDialog();
917 918
        getSwitch();
919
        switchRecommend();
918 920
//        ConfirmOrderActivity.actionStart(this);
919 921
//        startActivity(new Intent(getApplication(), ChargingStatusActivity.class));
920 922
//        startActivity(new Intent(this, SkipUserInfoActivity.class));
@ -1365,7 +1367,7 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
1365 1367
            } catch (Exception e) {
1366 1368
                e.printStackTrace();
1367 1369
            }
1368
            onResumeRefresh = false;
1370
//            onResumeRefresh = false;
1369 1371
        }
1370 1372
        if (ProfileManager.getInstance().getRoadCondition(getApplicationContext()) == false) {
1371 1373
            iv_roadCondition.setImageResource(R.drawable.icon_wulukuang_main);
@ -4181,10 +4183,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
4181 4183
        DaoSession mDaoSession = daoMaster.newSession();
4182 4184
        zhan_listDao = mDaoSession.getZhan_listDao();
4183 4185
4184
        if (onResumeRefresh == true) {
4185
            ToastUtil.showToast(getApplicationContext(), "共" + zhan_lists.size() + "个符合条件的站点", Toast.LENGTH_SHORT);
4186
        }
4187
4188 4186
        new Thread() {
4189 4187
            public void run() {
4190 4188
                zhan_lists = zhan_listDao.queryRaw("where status = ? " + MainApplication.sql, new String[]{"4"});
@ -4242,6 +4240,12 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
4242 4240
                mClusterOverlay = new ClusterOverlay(aMap, items, dp2px(getApplicationContext(), clusterRadius), getApplicationContext());
4243 4241
                mClusterOverlay.setClusterRenderer(MainMapActivity.this);
4244 4242
                mClusterOverlay.setOnClusterClickListener(MainMapActivity.this);
4243
                hand.post(()->{
4244
                    if (onResumeRefresh == true) {
4245
                        ToastUtil.showToast(getApplicationContext(), "共" + zhan_lists.size() + "个符合条件的站点", Toast.LENGTH_SHORT);
4246
                        onResumeRefresh = false;
4247
                    }
4248
                });
4245 4249
4246 4250
            }
4247 4251
@ -5934,6 +5938,36 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
5934 5938
                    }
5935 5939
                });
5936 5940
    }
5941
5942
    private void switchRecommend() {
5943
        OkHttpUtils.get().url(MainApplication.url + "/zhannew/basic/web/index.php/zhangonggao/switchindex").build().connTimeOut(3000).readTimeOut(3000)
5944
                .execute(new StringCallback() {
5945
                    @Override
5946
                    public void onError(Call call, Exception e) {
5947
                        e.printStackTrace();
5948
                    }
5949
5950
                    @Override
5951
                    public void onResponse(String response) {
5952
                        String rtnCode = JsonUtils.getKeyResult(response, "code");
5953
                        if ("100".equals(rtnCode)) {
5954
                            String data = JsonUtils.getKeyResult(response, "data");
5955
                            if (data.equals("1")){
5956
                                iv_tuijian.setVisibility(View.VISIBLE);
5957
                                iv_tuijian.setEnabled(true);
5958
                            }else{
5959
                                iv_tuijian.setVisibility(View.INVISIBLE);
5960
                                iv_tuijian.setEnabled(false);
5961
                            }
5962
                        }else{
5963
                            iv_tuijian.setVisibility(View.INVISIBLE);
5964
                            iv_tuijian.setEnabled(false);
5965
                        }
5966
                    }
5967
                });
5968
    }
5969
5970
5937 5971
    @AfterPermissionGranted(RC_TELL_PERM)
5938 5972
    public void tellTask() {
5939 5973
        if (hasTellPermission()) {

+ 4 - 36
app/src/main/java/com/electric/chargingpile/activity/RegisterActivity.java

@ -95,7 +95,6 @@ public class RegisterActivity extends Activity implements OnClickListener {
95 95
        BarColorUtil.initStatusBarColor(RegisterActivity.this);
96 96

97 97
        initView();
98
        cameraTask();
99 98
//		getTpye();
100 99
        imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
101 100
    }
@ -453,50 +452,19 @@ public class RegisterActivity extends Activity implements OnClickListener {
453 452
            Toast.makeText(this, "请检查网络", Toast.LENGTH_SHORT).show();
454 453
            return;
455 454
        }
456
        if (hasCameraPermission()) {
457
            String imei = Util.getUdid();
458 455

459
            final String url = MainApplication.url + "/zhannew/basic/web/index.php/tpmember/add?phone=" + etPhone.getText().toString().trim() + "&sms=" + etCode.getText().toString().trim() + "&password=" + password.getText().toString().trim() + "&yqm=" + et_input_shareno.getText().toString() + "&imei=" + "android_" + imei + "&registration_id=" + MainApplication.getInstance().getPushID();
456
        String imei = Util.getUdid();
457

458
         final String url = MainApplication.url + "/zhannew/basic/web/index.php/tpmember/add?phone=" + etPhone.getText().toString().trim() + "&sms=" + etCode.getText().toString().trim() + "&password=" + password.getText().toString().trim() + "&yqm=" + et_input_shareno.getText().toString() + "&imei=" + "android_" + imei + "&registration_id=" + MainApplication.getInstance().getPushID();
460 459
            new Thread(new Runnable() {
461 460
                @Override
462 461
                public void run() {
463 462
                    submit(url);
464 463
                }
465
            }).start();
466

467
        } else {
468
            EasyPermissions.requestPermissions(
469
                    this, null,
470
                    RC_CAMERA_PERM,
471
                    Manifest.permission.READ_PHONE_STATE);
472
        }
473

474

464
        }).start();
475 465
    }
476 466

477
    @AfterPermissionGranted(RC_CAMERA_PERM)
478
    public void cameraTask() {
479
        if (hasCameraPermission()) {
480
            // Have permission, do the thing!
481
//            Toast.makeText(this, "TODO: Camera things", Toast.LENGTH_LONG).show();
482

483
        } else {
484
            // Ask for one permission
485
//            EasyPermissions.requestPermissions(
486
//                    this,null,
487
//                    RC_CAMERA_PERM,
488
//                    Manifest.permission.READ_PHONE_STATE);
489
            EasyPermissions.requestPermissions(
490
                    this,
491
                    "注册功能需要开启相关权限,是否开启?",
492
                    RC_CAMERA_PERM,
493
                    Manifest.permission.READ_PHONE_STATE);
494
        }
495
    }
496 467

497
    private boolean hasCameraPermission() {
498
        return EasyPermissions.hasPermissions(this, Manifest.permission.READ_PHONE_STATE);
499
    }
500 468

501 469
    private Handler handler = new Handler() {
502 470
        // 主线程通过这个方法处理消息

+ 31 - 5
app/src/main/java/com/electric/chargingpile/activity/UserCenterActivity.java

@ -227,6 +227,7 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
227 227
        }
228 228
        showCarDialog();
229 229
        requestWebLink();
230
        switchCarFirends();
230 231
        // ATTENTION: This was auto-generated to implement the App Indexing API.
231 232
        // See https://g.co/AppIndexing/AndroidStudio for more information.
232 233
        client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
@ -941,9 +942,11 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
941 942
//                Intent i = new Intent(getApplicationContext(), ChatActivity.class);//聊聊页面
942 943
//                i.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
943 944
//                startActivity(i);
944
                Intent i = new Intent(getApplication(), MyWebViewActivity.class);
945
                i.putExtra("url", mUrl);
946
                startActivity(i);
945
                if (!mUrl.equals("")){
946
                    Intent i = new Intent(getApplication(), MyWebViewActivity.class);
947
                    i.putExtra("url", mUrl);
948
                    startActivity(i);
949
                }
947 950
                break;
948 951
949 952
@ -1633,17 +1636,40 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
1633 1636
            @Override
1634 1637
            public void onResponse(String response) {
1635 1638
//                Log.e(TAG, "onResponse: signIn "+response );
1636
//                {"rtnCode":"01","rtnMsg":{"score":"10","log_day":"1"}}
1639
//                {"rtnCode":"01","rtnMsg":{"score":"10",r"log_day":"1"}}
1637 1640
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
1638 1641
                if (rtnCode.equals("01")) {
1639 1642
                    String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
1640 1643
                    mUrl = JsonUtils.getKeyResult(response, "data");
1641
1642 1644
                }
1643 1645
            }
1644 1646
        });
1645 1647
1646 1648
    }
1649
    private void switchCarFirends() {
1650
        OkHttpUtils.get().url(MainApplication.url + "/zhannew/basic/web/index.php/zhangonggao/switchcheyouquan").build().connTimeOut(3000).readTimeOut(3000)
1651
                .execute(new StringCallback() {
1652
                    @Override
1653
                    public void onError(Call call, Exception e) {
1654
                        e.printStackTrace();
1655
                    }
1656
1657
                    @Override
1658
                    public void onResponse(String response) {
1659
                        String rtnCode = JsonUtils.getKeyResult(response, "code");
1660
                        if ("100".equals(rtnCode)) {
1661
                            String data = JsonUtils.getKeyResult(response, "data");
1662
                            if (data.equals("1")){
1663
                                car_friends_group.setVisibility(View.VISIBLE);
1664
                            }else{
1665
                                car_friends_group.setVisibility(View.GONE);
1666
                            }
1667
                        }else{
1668
                            car_friends_group.setVisibility(View.GONE);
1669
                        }
1670
                    }
1671
                });
1672
    }
1647 1673
1648 1674
    private void showDialog(String log_day, String score, String now_temperature, String now_weather, String temperature, String city) {
1649 1675
        SignInDialog signInDialog = new SignInDialog(this);

+ 7 - 1
app/src/main/java/com/electric/chargingpile/application/MainApplication.java

@ -23,6 +23,7 @@ import com.blankj.utilcode.util.LogUtils;
23 23
import com.blankj.utilcode.util.Utils;
24 24
import com.electric.chargingpile.BuildConfig;
25 25
import com.electric.chargingpile.activity.MainMapActivity;
26
import com.electric.chargingpile.constant.AppKeyConstant;
26 27
import com.electric.chargingpile.data.AdDetail;
27 28
import com.electric.chargingpile.data.Adin;
28 29
import com.electric.chargingpile.data.CarOwnerCertificateBean;
@ -45,6 +46,7 @@ import com.nostra13.universalimageloader.core.assist.ImageScaleType;
45 46
import com.shuyu.gsyvideoplayer.GSYVideoManager;
46 47
import com.shuyu.gsyvideoplayer.model.VideoOptionModel;
47 48
import com.tencent.bugly.crashreport.CrashReport;
49
import com.umeng.commonsdk.UMConfigure;
48 50
import com.zhy.http.okhttp.OkHttpUtils;
49 51
import com.zhy.http.okhttp.callback.StringCallback;
50 52

@ -178,6 +180,7 @@ public class MainApplication extends MultiDexApplication implements CameraXConfi
178 180
//        PermissionMonitor.start(false);
179 181
        instances = this;
180 182
        setDatabase();
183
        UMConfigure.preInit(this, AppKeyConstant.UMENG_KEY,BuildConfig.FLAVOR);
181 184

182 185
        Utils.init(this);
183 186
        LogUtils.getConfig().setLogSwitch(true);
@ -422,8 +425,11 @@ public class MainApplication extends MultiDexApplication implements CameraXConfi
422 425
        AMapLocationClient.updatePrivacyAgree(context,true);
423 426
        MobSDK.init(MainApplication.context);
424 427
        MobSDK.submitPolicyGrantResult(true,null);
425
        CrashReport.initCrashReport(MainApplication.context, "900010422", BuildConfig.DEBUG);
428
        CrashReport.initCrashReport(MainApplication.context, AppKeyConstant.BUGLY_KEY, BuildConfig.DEBUG);
426 429
        CrashReport.setAppChannel(MainApplication.context, BuildConfig.FLAVOR);
430

431
        UMConfigure.init(context,UMConfigure.DEVICE_TYPE_PHONE,"");
432
        UMConfigure.setLogEnabled(BuildConfig.DEBUG);
427 433
    }
428 434

429 435
    @NonNull

+ 6 - 0
app/src/main/java/com/electric/chargingpile/constant/AppKeyConstant.java

@ -0,0 +1,6 @@
1
package com.electric.chargingpile.constant;
2
3
public class AppKeyConstant {
4
    public static final String UMENG_KEY = "54c65228fd98c583210001c9";
5
    public static final String BUGLY_KEY = "900010422";
6
}

+ 2 - 1
app/src/main/res/layout/activity_main_map.xml

@ -1684,6 +1684,7 @@
1684 1684
                tools:visibility="visible" />
1685 1685
1686 1686
            <ImageView
1687
1687 1688
                android:id="@+id/iv_tuijian"
1688 1689
                android:layout_width="wrap_content"
1689 1690
                android:layout_height="wrap_content"
@ -1691,7 +1692,7 @@
1691 1692
                android:layout_alignParentBottom="true"
1692 1693
                android:layout_marginRight="15dp"
1693 1694
                android:src="@drawable/icon_tuijian"
1694
                android:visibility="visible"
1695
                android:visibility="invisible"
1695 1696
                tools:visibility="visible" />
1696 1697
        </RelativeLayout>
1697 1698

+ 6 - 4
app/src/main/res/layout/activity_user_center.xml

@ -261,6 +261,7 @@
261 261
            android:layout_above="@+id/ll_tab">
262 262
263 263
            <LinearLayout
264
                android:layout_marginBottom="12dp"
264 265
                android:background="@drawable/bg_white_radius10"
265 266
                android:layout_marginEnd="12dp"
266 267
                android:layout_marginStart="12dp"
@ -462,10 +463,10 @@
462 463
            </LinearLayout>
463 464
464 465
            <ImageView
465
                android:layout_marginEnd="12sp"
466
                android:layout_marginStart="12sp"
467
                android:layout_marginBottom="12dp"
468
                android:layout_marginTop="12dp"
466
                android:visibility="gone"
467
                tools:visibility="visible"
468
                android:layout_marginEnd="12dp"
469
                android:layout_marginStart="12dp"
469 470
                android:id="@+id/car_friends_group"
470 471
                android:background="@drawable/car_friends_group"
471 472
                android:layout_width="match_parent"
@ -473,6 +474,7 @@
473 474
474 475
475 476
            <LinearLayout
477
                android:layout_marginTop="12dp"
476 478
                android:layout_marginBottom="20dp"
477 479
                android:layout_marginEnd="12dp"
478 480
                android:layout_marginStart="12dp"

+ 1 - 1
app/src/main/res/values/strings.xml

@ -18,7 +18,7 @@
18 18
    <string name="updated_at">上次更新于%1$s前</string>
19 19
    <string name="updated_just_now">刚刚更新</string>
20 20
    <string name="time_error">时间有问题</string>
21
    <string name="string_tab_qa">互助</string>
21
    <string name="string_tab_qa">问答</string>
22 22
23 23
24 24
    <string name="main_name">主界面</string>

+ 1 - 0
build.gradle

@ -13,6 +13,7 @@ buildscript {
13 13
        maven {url 'https://maven.aliyun.com/repository/public/'}
14 14
        maven {url 'https://maven.aliyun.com/repository/gradle-plugin/'}
15 15
        maven { url "https://www.jitpack.io" }
16
        maven { url 'https://repo1.maven.org/maven2/' }
16 17
        mavenCentral()
17 18
    }
18 19