Fix flashing icons

This commit is contained in:
Mygod
2019-01-06 01:43:19 +08:00
parent e6943c69dd
commit 8b7b0b0b3e
2 changed files with 3 additions and 3 deletions

View File

@@ -107,7 +107,7 @@ class LocalOnlyHotspotService : IpNeighbourMonitoringService() {
SmartSnackbar.make(message).show() SmartSnackbar.make(message).show()
startFailure() startFailure()
} }
}, app.handler) }, null)
} catch (e: IllegalStateException) { } catch (e: IllegalStateException) {
Timber.w(e) Timber.w(e)
SmartSnackbar.make(e).show() SmartSnackbar.make(e).show()

View File

@@ -76,8 +76,8 @@ class LocalOnlyHotspotManager(private val parent: TetheringFragment) : Manager()
private val lookup: Map<String, NetworkInterface> get() = parent.ifaceLookup private val lookup: Map<String, NetworkInterface> get() = parent.ifaceLookup
override val icon: Int get() { override val icon: Int get() {
val iface = binder?.iface ?: return TetherType.WIFI.icon val iface = binder?.iface
return TetherType.ofInterface(iface).icon return (if (iface.isNullOrBlank()) TetherType.WIFI else TetherType.ofInterface(iface)).icon
} }
override val title: CharSequence get() { override val title: CharSequence get() {
val configuration = binder?.configuration ?: return parent.getString(R.string.tethering_temp_hotspot) val configuration = binder?.configuration ?: return parent.getString(R.string.tethering_temp_hotspot)