Refine code style

This commit is contained in:
Mygod
2018-07-21 19:04:53 +08:00
parent b526de681e
commit 9220f9f113

View File

@@ -46,8 +46,8 @@ class WifiP2pDialogFragment : DialogFragment(), TextWatcher, DialogInterface.OnC
return config return config
} }
override fun onCreateDialog(savedInstanceState: Bundle?): AlertDialog { override fun onCreateDialog(savedInstanceState: Bundle?): AlertDialog =
return AlertDialog.Builder(requireContext()).apply { AlertDialog.Builder(requireContext()).apply {
mView = requireActivity().layoutInflater.inflate(R.layout.dialog_wifi_ap, null) mView = requireActivity().layoutInflater.inflate(R.layout.dialog_wifi_ap, null)
setView(mView) setView(mView)
setTitle(R.string.repeater_configure) setTitle(R.string.repeater_configure)
@@ -71,7 +71,6 @@ class WifiP2pDialogFragment : DialogFragment(), TextWatcher, DialogInterface.OnC
mSsid.addTextChangedListener(this@WifiP2pDialogFragment) mSsid.addTextChangedListener(this@WifiP2pDialogFragment)
mPassword.addTextChangedListener(this@WifiP2pDialogFragment) mPassword.addTextChangedListener(this@WifiP2pDialogFragment)
}.create() }.create()
}
override fun onStart() { override fun onStart() {
super.onStart() super.onStart()
@@ -101,9 +100,8 @@ class WifiP2pDialogFragment : DialogFragment(), TextWatcher, DialogInterface.OnC
false -> (activity as MainActivity).snackbar().setText(R.string.noisy_su_failure).show() false -> (activity as MainActivity).snackbar().setText(R.string.noisy_su_failure).show()
null -> (activity as MainActivity).snackbar().setText(R.string.root_unavailable).show() null -> (activity as MainActivity).snackbar().setText(R.string.root_unavailable).show()
} }
DialogInterface.BUTTON_NEUTRAL -> { DialogInterface.BUTTON_NEUTRAL ->
(targetFragment as TetheringFragment).adapter.repeaterManager.binder!!.resetCredentials() (targetFragment as TetheringFragment).adapter.repeaterManager.binder!!.resetCredentials()
} }
} }
}
} }