修复一些启动弹窗和客服 IM 的测试问题
This commit is contained in:
@ -58,7 +58,13 @@ class WelcomeDialog : BaseDialogFragment() {
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
binding.ivClose.setOnClickListener { dismiss() }
|
||||
binding.ivClose.setOnClickListener {
|
||||
try {
|
||||
dismiss()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
binding.welcome = mWelcomeEntity
|
||||
return binding.root
|
||||
}
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
package com.gh.common.view
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.Animatable
|
||||
import android.net.Uri
|
||||
import android.support.annotation.Nullable
|
||||
import android.util.AttributeSet
|
||||
import com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilder
|
||||
import com.facebook.drawee.controller.BaseControllerListener
|
||||
import com.facebook.drawee.view.SimpleDraweeView
|
||||
import com.facebook.imagepipeline.image.ImageInfo
|
||||
|
||||
class WrapContentDraweeView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : SimpleDraweeView(context, attrs, defStyleAttr) {
|
||||
|
||||
// we set a listener and update the view's aspect ratio depending on the loaded image
|
||||
private val listener = object : BaseControllerListener<ImageInfo>() {
|
||||
override fun onIntermediateImageSet(id: String?, @Nullable imageInfo: ImageInfo?) {
|
||||
updateViewSize(imageInfo)
|
||||
}
|
||||
|
||||
override fun onFinalImageSet(id: String?, @Nullable imageInfo: ImageInfo?, @Nullable animatable: Animatable?) {
|
||||
updateViewSize(imageInfo)
|
||||
}
|
||||
}
|
||||
|
||||
override fun setImageURI(uri: Uri?, callerContext: Any?) {
|
||||
val controller = (controllerBuilder as PipelineDraweeControllerBuilder)
|
||||
.setControllerListener(listener)
|
||||
.setCallerContext(callerContext)
|
||||
.setUri(uri)
|
||||
.setOldController(controller)
|
||||
.build()
|
||||
setController(controller)
|
||||
}
|
||||
|
||||
internal fun updateViewSize(@Nullable imageInfo: ImageInfo?) {
|
||||
if (imageInfo != null) {
|
||||
aspectRatio = imageInfo.width.toFloat() / imageInfo.height
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -117,7 +117,7 @@ class GameViewModel(application: Application, blockData: SubjectRecommendEntity?
|
||||
|
||||
|
||||
/**
|
||||
* 获取开启弹窗
|
||||
* 获取启动弹窗
|
||||
*/
|
||||
fun requestOpeningData() {
|
||||
val lastId = PreferenceManager.getDefaultSharedPreferences(getApplication()).getString(Constants.SP_LAST_OPENING_ID, "")
|
||||
|
||||
Reference in New Issue
Block a user