Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	build.gradle
  • Loading branch information
anjiemo committed Dec 25, 2023
2 parents 3c6b907 + fbfb070 commit bfeb017
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ import by.kirich1409.viewbindingdelegate.viewBinding
import cn.cqautotest.sunnybeach.R
import cn.cqautotest.sunnybeach.app.AppActivity
import cn.cqautotest.sunnybeach.databinding.SobCardActivityBinding
import cn.cqautotest.sunnybeach.ktx.*
import cn.cqautotest.sunnybeach.ktx.context
import cn.cqautotest.sunnybeach.ktx.dp
import cn.cqautotest.sunnybeach.ktx.setTintColor
import cn.cqautotest.sunnybeach.ktx.startActivity
import cn.cqautotest.sunnybeach.ktx.toQrCodeBitmapOrNull
import cn.cqautotest.sunnybeach.manager.UserManager
import cn.cqautotest.sunnybeach.util.PosterShareDelegate
import cn.cqautotest.sunnybeach.util.SUNNY_BEACH_VIEW_USER_URL_PRE
import com.blankj.utilcode.util.ImageUtils
Expand Down Expand Up @@ -46,7 +51,9 @@ class SobCardActivity : AppActivity() {
override fun getLayoutId() = R.layout.sob_card_activity

override fun initView() {
val nickName = UserManager.loadUserBasicInfo()?.nickname.orEmpty().ifEmpty { "未获取到昵称" }
with(mBinding.includeSobCardFront) {
tvNickName.text = nickName
tvSobId.text = mSobId.manicured()
val qrContent = "$SUNNY_BEACH_VIEW_USER_URL_PRE${mSobId}"
val bitmap = qrContent.toQrCodeBitmapOrNull(size = 100.dp, bgColor = Color.TRANSPARENT, qrColor = Color.WHITE, margin = 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ import cn.cqautotest.sunnybeach.widget.BrowserView
import cn.cqautotest.sunnybeach.widget.BrowserView.BrowserChromeClient
import cn.cqautotest.sunnybeach.widget.BrowserView.BrowserViewClient
import cn.cqautotest.sunnybeach.widget.StatusLayout
import cn.cqautotest.sunnybeach.widget.StatusLayout.OnRetryListener
import com.scwang.smart.refresh.layout.SmartRefreshLayout
import com.scwang.smart.refresh.layout.api.RefreshLayout
import com.scwang.smart.refresh.layout.listener.OnRefreshListener
import java.util.*
import java.util.Locale

/**
* author : Android 轮子哥
Expand Down Expand Up @@ -93,11 +92,7 @@ class BrowserFragment : AppFragment<AppActivity>(), StatusAction, OnRefreshListe
override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
// 这里为什么要用延迟呢?因为加载出错之后会先调用 onReceivedError 再调用 onPageFinished
post {
showError(object : OnRetryListener {
override fun onRetry(layout: StatusLayout) {
reload()
}
})
showError { reload() }
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/share_sob_card.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_8"
android:text="A Lonely Cat"
tools:text="A Lonely Cat"
android:textColor="@color/white"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="@id/tv_sob_id"
Expand Down

0 comments on commit bfeb017

Please sign in to comment.