fix ui problem of vip

This commit is contained in:
zhongchao
2022-10-19 11:51:55 +08:00
parent 1109917f73
commit fc71e35270
3 changed files with 6 additions and 17 deletions

View File

@@ -4,9 +4,7 @@ import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import kotlinx.android.synthetic.main.view_vip_identification.view.*
@@ -26,13 +24,8 @@ class VipIdentificationView @JvmOverloads constructor(
override fun onAttachedToWindow() {
super.onAttachedToWindow()
val lp = this.layoutParams as LayoutParams
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left_bus).toInt()
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top_bus).toInt()
} else {
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left_taxi).toInt()
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top_taxi).toInt()
}
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left).toInt()
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top).toInt()
this.layoutParams = lp
invalidate()
}