diff --git a/app/src/main/java/com/xiaoyv/bangumi/ui/feature/magi/question/MagiQuestionDialog.kt b/app/src/main/java/com/xiaoyv/bangumi/ui/feature/magi/question/MagiQuestionDialog.kt index 2a554b7f..4613b2e2 100644 --- a/app/src/main/java/com/xiaoyv/bangumi/ui/feature/magi/question/MagiQuestionDialog.kt +++ b/app/src/main/java/com/xiaoyv/bangumi/ui/feature/magi/question/MagiQuestionDialog.kt @@ -12,6 +12,7 @@ import androidx.fragment.app.FragmentManager import com.blankj.utilcode.util.ScreenUtils import com.blankj.utilcode.util.SpanUtils import com.xiaoyv.bangumi.databinding.FragmentMagiQuestionLastBinding +import com.xiaoyv.bangumi.helper.RouteHelper import com.xiaoyv.blueprint.constant.NavKey import com.xiaoyv.common.api.parser.entity.MagiQuestionEntity import com.xiaoyv.common.kts.GoogleAttr @@ -48,6 +49,16 @@ class MagiQuestionDialog : DialogFragment() { binding.tvRate.isVisible = entity.lastQuestionId.isNotBlank() SpanUtils.with(binding.tvRate) + .apply { + if (entity.userId.isNotBlank()) { + append("来自:") + append(entity.userName) + setClickSpan(requireContext().getAttrColor(GoogleAttr.colorPrimary), false) { + RouteHelper.jumpUserDetail(entity.userId) + } + append("\u3000") + } + } .append("通过率: ") .append(entity.lastQuestionRightRate) .setForegroundColor(requireContext().getAttrColor(GoogleAttr.colorPrimary)) diff --git a/lib-common/src/main/java/com/xiaoyv/common/widget/dialog/AnimeLoadingDialog.kt b/lib-common/src/main/java/com/xiaoyv/common/widget/dialog/AnimeLoadingDialog.kt index 71d3d3dd..e9903cc1 100644 --- a/lib-common/src/main/java/com/xiaoyv/common/widget/dialog/AnimeLoadingDialog.kt +++ b/lib-common/src/main/java/com/xiaoyv/common/widget/dialog/AnimeLoadingDialog.kt @@ -4,11 +4,11 @@ import android.content.Context import android.view.LayoutInflater import androidx.appcompat.app.AlertDialog import androidx.fragment.app.FragmentActivity -import com.blankj.utilcode.util.ScreenUtils +import com.xiaoyv.common.R import com.xiaoyv.common.databinding.ViewLoadingBinding import com.xiaoyv.widget.dialog.UiDialog +import com.xiaoyv.widget.kts.dpi import com.xiaoyv.widget.kts.updateWindowParams -import kotlin.math.roundToInt /** * AnimeLoadingDialog @@ -51,8 +51,7 @@ class AnimeLoadingDialog(context: Context) : AlertDialog(context), UiDialog { window.setDimAmount(0.25f) window.setBackgroundDrawableResource(com.xiaoyv.widget.R.color.ui_transparent) window.updateWindowParams { - width = (ScreenUtils.getScreenWidth() * 0.4).roundToInt() - height = width + width = 24.dpi * 2 + context.resources.getDimensionPixelSize(R.dimen.avatar_size) } setCancelable(canCancelable) diff --git a/lib-common/src/main/res/layout/view_loading.xml b/lib-common/src/main/res/layout/view_loading.xml index 3f7ad83d..6496e6e2 100644 --- a/lib-common/src/main/res/layout/view_loading.xml +++ b/lib-common/src/main/res/layout/view_loading.xml @@ -1,15 +1,17 @@ \ No newline at end of file