Fix selectable
This commit is contained in:
@@ -10,7 +10,7 @@ android {
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 27
|
||||
resConfigs "zh-rCN"
|
||||
versionCode 18
|
||||
versionCode 20
|
||||
versionName "1.3.0"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
@@ -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) :
|
||||
|
||||
@@ -71,7 +71,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_column="2"
|
||||
android:layout_row="1"
|
||||
android:focusable="false"
|
||||
android:text="@{data.addresses}"
|
||||
android:textIsSelectable="true"
|
||||
tools:text="192.168.49.1/24\n01:23:45:ab:cd:ef"/>
|
||||
@@ -93,7 +92,6 @@
|
||||
|
||||
<android.support.v4.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swipeRefresher"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{client.description}"
|
||||
android:textIsSelectable="true"
|
||||
tools:text="Connected to p2p0"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -37,13 +37,13 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{data.title}"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||
android:textIsSelectable="true"
|
||||
tools:text="wlan0"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{data.text}"
|
||||
android:textIsSelectable="@{data.selectable}"
|
||||
tools:text="192.168.43.1/24\n01:23:45:ab:cd:ef"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user