File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
app/src/main/kotlin/com/d4rk/netprobe/ui/speedtest Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -60,10 +60,6 @@ class SpeedTestViewModel(application: Application) : AndroidViewModel(applicatio
6060 ping.value = getPing()
6161 wifiStrength.value =
6262 getWifiStrength(getApplication()).toString()
63- maxSpeed.value = maxOf(
64- maxSpeed.value?.toFloatOrNull() ? : 0f ,
65- downloadSpeed.floatValue
66- ).toString()
6763 }
6864 }
6965
@@ -78,6 +74,12 @@ class SpeedTestViewModel(application: Application) : AndroidViewModel(applicatio
7874 } else {
7975 scanProgresses.add(scanProgress)
8076 }
77+ val currentSpeed = calculateSpeed(currentBytes, startTime)
78+ downloadSpeed.floatValue = currentSpeed
79+ maxSpeed.value = " %.1f" .format(maxOf(
80+ maxSpeed.value?.toFloatOrNull() ? : 0f ,
81+ currentSpeed
82+ ))
8183 downloadSpeed.floatValue = calculateSpeed(currentBytes, startTime)
8284 }
8385 }
You can’t perform that action at this time.
0 commit comments