bug修复、App更新方式更换
This commit is contained in:
parent
2077808f18
commit
8b66cb3f68
@ -797,5 +797,6 @@ public class PathConfig {
|
|||||||
public static final String ACTION_UPDATE_ERROR = "com.tenlionsoft.girdcclient.update_error";
|
public static final String ACTION_UPDATE_ERROR = "com.tenlionsoft.girdcclient.update_error";
|
||||||
public static final String ACTION_UPDATE_PROGRESS = "com.tenlionsoft.girdcclient.update_progress";
|
public static final String ACTION_UPDATE_PROGRESS = "com.tenlionsoft.girdcclient.update_progress";
|
||||||
public static final String ACTION_UPDATE_SUCCESS = "com.tenlionsoft.girdcclient.update_success";
|
public static final String ACTION_UPDATE_SUCCESS = "com.tenlionsoft.girdcclient.update_success";
|
||||||
|
public static final String ACTION_UPDATE_STAET = "com.tenlionsoft.girdcclient.update_start";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -381,15 +381,13 @@ public class HttpUtils {
|
|||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//设置拦截器
|
||||||
client.newBuilder()
|
client.newBuilder()
|
||||||
.addNetworkInterceptor(new Interceptor() { //设置拦截器
|
.addNetworkInterceptor(chain -> {
|
||||||
@Override
|
|
||||||
public Response intercept(Chain chain) throws IOException {
|
|
||||||
Response originalResponse = chain.proceed(chain.request());
|
Response originalResponse = chain.proceed(chain.request());
|
||||||
return originalResponse.newBuilder()
|
return originalResponse.newBuilder()
|
||||||
.body(new ResponseProgressBody(originalResponse.body(), downloadResponseHandler))
|
.body(new ResponseProgressBody(originalResponse.body(), downloadResponseHandler))
|
||||||
.build();
|
.build();
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.build()
|
.build()
|
||||||
.newCall(request)
|
.newCall(request)
|
||||||
|
@ -44,39 +44,22 @@ public class DownloadCallback implements Callback {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call call, final Response response) throws IOException {
|
public void onResponse(Call call, final Response response) throws IOException {
|
||||||
if(response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
File file = null;
|
File file = null;
|
||||||
try {
|
try {
|
||||||
file = saveFile(response, mFileDir, mFilename);
|
file = saveFile(response, mFileDir, mFilename);
|
||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
// LogUtils.e("onResponse saveFile fail", e);
|
// LogUtils.e("onResponse saveFile fail", e);
|
||||||
|
mHandler.post(() -> mDownloadResponseHandler.onFailure("onResponse saveFile fail." + e.toString()));
|
||||||
mHandler.post(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
mDownloadResponseHandler.onFailure("onResponse saveFile fail." + e.toString());
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
final File newFile = file;
|
final File newFile = file;
|
||||||
mHandler.post(new Runnable() {
|
mHandler.post(() -> mDownloadResponseHandler.onFinish(newFile));
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
mDownloadResponseHandler.onFinish(newFile);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
// LogUtils.e("onResponse fail status=" + response.code());
|
// LogUtils.e("onResponse fail status=" + response.code());
|
||||||
|
mHandler.post(() -> mDownloadResponseHandler.onFailure("fail status=" + response.code()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mHandler.post(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
mDownloadResponseHandler.onFailure("fail status=" + response.code());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//保存文件
|
//保存文件
|
||||||
private File saveFile(Response response, String filedir, String filename) throws IOException {
|
private File saveFile(Response response, String filedir, String filename) throws IOException {
|
||||||
InputStream is = null;
|
InputStream is = null;
|
||||||
|
@ -11,6 +11,7 @@ import com.tenlionsoft.baselib.core.network.HttpUtils;
|
|||||||
import com.tenlionsoft.baselib.core.network.response.DownloadResponseHandler;
|
import com.tenlionsoft.baselib.core.network.response.DownloadResponseHandler;
|
||||||
import com.tenlionsoft.baselib.core.network.update.utils.Constants;
|
import com.tenlionsoft.baselib.core.network.update.utils.Constants;
|
||||||
import com.tenlionsoft.baselib.core.network.update.utils.StorageUtils;
|
import com.tenlionsoft.baselib.core.network.update.utils.StorageUtils;
|
||||||
|
import com.tenlionsoft.baselib.utils.LogUtils;
|
||||||
import com.tenlionsoft.baselib.utils.ToastUtils;
|
import com.tenlionsoft.baselib.utils.ToastUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -22,6 +23,7 @@ public class DownloadService extends Service {
|
|||||||
|
|
||||||
private DownInfo downInfo;
|
private DownInfo downInfo;
|
||||||
private int oldProgress = 0;
|
private int oldProgress = 0;
|
||||||
|
private boolean mIsSuccess = true;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
@ -44,20 +46,21 @@ public class DownloadService extends Service {
|
|||||||
|
|
||||||
|
|
||||||
private void downLoadFile() {
|
private void downLoadFile() {
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.setAction(PathConfig.ACTION_UPDATE_STAET);
|
||||||
|
sendBroadcast(intent);
|
||||||
HttpUtils.getInstance().download(downInfo.getUrl(), downInfo.getSavePath(), downInfo.getApkName(),
|
HttpUtils.getInstance().download(downInfo.getUrl(), downInfo.getSavePath(), downInfo.getApkName(),
|
||||||
new DownloadResponseHandler() {
|
new DownloadResponseHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void onFinish(File download_file) {
|
public void onFinish(File download_file) {
|
||||||
|
LogUtils.e("下载成功");
|
||||||
|
if (mIsSuccess) {
|
||||||
//收起通知栏
|
//收起通知栏
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.setAction(PathConfig.ACTION_UPDATE_SUCCESS);
|
intent.setAction(PathConfig.ACTION_UPDATE_SUCCESS);
|
||||||
intent.putExtra("apkFile", download_file);
|
intent.putExtra("apkFile", download_file);
|
||||||
sendBroadcast(intent);
|
sendBroadcast(intent);
|
||||||
// NotificationBarUtil.setNotificationBarVisibility(DownloadService.this, false);
|
}
|
||||||
//安装
|
|
||||||
|
|
||||||
// notificationHelper.cancel();
|
|
||||||
|
|
||||||
stopSelf();
|
stopSelf();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +68,6 @@ public class DownloadService extends Service {
|
|||||||
public void onProgress(long currentBytes, long totalBytes) {
|
public void onProgress(long currentBytes, long totalBytes) {
|
||||||
int progress = (int) ((currentBytes * 1.0 / totalBytes) * 100);
|
int progress = (int) ((currentBytes * 1.0 / totalBytes) * 100);
|
||||||
if (progress != oldProgress) {
|
if (progress != oldProgress) {
|
||||||
// notificationHelper.updateProgress(progress);
|
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.setAction(PathConfig.ACTION_UPDATE_PROGRESS);
|
intent.setAction(PathConfig.ACTION_UPDATE_PROGRESS);
|
||||||
intent.putExtra("progress", progress);
|
intent.putExtra("progress", progress);
|
||||||
@ -76,11 +78,12 @@ public class DownloadService extends Service {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(String error_msg) {
|
public void onFailure(String error_msg) {
|
||||||
|
LogUtils.e("下载失败");
|
||||||
|
mIsSuccess = false;
|
||||||
ToastUtils.show("App下载失败,请稍后重试");
|
ToastUtils.show("App下载失败,请稍后重试");
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.setAction(PathConfig.ACTION_UPDATE_ERROR);
|
intent.setAction(PathConfig.ACTION_UPDATE_ERROR);
|
||||||
sendBroadcast(intent);
|
sendBroadcast(intent);
|
||||||
// notificationHelper.cancel();
|
|
||||||
stopSelf();
|
stopSelf();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -0,0 +1,587 @@
|
|||||||
|
package com.tenlionsoft.baselib.core.widget.views;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.Paint;
|
||||||
|
import android.graphics.Path;
|
||||||
|
import android.graphics.RectF;
|
||||||
|
import android.graphics.Typeface;
|
||||||
|
import android.text.Layout;
|
||||||
|
import android.text.SpannableString;
|
||||||
|
import android.text.StaticLayout;
|
||||||
|
import android.text.TextPaint;
|
||||||
|
import android.text.style.ForegroundColorSpan;
|
||||||
|
import android.text.style.RelativeSizeSpan;
|
||||||
|
import android.text.style.StyleSpan;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.tenlionsoft.baselib.utils.ConvertUtils;
|
||||||
|
import com.tenlionsoft.baselib.utils.LogUtils;
|
||||||
|
|
||||||
|
public class HalfCircleChartView extends View {
|
||||||
|
|
||||||
|
private Path mPath;
|
||||||
|
private Paint mPaintProgress;
|
||||||
|
private Paint mPaintProgressColor;
|
||||||
|
private Paint mColorPaint;
|
||||||
|
private Paint mPercentPaint;
|
||||||
|
private TextPaint mTextPaint;
|
||||||
|
|
||||||
|
private Paint mGrayPaint;
|
||||||
|
private int mPadding = 60;
|
||||||
|
private int mPaintWidth = 60;//画笔线宽
|
||||||
|
|
||||||
|
private RectF mRectF;
|
||||||
|
private int mWidth;
|
||||||
|
private int mHeight;
|
||||||
|
private Paint mBlackPaint;
|
||||||
|
|
||||||
|
|
||||||
|
public HalfCircleChartView(Context context) {
|
||||||
|
super(context, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public HalfCircleChartView(Context context, @Nullable AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
|
||||||
|
initView();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initView() {
|
||||||
|
|
||||||
|
mPath = new Path();
|
||||||
|
mPath.reset();
|
||||||
|
|
||||||
|
mRectF = new RectF();
|
||||||
|
|
||||||
|
|
||||||
|
mPaintProgress = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
mPaintProgress.setStrokeWidth(mPaintWidth);
|
||||||
|
mPaintProgress.setColor(Color.parseColor("#EBF0F6"));
|
||||||
|
mPaintProgress.setStyle(Paint.Style.STROKE);
|
||||||
|
mPaintProgress.setStrokeCap(Paint.Cap.ROUND);
|
||||||
|
// mPaintProgress.setAlpha(40);
|
||||||
|
mPaintProgress.setShadowLayer(6, 0, 6, Color.parseColor("#E0E0E0"));
|
||||||
|
|
||||||
|
mPaintProgressColor = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
mPaintProgressColor.setStrokeWidth(mPaintWidth);
|
||||||
|
mPaintProgressColor.setColor(Color.parseColor("#305DFD"));
|
||||||
|
mPaintProgressColor.setStyle(Paint.Style.STROKE);
|
||||||
|
mPaintProgressColor.setStrokeCap(Paint.Cap.ROUND);
|
||||||
|
// mPaintProgressColor.setShadowLayer(6, -5, 5, Color.parseColor("#C2C9E3"));
|
||||||
|
|
||||||
|
mColorPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
mColorPaint.setColor(Color.parseColor("#305DFD"));
|
||||||
|
mColorPaint.setStyle(Paint.Style.FILL);
|
||||||
|
mColorPaint.setTextAlign(Paint.Align.CENTER);
|
||||||
|
mColorPaint.setFakeBoldText(true);
|
||||||
|
mColorPaint.setTextSize(ConvertUtils.sp2px(20));
|
||||||
|
mColorPaint.setTextAlign(Paint.Align.CENTER);
|
||||||
|
mPercentPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
mPercentPaint.setColor(Color.parseColor("#305DFD"));
|
||||||
|
mPercentPaint.setStyle(Paint.Style.FILL);
|
||||||
|
mPercentPaint.setTextAlign(Paint.Align.CENTER);
|
||||||
|
mPercentPaint.setFakeBoldText(true);
|
||||||
|
mPercentPaint.setTextSize(ConvertUtils.sp2px(12));
|
||||||
|
mPercentPaint.setTextAlign(Paint.Align.CENTER);
|
||||||
|
|
||||||
|
|
||||||
|
mGrayPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
mGrayPaint.setColor(Color.parseColor("#8F8F8F"));
|
||||||
|
mGrayPaint.setStyle(Paint.Style.FILL);
|
||||||
|
mGrayPaint.setTextAlign(Paint.Align.CENTER);
|
||||||
|
mGrayPaint.setTextSize(ConvertUtils.sp2px(12));
|
||||||
|
|
||||||
|
mBlackPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
mBlackPaint.setColor(Color.BLACK);
|
||||||
|
mBlackPaint.setStyle(Paint.Style.FILL);
|
||||||
|
mBlackPaint.setStrokeWidth(10);
|
||||||
|
|
||||||
|
mTextPaint = new TextPaint();
|
||||||
|
mTextPaint.setColor(Color.parseColor("#305DFD"));
|
||||||
|
mTextPaint.setTextSize(ConvertUtils.sp2px(14));
|
||||||
|
mTextPaint.setTextAlign(Paint.Align.CENTER);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||||
|
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||||
|
mWidth = resolveSize(400, widthMeasureSpec);
|
||||||
|
mHeight = resolveSize(400, heightMeasureSpec);
|
||||||
|
setMeasuredDimension(
|
||||||
|
Math.max(getSuggestedMinimumWidth(),
|
||||||
|
resolveSize(mWidth,
|
||||||
|
widthMeasureSpec)),
|
||||||
|
Math.max(getSuggestedMinimumHeight(),
|
||||||
|
resolveSize(mHeight,
|
||||||
|
heightMeasureSpec)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDraw(Canvas canvas) {
|
||||||
|
super.onDraw(canvas);
|
||||||
|
//获取最小一边
|
||||||
|
int min = Math.min(mWidth, mHeight);
|
||||||
|
//中心点
|
||||||
|
int centerX = mWidth / 2;
|
||||||
|
int centerY = mHeight / 2;
|
||||||
|
|
||||||
|
|
||||||
|
int startY = centerY - min / 2;
|
||||||
|
int startX = centerX - min / 2;
|
||||||
|
int endY = centerY + min / 2;
|
||||||
|
int endX = centerX + min / 2;
|
||||||
|
LogUtils.e("矩形:(" + startX + ".." + startY + ")(" + endX + ".." + endY + ")");
|
||||||
|
// Rect path = new Rect(startX, startY, endX, endY);
|
||||||
|
// canvas.drawRect(path, mGrayPaint);
|
||||||
|
mRectF.set(startX + mPaintWidth, startY + mPaintWidth, endX - mPaintWidth, endY - mPaintWidth);
|
||||||
|
int offsetY = centerY - mPaintWidth;
|
||||||
|
LogUtils.e("中心点Y:" + mRectF.centerY() + "==" + centerY);
|
||||||
|
mRectF.offset(0, offsetY);
|
||||||
|
//绘制第一个环形背景
|
||||||
|
mPath.arcTo(mRectF, 180, 180);
|
||||||
|
canvas.drawPath(mPath, mPaintProgress);
|
||||||
|
|
||||||
|
//添加进度
|
||||||
|
addProgress(canvas);
|
||||||
|
//绘制文字
|
||||||
|
drawText(canvas, "70", offsetY);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void drawText(Canvas canvas, String percent, int offsetY) {
|
||||||
|
//中心点
|
||||||
|
canvas.save();
|
||||||
|
int centerX = mWidth / 2;
|
||||||
|
int centerY = mHeight / 2;
|
||||||
|
SpannableString s = makeTxt("60");
|
||||||
|
StaticLayout textLayout = new StaticLayout(s, mTextPaint, canvas.getWidth(),
|
||||||
|
Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
|
||||||
|
canvas.translate(centerX, centerY + offsetY - mPaintWidth);
|
||||||
|
textLayout.draw(canvas);
|
||||||
|
canvas.restore();
|
||||||
|
//计算文字所占大小
|
||||||
|
// Rect perRect = new Rect();
|
||||||
|
// mColorPaint.getTextBounds(percent, 0, percent.length(), perRect);
|
||||||
|
//
|
||||||
|
// Rect centRect = new Rect();
|
||||||
|
// mPercentPaint.getTextBounds("%", 0, "%".length(), centRect);
|
||||||
|
// //文字所占长宽
|
||||||
|
// int strWidth = perRect.width() + centRect.width();
|
||||||
|
// LogUtils.e("文字所占宽度:" + strWidth);
|
||||||
|
// int strHeight = perRect.height();
|
||||||
|
//
|
||||||
|
// canvas.drawText(percent, centerX - strWidth / 2, centerY + perRect.height() / 2 + offsetY - mPaintWidth,
|
||||||
|
// mColorPaint);//绘制占比数字
|
||||||
|
//
|
||||||
|
// canvas.drawText("%", centerX + perRect.width() / 2, centerY + centRect.height() + offsetY - mPaintWidth,
|
||||||
|
// mPercentPaint);//绘制百分号
|
||||||
|
// canvas.drawPoint(centerX, centerY + offsetY - mPaintWidth, mBlackPaint);
|
||||||
|
//
|
||||||
|
// Rect re = new Rect();
|
||||||
|
// String s = "重点青少年占比";
|
||||||
|
// mGrayPaint.getTextBounds(s, 0, s.length(), re);
|
||||||
|
// canvas.drawText(s, centerX - re.width() / 2,
|
||||||
|
// centerY + strHeight + re.height() / 2 + 10 + offsetY - mPaintWidth, mGrayPaint);
|
||||||
|
}
|
||||||
|
|
||||||
|
private SpannableString makeTxt(String str) {
|
||||||
|
String content = str + "%\n重点青少年占比";
|
||||||
|
SpannableString s = new SpannableString(content);
|
||||||
|
s.setSpan(new StyleSpan(Typeface.BOLD), 0, content.indexOf("重"), 0);
|
||||||
|
s.setSpan(new ForegroundColorSpan(Color.parseColor("#2F5CFB")), 0, content.indexOf("重"), 0);
|
||||||
|
s.setSpan(new RelativeSizeSpan(1.3f), 0, content.indexOf("重"), 0);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void addProgress(Canvas canvas) {
|
||||||
|
Path mPathProgress = new Path();
|
||||||
|
mPathProgress.reset();
|
||||||
|
//70%的进度
|
||||||
|
float progress = 0.7f;
|
||||||
|
float sweepAngle = progress * 180;
|
||||||
|
mPathProgress.arcTo(mRectF, 180, sweepAngle);
|
||||||
|
canvas.drawPath(mPathProgress, mPaintProgressColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Android Canvas沿着Path绘制文字
|
||||||
|
// private void addTextPath(Canvas canvas) {
|
||||||
|
//
|
||||||
|
// int startAngle = 135; //开始角度
|
||||||
|
// int sweepAngle = 45; //总共 270度角,分6次则为 45度
|
||||||
|
//
|
||||||
|
// String[] content = {"0-10W", "10-20W", "20-30W", "30-40W", "40-50W", "50W+"};
|
||||||
|
// Paint mTextPaint = new Paint();
|
||||||
|
// mTextPaint.setColor(Color.BLACK);
|
||||||
|
// mTextPaint.setTextSize(40);
|
||||||
|
// Path path = null;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// for (int i = 0; i < 6; i++) {
|
||||||
|
// path = new Path();
|
||||||
|
// path.addArc(mRectF2, startAngle, sweepAngle);
|
||||||
|
// float textLength = mTextPaint.measureText(content[i]);//获得字体长度
|
||||||
|
// float hOffset = (float) (mDiam2 * Math.PI * (sweepAngle * 1.0 / 360) / 2 - textLength / 2);//The
|
||||||
|
// distance along the path
|
||||||
|
// float vOffset = (float) (mDiam2 / 2 / 6); //垂直路径方向上的偏移
|
||||||
|
// canvas.drawTextOnPath(content[i], path, hOffset, vOffset, mTextPaint);
|
||||||
|
//
|
||||||
|
//// Log.d("Circle", "hOffset:" + hOffset + " vOffset: " + vOffset);
|
||||||
|
// startAngle += sweepAngle;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// private void addKeDu1(Canvas canvas) {
|
||||||
|
//
|
||||||
|
// int pointX = 500;
|
||||||
|
// int pointY = 500;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Paint paintLine = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
// paintLine.setColor(0xff454545);
|
||||||
|
// paintLine.setStrokeWidth(12);
|
||||||
|
//
|
||||||
|
// Paint paintLine2 = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
// paintLine.setColor(0xff454545);
|
||||||
|
// paintLine.setStrokeWidth(4);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// float angle = 45;
|
||||||
|
// //刻度直径
|
||||||
|
// int radius = 800 - 40;
|
||||||
|
// int length = 80; //刻度线长度
|
||||||
|
//
|
||||||
|
// int px_a1 = (int) (radius / 2 * Math.cos(Math.PI * angle / 180));
|
||||||
|
// int py_a1 = (int) (radius / 2 * Math.sin(Math.PI * angle / 180));
|
||||||
|
// int px_a_1 = pointX - px_a1;
|
||||||
|
// int py_a_1 = pointY + py_a1;
|
||||||
|
//
|
||||||
|
// int radius2 = radius - length;
|
||||||
|
// int px_a2 = (int) (radius2 / 2 * Math.cos(Math.PI * angle / 180));
|
||||||
|
// int py_a2 = (int) (radius2 / 2 * Math.sin(Math.PI * angle / 180));
|
||||||
|
// int px_a_2 = pointX - px_a2;
|
||||||
|
// int py_a_2 = pointY + py_a2;
|
||||||
|
//
|
||||||
|
// //绘制粗刻度线
|
||||||
|
// canvas.drawLine(px_a_1, py_a_1, px_a_2, py_a_2, paintLine);
|
||||||
|
//
|
||||||
|
// //绘制细刻度线
|
||||||
|
// int length2 = 50;
|
||||||
|
// for (int i = 1; i < 9; i++) {
|
||||||
|
//
|
||||||
|
// float angle2 = 45 - (i * 45 / 9);
|
||||||
|
// int px_a3 = (int) (radius / 2 * Math.cos(Math.PI * angle2 / 180));
|
||||||
|
// int py_a3 = (int) (radius / 2 * Math.sin(Math.PI * angle2 / 180));
|
||||||
|
// int px_a_3 = pointX - px_a3;
|
||||||
|
// int py_a_3 = pointY + py_a3;
|
||||||
|
//
|
||||||
|
// int radius3 = radius - length2;
|
||||||
|
// int px_a4 = (int) (radius3 / 2 * Math.cos(Math.PI * angle2 / 180));
|
||||||
|
// int py_a4 = (int) (radius3 / 2 * Math.sin(Math.PI * angle2 / 180));
|
||||||
|
// int px_a_4 = pointX - px_a4;
|
||||||
|
// int py_a_4 = pointY + py_a4;
|
||||||
|
//
|
||||||
|
// canvas.drawLine(px_a_3, py_a_3, px_a_4, py_a_4, paintLine2);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private void addKeDu2(Canvas canvas) {
|
||||||
|
//
|
||||||
|
// int pointX = 500;
|
||||||
|
// int pointY = 500;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Paint paintLine = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
// paintLine.setColor(0xff454545);
|
||||||
|
// paintLine.setStrokeWidth(12);
|
||||||
|
//
|
||||||
|
// Paint paintLine2 = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
// paintLine.setColor(0xff454545);
|
||||||
|
// paintLine.setStrokeWidth(4);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// float angle = 0;
|
||||||
|
// int radius = 800 - 40;
|
||||||
|
// int length = 80;
|
||||||
|
//
|
||||||
|
// int px_a1 = (int) (radius / 2 * Math.cos(Math.PI * angle / 180));
|
||||||
|
// int py_a1 = (int) (radius / 2 * Math.sin(Math.PI * angle / 180));
|
||||||
|
// int px_a_1 = pointX - px_a1;
|
||||||
|
// int py_a_1 = pointY + py_a1;
|
||||||
|
//
|
||||||
|
// int radius2 = radius - length;
|
||||||
|
// int px_a2 = (int) (radius2 / 2 * Math.cos(Math.PI * angle / 180));
|
||||||
|
// int py_a2 = (int) (radius2 / 2 * Math.sin(Math.PI * angle / 180));
|
||||||
|
// int px_a_2 = pointX - px_a2;
|
||||||
|
// int py_a_2 = pointY + py_a2;
|
||||||
|
//
|
||||||
|
// canvas.drawLine(px_a_1, py_a_1, px_a_2, py_a_2, paintLine);
|
||||||
|
//
|
||||||
|
// int length2 = 50;
|
||||||
|
// for (int i = 1; i < 9; i++) {
|
||||||
|
//
|
||||||
|
// float angle2 = angle + (i * 45 / 9);
|
||||||
|
// int px_a3 = (int) (radius / 2 * Math.cos(Math.PI * angle2 / 180));
|
||||||
|
// int py_a3 = (int) (radius / 2 * Math.sin(Math.PI * angle2 / 180));
|
||||||
|
// int px_a_3 = pointX - px_a3;
|
||||||
|
// int py_a_3 = pointY - py_a3;
|
||||||
|
//
|
||||||
|
// int radius3 = radius - length2;
|
||||||
|
// int px_a4 = (int) (radius3 / 2 * Math.cos(Math.PI * angle2 / 180));
|
||||||
|
// int py_a4 = (int) (radius3 / 2 * Math.sin(Math.PI * angle2 / 180));
|
||||||
|
// int px_a_4 = pointX - px_a4;
|
||||||
|
// int py_a_4 = pointY - py_a4;
|
||||||
|
//
|
||||||
|
// canvas.drawLine(px_a_3, py_a_3, px_a_4, py_a_4, paintLine2);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private void addKeDu3(Canvas canvas) {
|
||||||
|
//
|
||||||
|
// int pointX = 500;
|
||||||
|
// int pointY = 500;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Paint paintLine = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
// paintLine.setColor(0xff454545);
|
||||||
|
// paintLine.setStrokeWidth(12);
|
||||||
|
//
|
||||||
|
// Paint paintLine2 = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
// paintLine.setColor(0xff454545);
|
||||||
|
// paintLine.setStrokeWidth(4);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// float angle = 45;
|
||||||
|
// int radius = 800 - 40;
|
||||||
|
// int length = 80;
|
||||||
|
//
|
||||||
|
// int px_a1 = (int) (radius / 2 * Math.cos(Math.PI * angle / 180));
|
||||||
|
// int py_a1 = (int) (radius / 2 * Math.sin(Math.PI * angle / 180));
|
||||||
|
// int px_a_1 = pointX - px_a1;
|
||||||
|
// int py_a_1 = pointY - py_a1;
|
||||||
|
//
|
||||||
|
// int radius2 = radius - length;
|
||||||
|
// int px_a2 = (int) (radius2 / 2 * Math.cos(Math.PI * angle / 180));
|
||||||
|
// int py_a2 = (int) (radius2 / 2 * Math.sin(Math.PI * angle / 180));
|
||||||
|
// int px_a_2 = pointX - px_a2;
|
||||||
|
// int py_a_2 = pointY - py_a2;
|
||||||
|
//
|
||||||
|
// canvas.drawLine(px_a_1, py_a_1, px_a_2, py_a_2, paintLine);
|
||||||
|
//
|
||||||
|
// int length2 = 50;
|
||||||
|
// for (int i = 1; i < 9; i++) {
|
||||||
|
//
|
||||||
|
// float angle2 = angle + (i * 45 / 9);
|
||||||
|
// int px_a3 = (int) (radius / 2 * Math.cos(Math.PI * angle2 / 180));
|
||||||
|
// int py_a3 = (int) (radius / 2 * Math.sin(Math.PI * angle2 / 180));
|
||||||
|
// int px_a_3 = pointX - px_a3;
|
||||||
|
// int py_a_3 = pointY - py_a3;
|
||||||
|
//
|
||||||
|
// int radius3 = radius - length2;
|
||||||
|
// int px_a4 = (int) (radius3 / 2 * Math.cos(Math.PI * angle2 / 180));
|
||||||
|
// int py_a4 = (int) (radius3 / 2 * Math.sin(Math.PI * angle2 / 180));
|
||||||
|
// int px_a_4 = pointX - px_a4;
|
||||||
|
// int py_a_4 = pointY - py_a4;
|
||||||
|
//
|
||||||
|
// canvas.drawLine(px_a_3, py_a_3, px_a_4, py_a_4, paintLine2);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private void addKeDu4(Canvas canvas) {
|
||||||
|
//
|
||||||
|
// int pointX = 500;
|
||||||
|
// int pointY = 500;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Paint paintLine = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
// paintLine.setColor(0xff454545);
|
||||||
|
// paintLine.setStrokeWidth(12);
|
||||||
|
//
|
||||||
|
// Paint paintLine2 = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
// paintLine.setColor(0xff454545);
|
||||||
|
// paintLine.setStrokeWidth(4);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// float angle = 90;
|
||||||
|
// int radius = 800 - 40;
|
||||||
|
// int length = 80;
|
||||||
|
//
|
||||||
|
// int px_a1 = (int) (radius / 2 * Math.cos(Math.PI * angle / 180));
|
||||||
|
// int py_a1 = (int) (radius / 2 * Math.sin(Math.PI * angle / 180));
|
||||||
|
// int px_a_1 = pointX - px_a1;
|
||||||
|
// int py_a_1 = pointY - py_a1;
|
||||||
|
//
|
||||||
|
// int radius2 = radius - length;
|
||||||
|
// int px_a2 = (int) (radius2 / 2 * Math.cos(Math.PI * angle / 180));
|
||||||
|
// int py_a2 = (int) (radius2 / 2 * Math.sin(Math.PI * angle / 180));
|
||||||
|
// int px_a_2 = pointX - px_a2;
|
||||||
|
// int py_a_2 = pointY - py_a2;
|
||||||
|
//
|
||||||
|
// canvas.drawLine(px_a_1, py_a_1, px_a_2, py_a_2, paintLine);
|
||||||
|
//
|
||||||
|
// int length2 = 50;
|
||||||
|
// for (int i = 1; i < 9; i++) {
|
||||||
|
//
|
||||||
|
// float angle2 = angle + (i * 45 / 9);
|
||||||
|
// int px_a3 = (int) (radius / 2 * Math.cos(Math.PI * angle2 / 180));
|
||||||
|
// int py_a3 = (int) (radius / 2 * Math.sin(Math.PI * angle2 / 180));
|
||||||
|
// int px_a_3 = pointX - px_a3;
|
||||||
|
// int py_a_3 = pointY - py_a3;
|
||||||
|
//
|
||||||
|
// int radius3 = radius - length2;
|
||||||
|
// int px_a4 = (int) (radius3 / 2 * Math.cos(Math.PI * angle2 / 180));
|
||||||
|
// int py_a4 = (int) (radius3 / 2 * Math.sin(Math.PI * angle2 / 180));
|
||||||
|
// int px_a_4 = pointX - px_a4;
|
||||||
|
// int py_a_4 = pointY - py_a4;
|
||||||
|
//
|
||||||
|
// canvas.drawLine(px_a_3, py_a_3, px_a_4, py_a_4, paintLine2);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private void addKeDu5(Canvas canvas) {
|
||||||
|
//
|
||||||
|
// int pointX = 500;
|
||||||
|
// int pointY = 500;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Paint paintLine = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
// paintLine.setColor(0xff454545);
|
||||||
|
// paintLine.setStrokeWidth(12);
|
||||||
|
//
|
||||||
|
// Paint paintLine2 = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
// paintLine.setColor(0xff454545);
|
||||||
|
// paintLine.setStrokeWidth(4);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// float angle = 135;
|
||||||
|
// int radius = 800 - 40;
|
||||||
|
// int length = 80;
|
||||||
|
//
|
||||||
|
// int px_a1 = (int) (radius / 2 * Math.cos(Math.PI * angle / 180));
|
||||||
|
// int py_a1 = (int) (radius / 2 * Math.sin(Math.PI * angle / 180));
|
||||||
|
// int px_a_1 = pointX - px_a1;
|
||||||
|
// int py_a_1 = pointY - py_a1;
|
||||||
|
//
|
||||||
|
// int radius2 = radius - length;
|
||||||
|
// int px_a2 = (int) (radius2 / 2 * Math.cos(Math.PI * angle / 180));
|
||||||
|
// int py_a2 = (int) (radius2 / 2 * Math.sin(Math.PI * angle / 180));
|
||||||
|
// int px_a_2 = pointX - px_a2;
|
||||||
|
// int py_a_2 = pointY - py_a2;
|
||||||
|
//
|
||||||
|
// canvas.drawLine(px_a_1, py_a_1, px_a_2, py_a_2, paintLine);
|
||||||
|
//
|
||||||
|
// int length2 = 50;
|
||||||
|
// for (int i = 1; i < 9; i++) {
|
||||||
|
//
|
||||||
|
// float angle2 = angle + (i * 45 / 9);
|
||||||
|
// int px_a3 = (int) (radius / 2 * Math.cos(Math.PI * angle2 / 180));
|
||||||
|
// int py_a3 = (int) (radius / 2 * Math.sin(Math.PI * angle2 / 180));
|
||||||
|
// int px_a_3 = pointX - px_a3;
|
||||||
|
// int py_a_3 = pointY - py_a3;
|
||||||
|
//
|
||||||
|
// int radius3 = radius - length2;
|
||||||
|
// int px_a4 = (int) (radius3 / 2 * Math.cos(Math.PI * angle2 / 180));
|
||||||
|
// int py_a4 = (int) (radius3 / 2 * Math.sin(Math.PI * angle2 / 180));
|
||||||
|
// int px_a_4 = pointX - px_a4;
|
||||||
|
// int py_a_4 = pointY - py_a4;
|
||||||
|
//
|
||||||
|
// canvas.drawLine(px_a_3, py_a_3, px_a_4, py_a_4, paintLine2);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private void addKeDu6(Canvas canvas) {
|
||||||
|
//
|
||||||
|
// int pointX = 500;
|
||||||
|
// int pointY = 500;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Paint paintLine = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
// paintLine.setColor(0xff454545);
|
||||||
|
// paintLine.setStrokeWidth(12);
|
||||||
|
//
|
||||||
|
// Paint paintLine2 = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
// paintLine.setColor(0xff454545);
|
||||||
|
// paintLine.setStrokeWidth(4);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// float angle = 180;
|
||||||
|
// int radius = 800 - 40;
|
||||||
|
// int length = 80;
|
||||||
|
//
|
||||||
|
// int px_a1 = (int) (radius / 2 * Math.cos(Math.PI * angle / 180));
|
||||||
|
// int py_a1 = (int) (radius / 2 * Math.sin(Math.PI * angle / 180));
|
||||||
|
// int px_a_1 = pointX - px_a1;
|
||||||
|
// int py_a_1 = pointY - py_a1;
|
||||||
|
//
|
||||||
|
// int radius2 = radius - length;
|
||||||
|
// int px_a2 = (int) (radius2 / 2 * Math.cos(Math.PI * angle / 180));
|
||||||
|
// int py_a2 = (int) (radius2 / 2 * Math.sin(Math.PI * angle / 180));
|
||||||
|
// int px_a_2 = pointX - px_a2;
|
||||||
|
// int py_a_2 = pointY - py_a2;
|
||||||
|
//
|
||||||
|
// canvas.drawLine(px_a_1, py_a_1, px_a_2, py_a_2, paintLine);
|
||||||
|
//
|
||||||
|
// int length2 = 50;
|
||||||
|
// for (int i = 1; i < 9; i++) {
|
||||||
|
//
|
||||||
|
// float angle2 = angle + (i * 45 / 9);
|
||||||
|
// int px_a3 = (int) (radius / 2 * Math.cos(Math.PI * angle2 / 180));
|
||||||
|
// int py_a3 = (int) (radius / 2 * Math.sin(Math.PI * angle2 / 180));
|
||||||
|
// int px_a_3 = pointX - px_a3;
|
||||||
|
// int py_a_3 = pointY - py_a3;
|
||||||
|
//
|
||||||
|
// int radius3 = radius - length2;
|
||||||
|
// int px_a4 = (int) (radius3 / 2 * Math.cos(Math.PI * angle2 / 180));
|
||||||
|
// int py_a4 = (int) (radius3 / 2 * Math.sin(Math.PI * angle2 / 180));
|
||||||
|
// int px_a_4 = pointX - px_a4;
|
||||||
|
// int py_a_4 = pointY - py_a4;
|
||||||
|
//
|
||||||
|
// canvas.drawLine(px_a_3, py_a_3, px_a_4, py_a_4, paintLine2);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private void addEndKeDu(Canvas canvas) {
|
||||||
|
// int pointX = 500;
|
||||||
|
// int pointY = 500;
|
||||||
|
//
|
||||||
|
// Paint paintLine = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
// paintLine.setColor(0xff454545);
|
||||||
|
// paintLine.setStrokeWidth(12);
|
||||||
|
//
|
||||||
|
// Paint paintLine2 = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
// paintLine.setColor(0xff454545);
|
||||||
|
// paintLine.setStrokeWidth(4);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// float angle = 225;
|
||||||
|
// int radius = 800 - 40;
|
||||||
|
// int length = 80;
|
||||||
|
//
|
||||||
|
// int px_a1 = (int) (radius / 2 * Math.cos(Math.PI * angle / 180));
|
||||||
|
// int py_a1 = (int) (radius / 2 * Math.sin(Math.PI * angle / 180));
|
||||||
|
// int px_a_1 = pointX - px_a1;
|
||||||
|
// int py_a_1 = pointY - py_a1;
|
||||||
|
//
|
||||||
|
// int radius2 = radius - length;
|
||||||
|
// int px_a2 = (int) (radius2 / 2 * Math.cos(Math.PI * angle / 180));
|
||||||
|
// int py_a2 = (int) (radius2 / 2 * Math.sin(Math.PI * angle / 180));
|
||||||
|
// int px_a_2 = pointX - px_a2;
|
||||||
|
// int py_a_2 = pointY - py_a2;
|
||||||
|
//
|
||||||
|
// canvas.drawLine(px_a_1, py_a_1, px_a_2, py_a_2, paintLine);
|
||||||
|
// }
|
||||||
|
}
|
@ -49,7 +49,7 @@ public class ExceptionHandler {
|
|||||||
} else if (throwable instanceof SocketTimeoutException) {
|
} else if (throwable instanceof SocketTimeoutException) {
|
||||||
ToastUtils.show("网络连接超时");
|
ToastUtils.show("网络连接超时");
|
||||||
} else {
|
} else {
|
||||||
ToastUtils.show("网络错误,请稍后重试(500)");
|
ToastUtils.show("服务器发生错误(500)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,8 +58,8 @@ ext {
|
|||||||
gCompileSdkVersion = 30
|
gCompileSdkVersion = 30
|
||||||
gMinSdkVersion = 21
|
gMinSdkVersion = 21
|
||||||
gTargetSdkVersion = 30
|
gTargetSdkVersion = 30
|
||||||
gVersionCode = 14
|
gVersionCode = 15
|
||||||
gVersionName = '1.1.3'
|
gVersionName = '1.1.4'
|
||||||
gBuildToolsVersion = "29.0.2"
|
gBuildToolsVersion = "29.0.2"
|
||||||
// gVersionCode=26
|
// gVersionCode=26
|
||||||
// gVersionName='1.3.0'
|
// gVersionName='1.3.0'
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.tengshisoft.commonmodule.activitys.usercenter;
|
package com.tengshisoft.commonmodule.activitys.usercenter;
|
||||||
|
|
||||||
|
import static android.app.Activity.RESULT_OK;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@ -19,6 +21,9 @@ import android.widget.ImageView;
|
|||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.core.content.FileProvider;
|
||||||
|
|
||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
import com.alibaba.android.arouter.launcher.ARouter;
|
import com.alibaba.android.arouter.launcher.ARouter;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
@ -26,7 +31,6 @@ import com.bumptech.glide.load.resource.bitmap.CircleCrop;
|
|||||||
import com.bumptech.glide.request.RequestOptions;
|
import com.bumptech.glide.request.RequestOptions;
|
||||||
import com.github.promeg.pinyinhelper.Pinyin;
|
import com.github.promeg.pinyinhelper.Pinyin;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.tenlionsoft.baselib.utils.ToastUtils;
|
|
||||||
import com.tengshisoft.commonmodule.R;
|
import com.tengshisoft.commonmodule.R;
|
||||||
import com.tengshisoft.commonmodule.R2;
|
import com.tengshisoft.commonmodule.R2;
|
||||||
import com.tengshisoft.commonmodule.beans.ChangePwdBean;
|
import com.tengshisoft.commonmodule.beans.ChangePwdBean;
|
||||||
@ -61,6 +65,7 @@ import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
|||||||
import com.tenlionsoft.baselib.utils.FileUtils;
|
import com.tenlionsoft.baselib.utils.FileUtils;
|
||||||
import com.tenlionsoft.baselib.utils.LogUtils;
|
import com.tenlionsoft.baselib.utils.LogUtils;
|
||||||
import com.tenlionsoft.baselib.utils.ProiderUtil;
|
import com.tenlionsoft.baselib.utils.ProiderUtil;
|
||||||
|
import com.tenlionsoft.baselib.utils.ToastUtils;
|
||||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||||
|
|
||||||
@ -70,8 +75,6 @@ import java.util.Collections;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.core.content.FileProvider;
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import butterknife.Unbinder;
|
import butterknife.Unbinder;
|
||||||
@ -85,8 +88,6 @@ import okhttp3.RequestBody;
|
|||||||
import top.zibin.luban.Luban;
|
import top.zibin.luban.Luban;
|
||||||
import top.zibin.luban.OnCompressListener;
|
import top.zibin.luban.OnCompressListener;
|
||||||
|
|
||||||
import static android.app.Activity.RESULT_OK;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 作者: Adam
|
* 作者: Adam
|
||||||
* 日期: 2019/7/30 - 09:31
|
* 日期: 2019/7/30 - 09:31
|
||||||
@ -267,7 +268,8 @@ public class UserCenterFragment extends BaseFragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Collator collator = Collator.getInstance(Locale.ENGLISH);
|
Collator collator = Collator.getInstance(Locale.ENGLISH);
|
||||||
Collections.sort(mUserDatabaseBeanList, (o1, o2) -> collator.compare(o1.getPinYin(), o2.getPinYin()));
|
Collections.sort(mUserDatabaseBeanList, (o1, o2) -> collator.compare(o1.getPinYin(),
|
||||||
|
o2.getPinYin()));
|
||||||
++mCount;
|
++mCount;
|
||||||
if (mCount == 2) {
|
if (mCount == 2) {
|
||||||
insertAll();
|
insertAll();
|
||||||
@ -493,7 +495,8 @@ public class UserCenterFragment extends BaseFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(File file) {
|
public void onSuccess(File file) {
|
||||||
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||||
MultipartBody.Part body = MultipartBody.Part.createFormData("image", file.getName(), requestFile);
|
MultipartBody.Part body = MultipartBody.Part.createFormData("image", file.getName(),
|
||||||
|
requestFile);
|
||||||
RetrofitManager.getInstance()
|
RetrofitManager.getInstance()
|
||||||
.create(BaseApiService.class)
|
.create(BaseApiService.class)
|
||||||
.uploadImage(body, UserLgUtils.getToken())
|
.uploadImage(body, UserLgUtils.getToken())
|
||||||
@ -609,7 +612,8 @@ public class UserCenterFragment extends BaseFragment {
|
|||||||
if (!TextUtils.isEmpty(baseUserBean.getData())) {
|
if (!TextUtils.isEmpty(baseUserBean.getData())) {
|
||||||
byte[] decode = Base64.decode(baseUserBean.getData(), Base64.DEFAULT);
|
byte[] decode = Base64.decode(baseUserBean.getData(), Base64.DEFAULT);
|
||||||
try {
|
try {
|
||||||
String loginUserInfo = AesUtil.aesCommonDecoder(PathConfig.SECRET, new String(decode, "UTF-8"));
|
String loginUserInfo = AesUtil.aesCommonDecoder(PathConfig.SECRET, new String(decode,
|
||||||
|
"UTF-8"));
|
||||||
LogUtils.e(loginUserInfo);
|
LogUtils.e(loginUserInfo);
|
||||||
if (!TextUtils.isEmpty(loginUserInfo)) {
|
if (!TextUtils.isEmpty(loginUserInfo)) {
|
||||||
AppTokenUser appTokenUser = gson.fromJson(loginUserInfo, AppTokenUser.class);
|
AppTokenUser appTokenUser = gson.fromJson(loginUserInfo, AppTokenUser.class);
|
||||||
@ -686,7 +690,8 @@ public class UserCenterFragment extends BaseFragment {
|
|||||||
* 初始化视图
|
* 初始化视图
|
||||||
*/
|
*/
|
||||||
private void initContentView() {
|
private void initContentView() {
|
||||||
mCachePath = mHomeActivity.getExternalFilesDir(Environment.DIRECTORY_PICTURES).getAbsolutePath() + File.separator;
|
mCachePath =
|
||||||
|
mHomeActivity.getExternalFilesDir(Environment.DIRECTORY_PICTURES).getAbsolutePath() + File.separator;
|
||||||
mTvCacheNum.setText(FileUtils.getDirSize(mCachePath));
|
mTvCacheNum.setText(FileUtils.getDirSize(mCachePath));
|
||||||
mTvVersionNum.setText("v " + AppUtils.getAppVersionName());
|
mTvVersionNum.setText("v " + AppUtils.getAppVersionName());
|
||||||
mTvUserName.setText(UserLgUtils.getName());
|
mTvUserName.setText(UserLgUtils.getName());
|
||||||
@ -752,7 +757,7 @@ public class UserCenterFragment extends BaseFragment {
|
|||||||
* 开始下载Apk
|
* 开始下载Apk
|
||||||
*/
|
*/
|
||||||
private void startDownloadApk() {
|
private void startDownloadApk() {
|
||||||
mHomeActivity.showUpdate();
|
// mHomeActivity.showUpdate();
|
||||||
ToastUtils.show("检测到新版本,开始下载.");
|
ToastUtils.show("检测到新版本,开始下载.");
|
||||||
Intent intent = new Intent(mActivity, DownloadService.class);
|
Intent intent = new Intent(mActivity, DownloadService.class);
|
||||||
intent.putExtra(Constants.APK_DOWNLOAD_URL, BaseUrlApi.APP_DOWNLOAD_URL);
|
intent.putExtra(Constants.APK_DOWNLOAD_URL, BaseUrlApi.APP_DOWNLOAD_URL);
|
||||||
|
@ -139,11 +139,10 @@ public class PopulaceGridStatisticsFragment extends BaseFragment {
|
|||||||
*/
|
*/
|
||||||
private void setYoungData(String per) {
|
private void setYoungData(String per) {
|
||||||
Double aDouble = Double.valueOf(per);
|
Double aDouble = Double.valueOf(per);
|
||||||
Double youngPer = aDouble / 100;
|
Double surplus = 100 - aDouble;
|
||||||
Double surplus = 100 - youngPer;
|
LogUtils.e("占比:" + aDouble + "\n剩余:" + surplus);
|
||||||
LogUtils.e("占比:" + youngPer + "\n剩余:" + surplus);
|
|
||||||
ArrayList<PieEntry> values = new ArrayList<>();
|
ArrayList<PieEntry> values = new ArrayList<>();
|
||||||
values.add(new PieEntry(youngPer.floatValue(), ""));
|
values.add(new PieEntry(aDouble.floatValue(), ""));
|
||||||
values.add(new PieEntry(surplus.floatValue(), ""));
|
values.add(new PieEntry(surplus.floatValue(), ""));
|
||||||
|
|
||||||
PieDataSet dataSet = new PieDataSet(values, "");
|
PieDataSet dataSet = new PieDataSet(values, "");
|
||||||
@ -155,7 +154,7 @@ public class PopulaceGridStatisticsFragment extends BaseFragment {
|
|||||||
data.setDrawValues(false);
|
data.setDrawValues(false);
|
||||||
data.setValueTextSize(11f);
|
data.setValueTextSize(11f);
|
||||||
data.setValueTextColor(Color.WHITE);
|
data.setValueTextColor(Color.WHITE);
|
||||||
mPcYoung.setCenterText(youngCenterSpannableText(youngPer + ""));
|
mPcYoung.setCenterText(youngCenterSpannableText(aDouble + ""));
|
||||||
mPcYoung.setData(data);
|
mPcYoung.setData(data);
|
||||||
mPcYoung.invalidate();
|
mPcYoung.invalidate();
|
||||||
//将图表移动到底部
|
//将图表移动到底部
|
||||||
|
@ -2,7 +2,6 @@ package com.tengshisoft.gridmodule.incident.activitys.populace;
|
|||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
@ -25,7 +24,6 @@ import com.alibaba.android.arouter.launcher.ARouter;
|
|||||||
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
||||||
import com.bigkoo.pickerview.view.OptionsPickerView;
|
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.tenlionsoft.baselib.utils.ToastUtils;
|
|
||||||
import com.tengshisoft.commonmodule.adapters.CensusPersonAdapter;
|
import com.tengshisoft.commonmodule.adapters.CensusPersonAdapter;
|
||||||
import com.tengshisoft.commonmodule.beans.AreaGridListBean;
|
import com.tengshisoft.commonmodule.beans.AreaGridListBean;
|
||||||
import com.tengshisoft.commonmodule.beans.CensusPersonBean;
|
import com.tengshisoft.commonmodule.beans.CensusPersonBean;
|
||||||
@ -44,7 +42,7 @@ import com.tenlionsoft.baselib.core.widget.views.CenterBaseInputView;
|
|||||||
import com.tenlionsoft.baselib.core.widget.views.CenterGridPhoneListView;
|
import com.tenlionsoft.baselib.core.widget.views.CenterGridPhoneListView;
|
||||||
import com.tenlionsoft.baselib.core.widget.views.GridTextAdapter;
|
import com.tenlionsoft.baselib.core.widget.views.GridTextAdapter;
|
||||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||||
import com.tenlionsoft.baselib.utils.LogUtils;
|
import com.tenlionsoft.baselib.utils.ToastUtils;
|
||||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||||
|
|
||||||
@ -257,6 +255,7 @@ public class CensusBaseSearchActivity extends BaseActivity {
|
|||||||
* 显示网格选择
|
* 显示网格选择
|
||||||
*/
|
*/
|
||||||
private void onShowGrid() {
|
private void onShowGrid() {
|
||||||
|
if (mGridList != null && mGridList.size() > 0) {
|
||||||
if (mGridPicker == null) {
|
if (mGridPicker == null) {
|
||||||
mGridPicker = new OptionsPickerBuilder(mActivity, (o1, o2, o3, v) -> {
|
mGridPicker = new OptionsPickerBuilder(mActivity, (o1, o2, o3, v) -> {
|
||||||
mSelGrid = mGridList.get(o1);
|
mSelGrid = mGridList.get(o1);
|
||||||
@ -270,6 +269,9 @@ public class CensusBaseSearchActivity extends BaseActivity {
|
|||||||
mGridPicker.setPicker(mGridList);
|
mGridPicker.setPicker(mGridList);
|
||||||
}
|
}
|
||||||
mGridPicker.show();
|
mGridPicker.show();
|
||||||
|
} else {
|
||||||
|
ToastUtils.show("您暂未绑定网格,请联系管理员进行绑定.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -457,7 +457,6 @@ public class MainTabActivity extends BaseActivity implements LoginView, LocalBro
|
|||||||
*/
|
*/
|
||||||
private void startDownloadApk() {
|
private void startDownloadApk() {
|
||||||
ToastUtils.show("检测到新版本,开始下载");
|
ToastUtils.show("检测到新版本,开始下载");
|
||||||
showUpdateProgress();
|
|
||||||
Intent intent = new Intent(mActivity, DownloadService.class);
|
Intent intent = new Intent(mActivity, DownloadService.class);
|
||||||
intent.putExtra(Constants.APK_DOWNLOAD_URL, BaseUrlApi.APP_DOWNLOAD_URL);
|
intent.putExtra(Constants.APK_DOWNLOAD_URL, BaseUrlApi.APP_DOWNLOAD_URL);
|
||||||
startService(intent);
|
startService(intent);
|
||||||
@ -520,6 +519,7 @@ public class MainTabActivity extends BaseActivity implements LoginView, LocalBro
|
|||||||
filter.addAction(PathConfig.ACTION_UPDATE_SUCCESS);//下载成功
|
filter.addAction(PathConfig.ACTION_UPDATE_SUCCESS);//下载成功
|
||||||
filter.addAction(PathConfig.ACTION_UPDATE_ERROR);//下载失败
|
filter.addAction(PathConfig.ACTION_UPDATE_ERROR);//下载失败
|
||||||
filter.addAction(PathConfig.ACTION_UPDATE_PROGRESS);//进度更新
|
filter.addAction(PathConfig.ACTION_UPDATE_PROGRESS);//进度更新
|
||||||
|
filter.addAction(PathConfig.ACTION_UPDATE_STAET);//开始下载App
|
||||||
registerReceiver(mReceiver, filter);
|
registerReceiver(mReceiver, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1054,6 +1054,8 @@ public class MainTabActivity extends BaseActivity implements LoginView, LocalBro
|
|||||||
//判断是否可以安装
|
//判断是否可以安装
|
||||||
File apkFile = (File) intent.getSerializableExtra("apkFile");
|
File apkFile = (File) intent.getSerializableExtra("apkFile");
|
||||||
installApk(apkFile);
|
installApk(apkFile);
|
||||||
|
}else if(PathConfig.ACTION_UPDATE_STAET.equals(action)){
|
||||||
|
showUpdateProgress();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -217,13 +217,13 @@
|
|||||||
<!--通知公告-->
|
<!--通知公告-->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_notice"
|
android:id="@+id/ll_notice"
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:background="@drawable/shp_rectangle_white_5"
|
android:background="@drawable/shp_rectangle_white_5"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="36dp"
|
android:layout_width="36dp"
|
||||||
@ -261,8 +261,8 @@
|
|||||||
android:id="@+id/tv_notice_1"
|
android:id="@+id/tv_notice_1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:ellipsize="end"
|
|
||||||
android:layout_marginLeft="3dp"
|
android:layout_marginLeft="3dp"
|
||||||
|
android:ellipsize="end"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:textSize="@dimen/text_14" />
|
android:textSize="@dimen/text_14" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
Loading…
Reference in New Issue
Block a user