Commit 32f24cfc authored by wanglei's avatar wanglei

[拆包]启动页

parent d37bcb84
......@@ -93,7 +93,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(ActivitySplashBinding
}
viewModel.onTick = { s, t, p ->
// Log.e(TAG, "onTick $s $t")
binding.progressBar.setProgress(p.toInt(), false)
binding.progressBar.setProgress(p.toDouble())
}
}
......@@ -183,20 +183,21 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(ActivitySplashBinding
val acAction = {
initUMP {
return@initUMP
LogEx.logDebug(TAG, "initUMP callback")
AdsMgr.showOpen(this, showCallBack = object : AdsShowCallBack() {
override fun show() {
super.show()
viewModel.stopCountdown()
binding.progressBar.setProgress(100, true)
binding.progressBar.setProgress(100.0)
}
override fun next() {
val action = {
LogEx.logDebug(TAG, "next")
viewModel.overCountDown()
binding.progressBar.setProgress(100, true)
binding.progressBar.setProgress(100.0)
binding.root.postDelayed({ jumpNext() }, 250)
}
LogEx.logDebug("AdmobEvent", "inter adShowed=${adShowed}")
......
......@@ -16,7 +16,7 @@ class SplashViewModel : ViewModel() {
private var countdownJob: Job? = null
private var startTime: Long = 0
val totalTimeMs = AdConfigBean.adsConfigBean.openAdLoading * 1000L // 倒计时总时长
val totalTimeMs = (AdConfigBean.adsConfigBean.openAdLoading + 2) * 1000L // 倒计时总时长
private val checkIntervalMs = 100L // 检查间隔(100毫秒)
private var countdownOver: Boolean = false
......@@ -38,17 +38,17 @@ class SplashViewModel : ViewModel() {
val remaining = totalTimeMs - elapsed
if (remaining <= 0) {
async(Dispatchers.Main) {
onTick?.invoke(totalTimeMs, totalTimeMs, 100f)
}
async(Dispatchers.Main) { onTick?.invoke(totalTimeMs, totalTimeMs, 100f) }
break
} else {
async(Dispatchers.Main) {
val percent = elapsed * 100f / totalTimeMs
onTick?.invoke(elapsed, totalTimeMs, percent)
}.await()
if (percent > 90) {
async(Dispatchers.Main) { onTick?.invoke(totalTimeMs, totalTimeMs, 100f) }
break
} else {
async(Dispatchers.Main) { onTick?.invoke(elapsed, totalTimeMs, percent) }.await()
}
}
delay(Random.nextLong(checkIntervalMs, checkIntervalMs + 100L))
}
launch(Dispatchers.Main) {
......
package com.base.appzxhy.ui.views;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.BlurMaskFilter;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.View;
import androidx.annotation.ColorInt;
import com.base.appzxhy.R;
import java.text.DecimalFormat;
/**
* @Description:
* @Author: liys
* @CreateDate: 2020/4/13 17:20
* @UpdateUser: 更新者
* @UpdateDate: 2020/4/13 17:20
* @UpdateRemark: 更新说明
* @Version: 1.0
*/
public abstract class BaseProView extends View{
protected Context context;
//宽高
protected int width;
protected int height;
//进度条和背景
protected int progressSize;
protected int progressColorBackground;
protected int progressColor;
//文字
protected String text = ""; //当前 百分比
protected int textSize; //字体大小
protected int textColor; //字体大小
protected boolean textShow; //是否显示文字
protected int textDecimalNum; //保留小数 位数
//发光
protected int lightColor;
protected boolean lightShow;
//边框
protected int strokeWidth;
protected int strokeColor;
protected boolean strokeShow;
//画笔
protected Paint progressBgPaint = new Paint();
protected Paint progressPaint = new Paint();
protected Paint textPaint = new Paint();
protected Paint lightPaint = new Paint(); //发光 画笔
protected Paint strokePaint = new Paint(); //边框 边框画笔
protected double maxProgress; //总数
protected double progress; //当前进度
protected int blankSpace; //空白距离/发光和大小
public BaseProView(Context context) {
this(context, null);
}
public BaseProView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public BaseProView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
this.context = context;
initBaseAttrs(attrs);
initBaseView();
// post(new Runnable() {
// @Override
// public void run() {
// width = getMeasuredWidth();
// height = getMeasuredHeight();
// if(progressSize == 0){
// progressSize = height;
// }
// blankSpace = (height- progressSize)/2;
// refreshLight();
// beforeInit();
// init();
// }
// });
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
width = w;
height = h;
if(progressSize == 0){
progressSize = height;
}
blankSpace = (height- progressSize)/2;
refreshLight();
beforeInit();
init();
}
public void beforeInit(){}
public abstract void init();
@SuppressLint("CustomViewStyleable")
private void initBaseAttrs(AttributeSet attrs){
// 获取自定义属性
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.BaseProgressView);
maxProgress = typedArray.getInteger(R.styleable.BaseProgressView_progress_max, 100);
progress = typedArray.getInteger(R.styleable.BaseProgressView_progress_value, 0);
progressSize = typedArray.getDimensionPixelOffset(R.styleable.BaseProgressView_progress_size, 0);
progressColorBackground = typedArray.getColor(R.styleable.BaseProgressView_progress_color_background, Color.GRAY);
progressColor = typedArray.getColor(R.styleable.BaseProgressView_progress_color, Color.YELLOW);
textSize = typedArray.getDimensionPixelSize(R.styleable.BaseProgressView_text_size, sp2px(10));
textColor = typedArray.getColor(R.styleable.BaseProgressView_text_color, Color.WHITE);
textShow = typedArray.getBoolean(R.styleable.BaseProgressView_text_show, false);
textDecimalNum = typedArray.getInt(R.styleable.BaseProgressView_text_decimal_num, 0);
lightColor = typedArray.getColor(R.styleable.BaseProgressView_light_color, Color.WHITE);
lightShow = typedArray.getBoolean(R.styleable.BaseProgressView_light_show, false);
strokeColor = typedArray.getColor(R.styleable.BaseProgressView_stroke_color, Color.WHITE);
strokeWidth = typedArray.getDimensionPixelOffset(R.styleable.BaseProgressView_stroke_width, dp2px(1));
strokeShow = typedArray.getBoolean(R.styleable.BaseProgressView_stroke_show, false);
typedArray.recycle();
refreshText();
}
private void initBaseView(){
progressBgPaint.setAntiAlias(true);
progressBgPaint.setColor(progressColorBackground);
progressPaint.setAntiAlias(true);
progressPaint.setColor(progressColor);
textPaint.setAntiAlias(true);
textPaint.setColor(textColor);
textPaint.setTextSize(textSize);
//发光
lightPaint.setAntiAlias(true);
lightPaint.setColor(lightColor);
// if(lightShow){
// BlurMaskFilter lightMaskFilter = new BlurMaskFilter(blankSpace, BlurMaskFilter.Blur.SOLID);
// lightPaint.setMaskFilter(lightMaskFilter);
// progressPaint.setMaskFilter(lightMaskFilter);
// setLayerType(LAYER_TYPE_SOFTWARE, null); //禁用硬件加速
// }
//边框
strokePaint.setStrokeWidth(strokeWidth);
strokePaint.setAntiAlias(true);
strokePaint.setColor(strokeColor);
strokePaint.setStyle(Paint.Style.STROKE);
}
/**
* 刷新发光参数
*/
protected void refreshLight(){
if(lightShow && blankSpace>0){
BlurMaskFilter progressMaskFilter = new BlurMaskFilter(blankSpace, BlurMaskFilter.Blur.SOLID);
BlurMaskFilter lightMaskFilter = new BlurMaskFilter(blankSpace, BlurMaskFilter.Blur.OUTER);
lightPaint.setMaskFilter(lightMaskFilter);
progressPaint.setMaskFilter(progressMaskFilter);
setLayerType(LAYER_TYPE_SOFTWARE, null); //禁用硬件加速
}
}
/**
* 设置渐变
* @param isProDirection 是否顺着进度条前进方向 渐变
* @param colors 颜色数组
*/
public void setOutGradient(boolean isProDirection, @ColorInt int... colors){}
public void setOutGradient(@ColorInt int... colors){
setOutGradient(true, colors);
}
/**
* 获取文字区域
* @param text
* @return
*/
protected Rect getTextRect(String text){
Rect rect = new Rect();
textPaint.getTextBounds(text, 0, text.length(), rect);
return rect;
}
protected int getBaseline(Paint paint){
// Paint.FontMetricsInt fontMetrics = paint.getFontMetricsInt();
// // 获取文字的高
// int fontTotalHeight = fontMetrics.bottom - fontMetrics.top;
// // 计算基线到中心点的距离
// int offY = fontTotalHeight / 2 - fontMetrics.bottom;
// // 计算基线位置
// int baseline = (getMeasuredHeight() + fontTotalHeight) / 2 - offY;
return getBaseline(paint, getMeasuredHeight());
}
protected int getBaseline(Paint paint, int totalHeight){
Paint.FontMetricsInt fontMetrics = paint.getFontMetricsInt();
// 获取文字的高
int fontTotalHeight = fontMetrics.bottom - fontMetrics.top;
// 计算基线到中心点的距离
int offY = fontTotalHeight / 2 - fontMetrics.bottom;
// 计算基线位置
int baseline = (totalHeight + fontTotalHeight) / 2 - offY;
return baseline;
}
public void setProgress(double progress) {
this.progress = progress;
refreshText();
}
public void setMaxProgress(double maxProgress) {
this.maxProgress = maxProgress;
refreshText();
}
/**
* 刷新text
*/
protected void refreshText(){
text = keepDecimals(progress/maxProgress*100)+"%";
postInvalidate();
}
/**
* 保留小数
* @param value
* @return
*/
protected String keepDecimals(double value){
if(textDecimalNum==0){
return (int)value + "";
}
String format = "";
for (int i = 0; i < textDecimalNum; i++) {
if(i==0){
format = "0.0";
}else{
format = format+"0";
}
}
DecimalFormat decimalFormat = new DecimalFormat(format);
return decimalFormat.format(value);
}
public int sp2px(float sp) {
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, sp, getResources().getDisplayMetrics());
}
public int dp2px(float dp) {
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, getResources().getDisplayMetrics());
}
// 对应set get方法
public int getProgressSize() {
return progressSize;
}
public void setProgressSize(int progressSize) {
this.progressSize = progressSize;
}
public int getProgressColorBackground() {
return progressColorBackground;
}
public void setProgressColorBackground(int progressColorBackground) {
this.progressColorBackground = progressColorBackground;
}
public int getProgressColor() {
return progressColor;
}
public void setProgressColor(int progressColor) {
this.progressColor = progressColor;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public int getTextSize() {
return textSize;
}
public void setTextSize(int textSize) {
this.textSize = textSize;
}
public int getTextColor() {
return textColor;
}
public void setTextColor(int textColor) {
this.textColor = textColor;
}
public boolean isTextShow() {
return textShow;
}
public void setTextShow(boolean textShow) {
this.textShow = textShow;
}
public int getTextDecimalNum() {
return textDecimalNum;
}
public void setTextDecimalNum(int textDecimalNum) {
this.textDecimalNum = textDecimalNum;
}
public int getLightColor() {
return lightColor;
}
public void setLightColor(int lightColor) {
this.lightColor = lightColor;
}
public boolean isLightShow() {
return lightShow;
}
public void setLightShow(boolean lightShow) {
this.lightShow = lightShow;
}
public int getStrokeWidth() {
return strokeWidth;
}
public void setStrokeWidth(int strokeWidth) {
this.strokeWidth = strokeWidth;
}
public int getStrokeColor() {
return strokeColor;
}
public void setStrokeColor(int strokeColor) {
this.strokeColor = strokeColor;
}
public boolean isStrokeShow() {
return strokeShow;
}
public void setStrokeShow(boolean strokeShow) {
this.strokeShow = strokeShow;
}
public double getMaxProgress() {
return maxProgress;
}
public double getProgress() {
return progress;
}
public Paint getProgressBgPaint() {
return progressBgPaint;
}
public void setProgressBgPaint(Paint progressBgPaint) {
this.progressBgPaint = progressBgPaint;
}
public Paint getProgressPaint() {
return progressPaint;
}
public void setProgressPaint(Paint progressPaint) {
this.progressPaint = progressPaint;
}
public Paint getTextPaint() {
return textPaint;
}
public void setTextPaint(Paint textPaint) {
this.textPaint = textPaint;
}
public Paint getLightPaint() {
return lightPaint;
}
public void setLightPaint(Paint lightPaint) {
this.lightPaint = lightPaint;
}
public Paint getStrokePaint() {
return strokePaint;
}
public void setStrokePaint(Paint strokePaint) {
this.strokePaint = strokePaint;
}
}
package com.base.appzxhy.ui.views;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.LinearGradient;
import android.graphics.Path;
import android.graphics.Shader;
import android.util.AttributeSet;
import androidx.annotation.ArrayRes;
import androidx.annotation.ColorInt;
import com.base.appzxhy.R;
/**
* @Description: 线性进度条---基类
* @Author: liys
* @CreateDate: 2020/4/13 17:57
* @UpdateUser: 更新者
* @UpdateDate: 2020/4/13 17:57
* @UpdateRemark: 更新说明
* @Version: 1.0
*/
public abstract class LineBaseProView extends BaseProView {
//圆角
protected float radius;
protected float leftTopRadius;
protected float leftBottomRadius;
protected float rightTopRadius;
protected float rightBottomRadius;
protected float progressRadius;
protected boolean isRadius = true; //true使用radius false使用leftTopRadius...
//圆角
protected float[] floatsIn;
protected float[] floatsOut;
protected Path pathIn = new Path();
protected Path pathOut = new Path();
public LineBaseProView(Context context) {
this(context, null);
}
public LineBaseProView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public LineBaseProView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initAttrs(context.obtainStyledAttributes(attrs, R.styleable.LineBaseProView));
}
/**
* 获取属性
*
* @param typedArray
*/
private void initAttrs(TypedArray typedArray) {
radius = typedArray.getDimension(R.styleable.LineBaseProView_radius, -1);
leftTopRadius = typedArray.getDimension(R.styleable.LineBaseProView_left_top_radius, 0);
leftBottomRadius = typedArray.getDimension(R.styleable.LineBaseProView_left_bottom_radius, 0);
rightTopRadius = typedArray.getDimension(R.styleable.LineBaseProView_right_top_radius, 0);
rightBottomRadius = typedArray.getDimension(R.styleable.LineBaseProView_right_bottom_radius, 0);
progressRadius = typedArray.getDimension(R.styleable.LineBaseProView_progress_radius, 0);
if (radius == -1) { //没有赋值,则自己处理
isRadius = true;
}
if (leftTopRadius == 0 || leftBottomRadius == 0 || rightTopRadius == 0 || rightBottomRadius == 0) {
isRadius = true;
}
}
@Override
public void beforeInit() {
if (isRadius && radius == -1) {
radius = progressSize / 2;
}
}
protected void refreshRadius() {
if (isRadius) {
floatsIn = new float[]{radius, radius, radius, radius, radius, radius, radius, radius};
floatsOut = new float[]{radius, radius, progressRadius, progressRadius, progressRadius, progressRadius, radius, radius};
} else {
floatsIn = new float[]{leftTopRadius, leftTopRadius, rightTopRadius, rightTopRadius, rightBottomRadius, rightBottomRadius, leftBottomRadius, leftBottomRadius};
floatsOut = new float[]{leftTopRadius, leftTopRadius, progressRadius, progressRadius, progressRadius, progressRadius, leftBottomRadius, leftBottomRadius};
}
}
/**
* 设置渐变
*
* @param isProDirection 是否水平渐变 (水平:左到右 垂直:上到下)
* @param colors 颜色数组
*/
@Override
public void setOutGradient(final boolean isProDirection, final @ColorInt int... colors) {
post(new Runnable() {
@Override
public void run() {
int[] colorResArr = new int[colors.length];
for (int i = 0; i < colors.length; i++) {
colorResArr[i] = colors[i];
}
LinearGradient gradient;
int topOut = (height - progressSize) / 2;
if (isProDirection) { //水平
gradient = new LinearGradient(0, 0, width, 0, colorResArr, null, Shader.TileMode.CLAMP); //参数一为渐变起
} else {
gradient = new LinearGradient(0, topOut, 0, topOut + progressSize, colorResArr, null, Shader.TileMode.CLAMP); //参数一为渐变起
}
progressPaint.setShader(gradient);
}
});
}
public void setOutGradientArray(boolean isHorizontal, @ArrayRes int arrayRes) {
setOutGradient(isHorizontal, getResources().getIntArray(arrayRes));
}
public float getLeftTopRadius() {
return leftTopRadius;
}
public void setLeftTopRadius(float leftTopRadius) {
this.leftTopRadius = leftTopRadius;
}
public float getLeftBottomRadius() {
return leftBottomRadius;
}
public void setLeftBottomRadius(float leftBottomRadius) {
this.leftBottomRadius = leftBottomRadius;
}
public float getRightTopRadius() {
return rightTopRadius;
}
public void setRightTopRadius(float rightTopRadius) {
this.rightTopRadius = rightTopRadius;
}
public float getRightBottomRadius() {
return rightBottomRadius;
}
public void setRightBottomRadius(float rightBottomRadius) {
this.rightBottomRadius = rightBottomRadius;
}
public float getProgressRadius() {
return progressRadius;
}
public void setProgressRadius(float progressRadius) {
this.progressRadius = progressRadius;
}
public boolean isRadius() {
return isRadius;
}
public void setRadius(boolean radius) {
isRadius = radius;
}
public float getRadius() {
return radius;
}
public void setRadius(float radius) {
this.radius = radius;
}
}
// if(isRadius){
// pathIn.addRoundRect(new RectF(blankSpace, topIn, width-blankSpace, topIn+progressSize), new float[]{radius, radius, radius, radius, radius, radius, radius, radius}, Path.Direction.CW);
// pathOut.addRoundRect(new RectF(blankSpace, topOut, width/2-blankSpace, topOut+progressSize), new float[]{radius, radius, progressRadius, progressRadius, progressRadius, progressRadius, radius, radius}, Path.Direction.CW);
// pathLight.addRoundRect(new RectF(blankSpace, topIn, width-blankSpace, topIn+progressSize), new float[]{radius, radius, radius, radius, radius, radius, radius, radius}, Path.Direction.CW);
// pathStroke.addRoundRect(new RectF(blankSpace, topIn, width-blankSpace, topIn+progressSize), new float[]{radius, radius, radius, radius, radius, radius, radius, radius}, Path.Direction.CW);
// }else{
// pathIn.addRoundRect(new RectF(blankSpace, topIn, width-blankSpace, topIn+progressSize), new float[]{leftTopRadius, leftTopRadius, rightTopRadius, rightTopRadius, rightBottomRadius, rightBottomRadius, leftBottomRadius, leftBottomRadius}, Path.Direction.CW);
// pathOut.addRoundRect(new RectF(blankSpace, topOut, width/2-blankSpace, topOut+progressSize), new float[]{leftTopRadius, leftTopRadius, progressRadius, progressRadius, progressRadius, progressRadius, leftBottomRadius, leftBottomRadius}, Path.Direction.CW);
// pathLight.addRoundRect(new RectF(blankSpace, topIn, width-blankSpace, topIn+progressSize), new float[]{leftTopRadius, leftTopRadius, rightTopRadius, rightTopRadius, rightBottomRadius, rightBottomRadius, leftBottomRadius, leftBottomRadius}, Path.Direction.CW);
// pathStroke.addRoundRect(new RectF(blankSpace, topIn, width-blankSpace, topIn+progressSize), new float[]{leftTopRadius, leftTopRadius, rightTopRadius, rightTopRadius, rightBottomRadius, rightBottomRadius, leftBottomRadius, leftBottomRadius}, Path.Direction.CW);
// }
package com.base.appzxhy.ui.views;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.AttributeSet;
import com.base.appzxhy.R;
/**
* @Description:
* @Author: liys
* @CreateDate: 2020/4/22 17:32
* @UpdateUser: 更新者
* @UpdateDate: 2020/4/22 17:32
* @UpdateRemark: 更新说明
* @Version: 1.0
*/
public class LineCentreProView extends LineBaseProView {
protected Paint boxPaint = new Paint();
protected int boxWidth;
protected int boxRadius;
public LineCentreProView(Context context) {
this(context, null);
}
public LineCentreProView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public LineCentreProView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.LineCentreProView);
boxWidth = typedArray.getDimensionPixelOffset(R.styleable.LineCentreProView_box_width, -1);
boxRadius = typedArray.getDimensionPixelOffset(R.styleable.LineCentreProView_box_radius, -1);
}
@Override
public void init() {
boxPaint.setAntiAlias(true);
boxPaint.setColor(progressPaint.getColor());
if (boxWidth == -1) {
boxWidth = height * 3 / 2;
}
if (boxRadius == -1) {
boxRadius = height / 2;
}
}
@SuppressLint("DrawAllocation")
@Override
protected void onDraw(Canvas canvas) {
//1. 获取当前进度
int outWidth = (int) (progress / maxProgress * width); //计算当前进度距离
if (outWidth >= width - boxWidth) {
outWidth = (width - boxWidth);
}
int top = (height - progressSize) / 2;
//进度条当前长度
canvas.drawRoundRect(new RectF(0, top, width, top + progressSize), radius, radius, progressBgPaint);
canvas.drawRoundRect(new RectF(0, top, outWidth + boxWidth / 2, top + progressSize), radius, radius, progressPaint);
drawBox(canvas, outWidth);
drawText(canvas, outWidth);
}
/**
* @param canvas
* @param left 左边距离
*/
public void drawBox(Canvas canvas, int left) {
RectF rectF = new RectF(left, 0, left + boxWidth, height); // 设置个新的长方形
canvas.drawRoundRect(rectF, boxRadius, boxRadius, boxPaint); //第二个参数是x半径,第三个参数是y半径
}
public void drawText(Canvas canvas, int left) {
canvas.drawText(text, left + boxWidth / 2 - getTextRect(text).width() / 2, getBaseline(textPaint), textPaint);
}
public Paint getBoxPaint() {
return boxPaint;
}
public void setBoxPaint(Paint boxPaint) {
this.boxPaint = boxPaint;
}
public int getBoxWidth() {
return boxWidth;
}
public void setBoxWidth(int boxWidth) {
this.boxWidth = boxWidth;
invalidate();
}
public int getBoxRadius() {
return boxRadius;
}
public void setBoxRadius(int boxRadius) {
this.boxRadius = boxRadius;
invalidate();
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="270"
android:centerX="0.1"
android:centerY="0.5"
android:endColor="@color/white"
android:startColor="@color/white"
android:type="linear" />
</shape><!--<layer-list xmlns:android="http://schemas.android.com/apk/res/android">-->
<!-- <item>-->
<!-- <bitmap android:src="@drawable/bg_bg_splash" />-->
<!-- </item>-->
<!--</layer-list>-->
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?><!--<shape xmlns:android="http://schemas.android.com/apk/res/android">-->
<!-- <gradient-->
<!-- android:angle="270"-->
<!-- android:centerX="0.1"-->
<!-- android:centerY="0.5"-->
<!-- android:endColor="@color/white"-->
<!-- android:startColor="@color/white"-->
<!-- android:type="linear" />-->
<!--</shape>-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap android:src="@drawable/bg_bg_splash" />
</item>
</layer-list>
\ No newline at end of file
......@@ -60,7 +60,7 @@
android:layout_width="@dimen/dp_24"
android:layout_height="@dimen/dp_24"
android:layout_gravity="center_vertical"
android:src="@drawable/essentiona" />
android:src="@drawable/icon_zhuyi" />
<TextView
android:layout_width="wrap_content"
......@@ -110,11 +110,11 @@
android:layout_height="@dimen/dp_55"
android:layout_marginHorizontal="@dimen/dp_35"
android:layout_marginTop="@dimen/dp_20"
android:background="@drawable/bg_splash_button"
android:background="@drawable/bg_splash_button_bg"
android:gravity="center"
android:text="@string/start"
android:textAlignment="center"
android:textColor="@color/white"
android:textColor="@color/colorPrimary"
android:textSize="@dimen/sp_24"
android:textStyle="bold" />
......@@ -129,7 +129,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/by_continuing_"
android:textColor="#8B8B8B"
android:textColor="#F2FEF8"
android:textSize="@dimen/sp_12" />
<TextView
......@@ -137,6 +137,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/privacy_policy"
android:textColor="#F2FEF8"
android:textSize="@dimen/sp_12" />
<!-- <TextView-->
......@@ -164,7 +165,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent">
app:layout_constraintBottom_toBottomOf="parent"
tools:visibility="visible">
<!-- <com.airbnb.lottie.LottieAnimationView-->
<!-- android:id="@+id/lottie_loading"-->
......@@ -187,37 +189,36 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_20"
android:gravity="center"
android:text="@string/involve_ad"
android:textColor="@color/black"
android:textSize="@dimen/sp_14"
android:textStyle="bold" />
<ProgressBar
<com.base.appzxhy.ui.views.LineCentreProView
android:id="@+id/progressBar"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_12"
android:layout_height="@dimen/dp_20"
android:layout_marginHorizontal="@dimen/dp_24"
android:layout_marginBottom="@dimen/dp_35"
android:max="100"
android:progressDrawable="@drawable/progress_drawable_home"
tools:progress="50" />
android:layout_marginBottom="@dimen/dp_25"
app:box_height="@dimen/dp_20"
app:box_width="@dimen/dp_45"
app:progress_color="@color/white"
app:progress_color_background="#33ffffff"
app:progress_max="100"
app:progress_size="10dp"
app:radius="@dimen/dp_25"
app:text_color="@color/colorPrimary"
app:text_size="@dimen/sp_12" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_50"
android:gravity="center"
android:text="@string/loading"
android:textColor="@color/black"
android:text="@string/involve_ad"
android:textColor="#F2FEF8"
android:textSize="@dimen/sp_14"
android:textStyle="bold" />
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- 公共属性 -->
<attr name="progress_max" format="integer"/> //总数
<attr name="progress_value" format="integer"/> //进度
<attr name="progress_size" format="dimension"/> //进度条 大小
<attr name="progress_color" format="color"/> //进度条 颜色
<attr name="progress_color_background" format="color"/> //进度条背景颜色
<attr name="text_size" format="dimension"/> //文字大小
<attr name="text_color" format="color"/> //文字颜色
<attr name="text_show" format="boolean"/> //是否显示文字
<attr name="text_decimal_num" format="integer"/> //保留多少位小数
<attr name="light_color" format="color"/> //发光颜色
<attr name="light_show" format="boolean"/> //是否需要发光
<attr name="stroke_color" format="color"/> //边框颜色
<attr name="stroke_width" format="dimension"/> //边框大小
<attr name="stroke_show" format="boolean"/> //是否需要边框
<!--line进度条特有-->
<attr name="radius" format="dimension"/> //圆角
<attr name="left_top_radius" format="dimension"/>
<attr name="left_bottom_radius" format="dimension"/>
<attr name="right_top_radius" format="dimension"/>
<attr name="right_bottom_radius" format="dimension"/>
<attr name="progress_radius" format="dimension"/> //进度条 前进方向圆角
<attr name="box_width" format="dimension"/> //方框宽度
<attr name="box_height" format="dimension"/> //方框高度
<attr name="box_radius" format="dimension"/> //方框圆角
<!--圆弧进度条-->
<attr name="arc_start_angle" format="integer"/> //开始角度
<attr name="arc_draw_angle" format="integer"/> //需要绘制的角度
<declare-styleable name="BaseProgressView">
<attr name="progress_max"/>
<attr name="progress_value"/>
<attr name="progress_size"/>
<attr name="progress_color"/>
<attr name="progress_color_background"/>
<attr name="text_size"/>
<attr name="text_color"/>
<attr name="text_show"/>
<attr name="text_decimal_num"/>
<attr name="light_color"/>
<attr name="light_show"/>
<attr name="stroke_color"/>
<attr name="stroke_width"/>
<attr name="stroke_show"/>
</declare-styleable>
<!-->>>>>>>>>>>>>>>>>>>>>>> 线性进度条 >>>>>>>>>>>>>>>>>>>>>>>>>>>>-->
<!-- 线性基类 -->
<declare-styleable name="LineBaseProView">
<attr name="progress_max"/>
<attr name="progress_value"/>
<attr name="progress_size"/>
<attr name="progress_color"/>
<attr name="progress_color_background"/>
<attr name="text_size"/>
<attr name="text_color"/>
<attr name="text_show"/>
<attr name="text_decimal_num"/>
<attr name="light_color"/>
<attr name="light_show"/>
<attr name="stroke_color"/>
<attr name="stroke_width"/>
<attr name="stroke_show"/>
<attr name="radius"/>
<attr name="left_top_radius"/>
<attr name="left_bottom_radius"/>
<attr name="right_top_radius"/>
<attr name="right_bottom_radius"/>
<attr name="progress_radius"/>
</declare-styleable>
<!-->>>>>>>>>>>>>>>>>>>>>>>LineProgressView>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>-->
<declare-styleable name="LineProView">
<attr name="progress_max"/>
<attr name="progress_value"/>
<attr name="progress_size"/>
<attr name="progress_color"/>
<attr name="progress_color_background"/>
<attr name="text_size"/>
<attr name="text_color"/>
<attr name="text_show"/>
<attr name="text_decimal_num"/>
<attr name="light_color"/>
<attr name="light_show"/>
<attr name="stroke_color"/>
<attr name="stroke_width"/>
<attr name="stroke_show"/>
<!--圆角半径-->
<attr name="radius"/>
<attr name="left_top_radius"/>
<attr name="left_bottom_radius"/>
<attr name="right_top_radius"/>
<attr name="right_bottom_radius"/>
<attr name="progress_radius"/>
</declare-styleable>
<!-->>>>>>>>>>>>>>>>>>>>>>>LineCentreProgressView>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>-->
<declare-styleable name="LineCentreProView">
<attr name="progress_max"/>
<attr name="progress_value"/>
<attr name="progress_size"/>
<attr name="progress_color"/>
<attr name="progress_color_background"/>
<attr name="text_size"/>
<attr name="text_color"/>
<attr name="text_show"/>
<attr name="text_decimal_num"/>
<attr name="light_color"/>
<attr name="light_show"/>
<!--圆角半径-->
<attr name="radius"/>
<attr name="box_width"/> //方框--宽度
<attr name="box_radius"/> //方框--圆角
</declare-styleable>
<!-->>>>>>>>>>>>>>>>>>>>>>>LineBottomProgressView>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>-->
<declare-styleable name="LineBottomProView">
<attr name="progress_max"/>
<attr name="progress_value"/>
<attr name="progress_size"/>
<attr name="progress_color"/>
<attr name="progress_color_background"/>
<attr name="text_size"/>
<attr name="text_color"/>
<attr name="text_show"/>
<attr name="text_decimal_num"/>
<attr name="light_color"/>
<attr name="light_show"/>
<!--圆角半径-->
<attr name="radius"/>
<attr name="box_width"/> //方框--宽度
<attr name="box_height"/> //方框--高度
<attr name="box_radius"/> //方框--圆角
</declare-styleable>
<!-->>>>>>>>>>>>>>>>>>>>>>> 圆弧进度条 >>>>>>>>>>>>>>>>>>>>>>>>>>>>-->
<declare-styleable name="ArcProView">
<attr name="progress_max"/>
<attr name="progress_value"/>
<attr name="progress_size"/>
<attr name="progress_color"/>
<attr name="progress_color_background"/>
<attr name="text_size"/>
<attr name="text_color"/>
<attr name="text_show"/>
<attr name="text_decimal_num"/>
<attr name="light_color"/>
<attr name="light_show"/>
<attr name="arc_start_angle"/> //开始角度
<attr name="arc_draw_angle"/> //需要绘制的角度
</declare-styleable>
<!-- 水波 进度条 -->
<declare-styleable name="WaterWaveProView">
<attr name="progress_max"/>
<attr name="progress_value"/>
<attr name="progress_size"/>
<attr name="progress_color"/>
<attr name="progress_color_background"/>
<attr name="text_size"/>
<attr name="text_color"/>
<attr name="text_show"/>
<attr name="text_decimal_num"/>
<attr name="light_color"/>
<attr name="light_show"/>
<attr name="stroke_color"/>
<attr name="stroke_width"/>
<attr name="stroke_show"/>
<attr name="water_wave_width" format="dimension"/> // 水波长
<attr name="water_wave_height" format="dimension"/> //水波高度
<attr name="water_wave_speed" format="integer"/> //水波--速度
</declare-styleable>
</resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment