feat: statusBar ui

This commit is contained in:
2025-11-14 14:05:27 +08:00
parent 6b234f86e7
commit e5d17bc970
4 changed files with 28 additions and 13 deletions
@@ -18,6 +18,7 @@ import com.rokid.dcg.sprite.service.ISystemFuncService
import com.rokid.dcg.sprite.service.ITTSService
import com.rokid.dcg.sprite.service.ServiceManager
import com.rokid.dcg.sprite.syskey.SysKeyAction
import com.yuanxuan.rokid.toast.ToastUtils
import kotlinx.coroutines.CoroutineExceptionHandler
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
@@ -277,6 +278,7 @@ class DeviceServiceManager(val context: Application) : ConnectivityManager.Netwo
}
SysKeyAction.SPRITE_BUTTON_CLICK -> {
ToastUtils.showLong("SysKeyAction.SPRITE_BUTTON_CLICK")
Timber.d("点击拍照键 SPRITE_BUTTON_CLICK")
}
@@ -306,8 +308,11 @@ class DeviceServiceManager(val context: Application) : ConnectivityManager.Netwo
_wifiState.update {
val level = wifiManager.calculateSignalLevel(networkCapabilities.signalStrength)
WifiState.Connected(
// maxSignalLevel是4 level区间应该是 0-3 这里却返回了4 限制一下
level = level.coerceAtMost(wifiManager.maxSignalLevel - 1)
/**
* maxSignalLevel 是 4 level区间应该是 0-3 这里却返回了4 限制一下
* 参考 [com.yuanxuan.rokid.R.drawable.wifi_level_list] 0 为wifi断开
*/
level = level.coerceAtMost(wifiManager.maxSignalLevel - 1) + 1
)
}
}