Add hidden SSID UI to dialog

This commit is contained in:
Mygod
2020-06-05 12:38:30 -04:00
parent c12bd1d6cb
commit faba486459
2 changed files with 13 additions and 1 deletions

View File

@@ -85,7 +85,10 @@ class WifiApDialogFragment : AlertDialogFragment<WifiApDialogFragment.Arg, WifiA
bssid = if (dialogView.bssid.length() != 0) { bssid = if (dialogView.bssid.length() != 0) {
MacAddressCompat.fromString(dialogView.bssid.toString()) MacAddressCompat.fromString(dialogView.bssid.toString())
} else null).apply { } else null).apply {
if (!arg.p2pMode) securityType = dialogView.security.selectedItemPosition if (!arg.p2pMode) {
securityType = dialogView.security.selectedItemPosition
isHiddenSsid = dialogView.hiddenSsid.isChecked
}
if (Build.VERSION.SDK_INT >= 23) { if (Build.VERSION.SDK_INT >= 23) {
val bandOption = dialogView.band.selectedItem as BandOption val bandOption = dialogView.band.selectedItem as BandOption
band = bandOption.band band = bandOption.band
@@ -140,6 +143,7 @@ class WifiApDialogFragment : AlertDialogFragment<WifiApDialogFragment.Arg, WifiA
} }
} else dialogView.bandWrapper.isGone = true } else dialogView.bandWrapper.isGone = true
if (!arg.readOnly) dialogView.bssid.addTextChangedListener(this@WifiApDialogFragment) if (!arg.readOnly) dialogView.bssid.addTextChangedListener(this@WifiApDialogFragment)
if (arg.p2pMode) dialogView.hiddenSsid.isGone = true
populateFromConfiguration(arg.configuration) populateFromConfiguration(arg.configuration)
} }
@@ -153,6 +157,7 @@ class WifiApDialogFragment : AlertDialogFragment<WifiApDialogFragment.Arg, WifiA
} else bandOptions.indexOfFirst { it.band == configuration.band }) } else bandOptions.indexOfFirst { it.band == configuration.band })
} }
dialogView.bssid.setText(configuration.bssid?.toString()) dialogView.bssid.setText(configuration.bssid?.toString())
dialogView.hiddenSsid.isChecked = configuration.isHiddenSsid
// TODO support more fields from SACC // TODO support more fields from SACC
} }

View File

@@ -121,6 +121,13 @@
android:inputType="textNoSuggestions" android:inputType="textNoSuggestions"
android:maxLength="17" /> android:maxLength="17" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<Switch
android:id="@+id/hidden_ssid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dip"
style="@style/wifi_item_label"
android:text="Hidden network"/>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
</LinearLayout> </LinearLayout>