Fix selectable

This commit is contained in:
Mygod
2018-05-02 21:34:31 -07:00
parent 481eb60f87
commit 7e6f25d030
5 changed files with 7 additions and 5 deletions

View File

@@ -66,12 +66,14 @@ class TetheringFragment : Fragment(), ServiceConnection {
val title: CharSequence
val text: CharSequence
val active: Boolean
val selectable: Boolean
}
inner class TetheredData(val iface: TetheredInterface) : Data {
override val icon: Int get() = TetherType.ofInterface(iface.name).icon
override val icon get() = TetherType.ofInterface(iface.name).icon
override val title get() = iface.name
override val text get() = iface.addresses
override val active = tetheringBinder?.isActive(iface.name) == true
override val selectable get() = true
}
inner class LocalHotspotData(private val lookup: Map<String, NetworkInterface>) : Data {
override val icon: Int get() {
@@ -86,6 +88,7 @@ class TetheringFragment : Fragment(), ServiceConnection {
"${configuration.SSID} - ${configuration.preSharedKey}\n${TetheredInterface(iface, lookup).addresses}"
}
override val active = hotspotBinder?.iface != null
override val selectable get() = active
}
private open class InterfaceViewHolder(val binding: ListitemInterfaceBinding) :