|
|
@@ -4,6 +4,7 @@ import android.graphics.Color
|
|
|
import android.view.Gravity
|
|
|
import android.view.View
|
|
|
import androidx.annotation.IntDef
|
|
|
+import androidx.compose.ui.graphics.vector.Group
|
|
|
import com.grkj.iscs.R
|
|
|
import com.grkj.iscs.databinding.DialogSwitchInfoBinding
|
|
|
import com.grkj.ui_base.utils.CommonUtils
|
|
|
@@ -30,8 +31,6 @@ class SwitchInfoDialog(
|
|
|
// 行为:可返回键关闭、无遮罩(透明)、居中
|
|
|
dialog.isCancelable = true
|
|
|
dialog.setMaskColor(Color.TRANSPARENT)
|
|
|
- dialog.align = CustomDialog.ALIGN.CENTER
|
|
|
- dialog.maxWidth = (v.resources.displayMetrics.widthPixels * 0.9f).toInt()
|
|
|
|
|
|
// --- 数据填充 ---
|
|
|
binding.switchName.text = switchName
|
|
|
@@ -42,14 +41,17 @@ class SwitchInfoDialog(
|
|
|
binding.switchStatus.setBackgroundResource(R.drawable.bg_switch_off)
|
|
|
binding.switchStatus.text = CommonUtils.getStr("switch_close")
|
|
|
}
|
|
|
+
|
|
|
STATUS_ON -> {
|
|
|
binding.switchStatus.setBackgroundResource(R.drawable.bg_switch_on)
|
|
|
binding.switchStatus.text = CommonUtils.getStr("switch_open")
|
|
|
}
|
|
|
+
|
|
|
STATUS_ALARM -> {
|
|
|
binding.switchStatus.setBackgroundResource(R.drawable.bg_switch_alarm)
|
|
|
binding.switchStatus.text = CommonUtils.getStr("switch_alarm")
|
|
|
}
|
|
|
+
|
|
|
else -> {
|
|
|
// 兜底
|
|
|
binding.switchStatus.setBackgroundResource(R.drawable.bg_switch_off)
|
|
|
@@ -77,7 +79,7 @@ class SwitchInfoDialog(
|
|
|
return CustomDialog.show(
|
|
|
SwitchInfoDialog(switchName, pointNfc, switchStatus),
|
|
|
CustomDialog.ALIGN.CENTER
|
|
|
- ).setAlignBaseViewGravity(view, Gravity.TOP)
|
|
|
+ ).setAlignBaseViewGravity(view, Gravity.CENTER_HORIZONTAL or Gravity.TOP)
|
|
|
}
|
|
|
}
|
|
|
}
|