Merge "Scroll to top when user connects to a network." into oc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a253e1d416
@@ -176,6 +176,12 @@ public class WifiSettings extends RestrictedSettingsFragment
|
|||||||
// For Search
|
// For Search
|
||||||
private static final String DATA_KEY_REFERENCE = "main_toggle_wifi";
|
private static final String DATA_KEY_REFERENCE = "main_toggle_wifi";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tracks whether the user initiated a connection via clicking in order to autoscroll to the
|
||||||
|
* network once connected.
|
||||||
|
*/
|
||||||
|
private boolean mClickedConnect;
|
||||||
|
|
||||||
/* End of "used in Wifi Setup context" */
|
/* End of "used in Wifi Setup context" */
|
||||||
|
|
||||||
public WifiSettings() {
|
public WifiSettings() {
|
||||||
@@ -894,6 +900,10 @@ public class WifiSettings extends RestrictedSettingsFragment
|
|||||||
|
|
||||||
mConnectedAccessPointPreferenceCategory.addPreference(pref);
|
mConnectedAccessPointPreferenceCategory.addPreference(pref);
|
||||||
mConnectedAccessPointPreferenceCategory.setVisible(true);
|
mConnectedAccessPointPreferenceCategory.setVisible(true);
|
||||||
|
if (mClickedConnect) {
|
||||||
|
mClickedConnect = false;
|
||||||
|
scrollToPreference(mConnectedAccessPointPreferenceCategory);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Removes all preferences and hide the {@link #mConnectedAccessPointPreferenceCategory}. */
|
/** Removes all preferences and hide the {@link #mConnectedAccessPointPreferenceCategory}. */
|
||||||
@@ -1039,7 +1049,7 @@ public class WifiSettings extends RestrictedSettingsFragment
|
|||||||
mMetricsFeatureProvider.action(getActivity(), MetricsEvent.ACTION_WIFI_CONNECT,
|
mMetricsFeatureProvider.action(getActivity(), MetricsEvent.ACTION_WIFI_CONNECT,
|
||||||
isSavedNetwork);
|
isSavedNetwork);
|
||||||
mWifiManager.connect(config, mConnectListener);
|
mWifiManager.connect(config, mConnectListener);
|
||||||
scrollToPreference(mConnectedAccessPointPreferenceCategory);
|
mClickedConnect = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void connect(final int networkId, boolean isSavedNetwork) {
|
protected void connect(final int networkId, boolean isSavedNetwork) {
|
||||||
|
Reference in New Issue
Block a user