Add hidden SSID UI to dialog
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user