From 7e6f25d03093d577490f3796c31dd6c17531393b Mon Sep 17 00:00:00 2001 From: Mygod Date: Wed, 2 May 2018 21:34:31 -0700 Subject: [PATCH] Fix selectable --- mobile/build.gradle | 2 +- .../src/main/java/be/mygod/vpnhotspot/TetheringFragment.kt | 5 ++++- mobile/src/main/res/layout/fragment_repeater.xml | 2 -- mobile/src/main/res/layout/listitem_client.xml | 1 + mobile/src/main/res/layout/listitem_interface.xml | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/mobile/build.gradle b/mobile/build.gradle index 6cb7964e..79d9ca13 100644 --- a/mobile/build.gradle +++ b/mobile/build.gradle @@ -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" } diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/TetheringFragment.kt b/mobile/src/main/java/be/mygod/vpnhotspot/TetheringFragment.kt index f3bf910a..7b49c03a 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/TetheringFragment.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/TetheringFragment.kt @@ -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) : 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) : diff --git a/mobile/src/main/res/layout/fragment_repeater.xml b/mobile/src/main/res/layout/fragment_repeater.xml index 4531d0bd..a1df716f 100644 --- a/mobile/src/main/res/layout/fragment_repeater.xml +++ b/mobile/src/main/res/layout/fragment_repeater.xml @@ -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 @@ diff --git a/mobile/src/main/res/layout/listitem_client.xml b/mobile/src/main/res/layout/listitem_client.xml index bf7d8fe0..2b2006b3 100644 --- a/mobile/src/main/res/layout/listitem_client.xml +++ b/mobile/src/main/res/layout/listitem_client.xml @@ -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"/> diff --git a/mobile/src/main/res/layout/listitem_interface.xml b/mobile/src/main/res/layout/listitem_interface.xml index f43d21c5..62c76570 100644 --- a/mobile/src/main/res/layout/listitem_interface.xml +++ b/mobile/src/main/res/layout/listitem_interface.xml @@ -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"/>