|
|
|
@ -70,9 +70,12 @@ class CommonTopBar : LinearLayout {
|
|
|
|
|
private val wifiCallback = object : WifiHelper.OnWifiLevelCallback {
|
|
|
|
|
override fun onEnable(enable: Boolean) {
|
|
|
|
|
Log.i(this@CommonTopBar.javaClass.name, "wifiCallback onEnable = $enable")
|
|
|
|
|
if (enable) {
|
|
|
|
|
mBinding?.wifi?.visibility = VISIBLE
|
|
|
|
|
} else {
|
|
|
|
|
// if (enable) {
|
|
|
|
|
// mBinding?.wifi?.visibility = VISIBLE
|
|
|
|
|
// } else {
|
|
|
|
|
// mBinding?.wifi?.visibility = GONE
|
|
|
|
|
// }
|
|
|
|
|
if (!enable) {
|
|
|
|
|
mBinding?.wifi?.visibility = GONE
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -80,6 +83,7 @@ class CommonTopBar : LinearLayout {
|
|
|
|
|
override fun onLevel(level: Int) {
|
|
|
|
|
Log.i(this@CommonTopBar.javaClass.name, "wifiCallback onLevel = $level")
|
|
|
|
|
val showLevel = (level + 1) * 20
|
|
|
|
|
mBinding?.wifi?.visibility = if (showLevel > 0) VISIBLE else GONE
|
|
|
|
|
mBinding?.wifi?.setImageLevel(showLevel)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|