From ed2426f77e3c0dea3e0dd2198ca69470f0534c42 Mon Sep 17 00:00:00 2001 From: Mygod Date: Fri, 15 Jul 2022 23:37:50 -0400 Subject: [PATCH] Fixes --- .../net/wifi/WifiApDialogFragment.kt | 6 +- .../be/mygod/vpnhotspot/util/RangeInput.kt | 4 +- mobile/src/main/res/layout/dialog_wifi_ap.xml | 104 ++++++++++-------- 3 files changed, 65 insertions(+), 49 deletions(-) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiApDialogFragment.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiApDialogFragment.kt index db279135..09606980 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiApDialogFragment.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiApDialogFragment.kt @@ -187,7 +187,7 @@ class WifiApDialogFragment : AlertDialogFragment band to RangeInput.fromString(text.text) } - maxChannelBandwidth = dialogView.maxChannelBandwidth.selectedItemId.toInt() + maxChannelBandwidth = (dialogView.maxChannelBandwidth.selectedItem as BandWidth).width } } @@ -258,7 +258,7 @@ class WifiApDialogFragment : AlertDialogFragment= 29) dialogView.macRandomization.isEnabled = false - else if (arg.p2pMode || Build.VERSION.SDK_INT < 31) dialogView.macRandomization.isGone = true + else if (arg.p2pMode || Build.VERSION.SDK_INT < 31) dialogView.macRandomizationWrapper.isGone = true if (arg.p2pMode || Build.VERSION.SDK_INT < 31) { dialogView.ieee80211ax.isGone = true dialogView.bridgedModeOpportunisticShutdown.isGone = true @@ -275,7 +275,7 @@ class WifiApDialogFragment : AlertDialogFragment + i.trim { it == '\u200b' || it.isWhitespace() }.toInt() + } require(blocks[0] in min..max) { "Out of range: ${blocks[0]}" } if (blocks.size == 2) { require(blocks[1] in min..max) { "Out of range: ${blocks[1]}" } diff --git a/mobile/src/main/res/layout/dialog_wifi_ap.xml b/mobile/src/main/res/layout/dialog_wifi_ap.xml index a2db780c..48e9c19c 100644 --- a/mobile/src/main/res/layout/dialog_wifi_ap.xml +++ b/mobile/src/main/res/layout/dialog_wifi_ap.xml @@ -233,28 +233,35 @@ android:imeOptions="flagForceAscii" android:inputType="textNoSuggestions" /> - - - + android:orientation="vertical"> + + + + - - - - + - + style="@style/wifi_item_label" + android:text="@string/wifi_mac_randomization" /> + + + + +