public BaseContent( final Floating floating, final WifiManager wifiManager, final ScanResult scanResult) { super(); mWifiManager = wifiManager; mFloating = floating; mScanResult = scanResult; mScanResultSecurity = Wifi.ConfigSec.getScanResultSecurity(mScanResult); mIsOpenNetwork = Wifi.ConfigSec.isOpenNetwork(mScanResultSecurity); mView = View.inflate(mFloating, R.layout.base_content, null); ((TextView) mView.findViewById(R.id.SignalStrength_TextView)) .setText( SIGNAL_LEVEL[WifiManager.calculateSignalLevel(mScanResult.level, SIGNAL_LEVEL.length)]); final String rawSecurity = Wifi.ConfigSec.getDisplaySecirityString(mScanResult); final String readableSecurity = Wifi.ConfigSec.isOpenNetwork(rawSecurity) ? mFloating.getString(R.string.wifi_security_open) : rawSecurity; ((TextView) mView.findViewById(R.id.Security_TextView)).setText(readableSecurity); ((CheckBox) mView.findViewById(R.id.ShowPassword_CheckBox)).setOnCheckedChangeListener(this); mNumOpenNetworksKept = Settings.Secure.getInt( floating.getContentResolver(), Settings.Secure.WIFI_NUM_OPEN_NETWORKS_KEPT, 10); }
@Override public void onClick(View v) { mFloating.finish(); }
protected String getCancelString() { return mFloating.getString(android.R.string.cancel); }
public void changePassword() { mFloating.setContent(new ChangePasswordContent(mFloating, mWifiManager, mScanResult)); }