接Top on 1.0.1(5)

This commit is contained in:
zhouzhijia 2024-07-26 18:27:07 +08:00
parent 11234875eb
commit 4dd698a7ef
4 changed files with 102 additions and 0 deletions

29
app/google-services.json Normal file
View File

@ -0,0 +1,29 @@
{
"project_info": {
"project_number": "395067426082",
"project_id": "software-lock-screen-lock",
"storage_bucket": "software-lock-screen-lock.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:395067426082:android:8af31e334d5eb79c40917b",
"android_client_info": {
"package_name": "com.soft.ware.lock.hd"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyBSSQB5asLQlWEk3lEfiBPl7p4XBytrly0"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}

View File

@ -0,0 +1,62 @@
package com.key.coolkeyboard.tool
import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.LinearGradient
import android.graphics.Paint
import android.graphics.RectF
import android.graphics.Shader
import android.util.AttributeSet
import android.view.View
class CustomProgressBar(context: Context, attrs: AttributeSet?) : View(context, attrs) {
private var progress = 0f // 当前进度
private val maxProgress = 100f // 最大进度
private val progressBarHeight = 20f // 进度条高度
private val cornerRadius = 10f // 圆角半径
private val backgroundColor = Color.parseColor("#26FFFFFF")
private val startColor = Color.parseColor("#FF9ce8ff") // 起始颜色
private val middleColor = Color.parseColor("#FFa4c4fb") // 中间颜色
private val endColor = Color.parseColor("#FFbfa4ee") // 结束颜色
private val paint = Paint()
private val paintTow = Paint()
init {
paint.style = Paint.Style.FILL
paint.isAntiAlias = true
paintTow.style = Paint.Style.FILL
paintTow.isAntiAlias = true
}
override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)
// 绘制底色矩形
paint.shader = null // 重置着色器
paint.color = backgroundColor
val backgroundRect = RectF(0f, (height / 2 - progressBarHeight / 2), width.toFloat(), (height / 2 + progressBarHeight / 2))
canvas.drawRoundRect(backgroundRect, cornerRadius, cornerRadius, paint)
// 计算进度条的宽度
val progressBarWidth = (width * progress / maxProgress)
// 创建颜色渐变对象
val gradient = LinearGradient(0f, 0f, width.toFloat(), 0f, intArrayOf(startColor, middleColor, endColor), null, Shader.TileMode.CLAMP)
paintTow.shader = gradient
// 绘制带圆角的进度条矩形
val rect = RectF(0f, (height / 2 - progressBarHeight / 2), progressBarWidth.toFloat(), (height / 2 + progressBarHeight / 2))
canvas.drawRoundRect(rect, cornerRadius, cornerRadius, paintTow)
}
fun getProgress():Float{
return progress
}
// 设置进度
fun setProgress(progress: Float) {
this.progress = progress
invalidate() // 请求重绘
}
}

View File

@ -0,0 +1,9 @@
package com.key.coolkeyboard.tool;
import com.anythink.core.api.AdError;
public interface Adcallback {
void onShowFail(AdError ad);
void onAdHidden( );
}

View File

@ -0,0 +1,2 @@
package com.example.applock.value;public class Mytool {
}