use of com.android.settingslib.wifi.AccessPointPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class WifiConnectionPreferenceController method updatePreference.
private void updatePreference(AccessPoint accessPoint) {
if (mPreference != null) {
mPreferenceGroup.removePreference(mPreference);
mPreference = null;
}
if (accessPoint == null) {
return;
}
if (mPrefContext != null) {
mPreference = new AccessPointPreference(accessPoint, mPrefContext, mBadgeCache, R.drawable.ic_wifi_signal_0, false);
mPreference.setKey(KEY);
mPreference.refresh();
mPreference.setOrder(order);
mPreference.setOnPreferenceClickListener(pref -> {
Bundle args = new Bundle();
mPreference.getAccessPoint().saveWifiState(args);
new SubSettingLauncher(mPrefContext).setTitleRes(R.string.pref_title_network_details).setDestination(WifiNetworkDetailsFragment.class.getName()).setArguments(args).setSourceMetricsCategory(mMetricsCategory).launch();
return true;
});
mPreferenceGroup.addPreference(mPreference);
}
}
Aggregations