[状态栏]标题全部改大写
[RouterOpt]测试代码
This commit is contained in:
@@ -94,7 +94,7 @@ internal class NetsImpl(ctx: Context): IFlow<NetStatus>(ctx) {
|
||||
private fun checkAndSend() {
|
||||
val connectionInfo = wifiMgr.connectionInfo
|
||||
val enabled = isNetConnected()
|
||||
val name = if (isLocationEnabled()) connectionInfo.ssid?.replace(Regex("[\\W]"), "") else "Wi-Fi"
|
||||
val name = if (isLocationEnabled()) connectionInfo.ssid?.replace(Regex("[\\W]"), "") else "WI-FI"
|
||||
loopCheckAndSendJob?.safeCancel()
|
||||
launch(Dispatchers.Default) { delay(1000); checkAndSend() }.also { loopCheckAndSendJob = it }
|
||||
var tr = 0
|
||||
|
||||
@@ -5,7 +5,6 @@ import android.content.*
|
||||
import android.graphics.*
|
||||
import android.graphics.drawable.*
|
||||
import android.transition.*
|
||||
import android.util.*
|
||||
import android.view.*
|
||||
import androidx.appcompat.widget.*
|
||||
import androidx.constraintlayout.widget.*
|
||||
@@ -80,8 +79,6 @@ internal class StatusView(private val model: StatusModel, ctx: Context): Constra
|
||||
dot.visibility = View.INVISIBLE
|
||||
}
|
||||
val old = adapter.data
|
||||
Log.d(TAG, "receive update --new - data: ${data.second.joinToString(",")}")
|
||||
Log.d(TAG, "receive update --old - data: ${old.joinToString(",")}")
|
||||
val result = DiffUtil.calculateDiff(StatusDiffCallback(old, data.second))
|
||||
adapter.data = data.second
|
||||
result.dispatchUpdatesTo(adapter)
|
||||
|
||||
@@ -50,15 +50,15 @@ internal class StatusAdapter(val ctx: Context, var data: ArrayList<Status>): Rec
|
||||
} else {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_can_disable)
|
||||
}
|
||||
tv.text = "Can"
|
||||
tv.text = "CAN"
|
||||
}
|
||||
is NetStatus -> {
|
||||
if (status.enabled) {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_net_enable)
|
||||
tv.text = status.name ?: "Wi-Fi"
|
||||
tv.text = status.name ?: "WI-FI"
|
||||
} else {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_net_disable)
|
||||
tv.text = "Wi-Fi"
|
||||
tv.text = "WI-FI"
|
||||
}
|
||||
}
|
||||
is GpsStatus -> {
|
||||
@@ -67,7 +67,7 @@ internal class StatusAdapter(val ctx: Context, var data: ArrayList<Status>): Rec
|
||||
} else {
|
||||
iv.background = ContextCompat.getDrawable(itemView.context, drawable.icon_dev_status_gps_disable)
|
||||
}
|
||||
tv.text = "Gps"
|
||||
tv.text = "GPS"
|
||||
}
|
||||
is TracingStatus -> {
|
||||
when(status.state) {
|
||||
|
||||
Reference in New Issue
Block a user