feat:【V5.16.0】光环下载进度条优化—客户端 https://jira.shanqu.cc/browse/GHZS-84
This commit is contained in:
@ -529,6 +529,41 @@ object DialogHelper {
|
||||
)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun showDeleteDialog(
|
||||
context: Context,
|
||||
title: String,
|
||||
msg: CharSequence,
|
||||
confirmText: String,
|
||||
cancelText: String,
|
||||
confirmClickCallback: EmptyCallback?,
|
||||
cancelClickCallback: EmptyCallback?,
|
||||
isReverse: Boolean
|
||||
) {
|
||||
showDialog(
|
||||
context,
|
||||
title,
|
||||
msg,
|
||||
if (isReverse) cancelText else confirmText,
|
||||
if (isReverse) confirmText else cancelText,
|
||||
confirmClickCallback = {
|
||||
if (isReverse) cancelClickCallback?.onCallback() else confirmClickCallback?.onCallback()
|
||||
},
|
||||
cancelClickCallback = {
|
||||
if (isReverse) confirmClickCallback?.onCallback() else cancelClickCallback?.onCallback()
|
||||
},
|
||||
uiModificationCallback = {
|
||||
val colorAccentRes = if (isReverse) R.color.theme_red else R.color.text_subtitle
|
||||
val colorDefaultRes = if (isReverse) R.color.text_subtitle else R.color.theme_red
|
||||
it.cancelTv.setTextColor(colorAccentRes.toColor(context))
|
||||
it.confirmTv.setTextColor(colorDefaultRes.toColor(context))
|
||||
},
|
||||
extraConfig = Config(centerTitle = true, centerContent = true)
|
||||
)?.setOnCancelListener {
|
||||
cancelClickCallback?.onCallback()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context may be is application context
|
||||
* @return activity context
|
||||
|
||||
@ -1423,4 +1423,19 @@ fun TextView.setDrawableBottom(@DrawableRes drawableRes: Int, width: Int? = null
|
||||
fun TextView.setDrawableBottom(drawable: Drawable?, width: Int? = null, height: Int? = null) {
|
||||
drawable?.setBounds(0, 0, width ?: drawable.minimumWidth, height ?: drawable.minimumHeight)
|
||||
this.setCompoundDrawables(null, null, null, drawable)
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置下载提示Lottie动画
|
||||
*/
|
||||
fun LottieAnimationView.setDownloadTipsAnimation(isPlaying: Boolean = false) {
|
||||
cancelAnimation()
|
||||
setAnimation(if (DarkModeUtils.isDarkModeOn(context)) "lottie/downloadtips_dark.json" else "lottie/downloadtips_light.json")
|
||||
if (isPlaying) {
|
||||
// 动态
|
||||
playAnimation()
|
||||
} else {
|
||||
// 静态
|
||||
progress = 0.5F
|
||||
}
|
||||
}
|
||||
@ -52,4 +52,6 @@
|
||||
<string name="game_empty_desc_content">你可能是第一个发现这个地方的人</string>
|
||||
<string name="reset_load">重试</string>
|
||||
<string name="loading_network_error_desc">检测网络设置或是点击按钮重试</string>
|
||||
|
||||
<string name="is_dark_mode_on_id">is_dark_mode_on_id</string>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user