fix bugs.

This commit is contained in:
2025-11-18 18:28:16 +08:00
parent 3322cfeb22
commit 18bd2d3ba0
44 changed files with 400 additions and 517 deletions

View File

@@ -98,13 +98,23 @@ class ShineTextView : AppCompatTextView {
}
}
paint.shader = mLinearGradient
}else {
mLinearGradient = LinearGradient(
0f,
0f,
0f,
0f,
intArrayOf(Color.TRANSPARENT,Color.TRANSPARENT),
null,
Shader.TileMode.CLAMP
)
}
}
override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)
if (!isShine || !::mLinearGradient.isLateinit) return
if (!isShine) return
mTranslate += mViewWidth / (shineDuration / 50)
if (mTranslate > 1.2 * mViewWidth) {
mTranslate = -mViewWidth / 5