Skip to content

Commit

Permalink
[Feat]: LCL 详情
Browse files Browse the repository at this point in the history
  • Loading branch information
why committed Dec 11, 2023
1 parent 8f1350d commit 8d1ee7b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
10 changes: 6 additions & 4 deletions lib-common/src/main/res/layout/view_loading.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ui_shape_rectangle_corner_6"
android:backgroundTint="?attr/colorSurface">

<com.google.android.material.progressindicator.CircularProgressIndicator
android:layout_width="@dimen/ui_size_48"
android:layout_height="@dimen/ui_size_48"
android:layout_width="@dimen/avatar_size"
android:layout_height="@dimen/avatar_size"
android:layout_gravity="center"
android:layout_marginHorizontal="@dimen/ui_size_24"
android:layout_marginVertical="@dimen/ui_size_24"
android:indeterminate="true"
app:trackCornerRadius="@dimen/ui_size_12" />
</FrameLayout>

0 comments on commit 8d1ee7b

Please sign in to comment.