Make the SwitchBar appear immediately
- change the way the SwitchBar is shown and hidden - save its state - remove the delay transition code Change-Id: I07260430e6709b42517ca011f6d3c3446a626731
This commit is contained in:
@@ -96,20 +96,26 @@ public class WifiEnabler implements SwitchBar.OnSwitchChangeListener {
|
||||
mIntentFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
|
||||
}
|
||||
|
||||
public void resume(Context context) {
|
||||
mContext = context;
|
||||
// Wi-Fi state is sticky, so just let the receiver update UI
|
||||
mContext.registerReceiver(mReceiver, mIntentFilter);
|
||||
public void setupSwitchBar() {
|
||||
mSwitchBar.addOnSwitchChangeListener(this);
|
||||
mSwitchBar.show();
|
||||
}
|
||||
|
||||
public void pause() {
|
||||
mContext.unregisterReceiver(mReceiver);
|
||||
public void teardownSwitchBar() {
|
||||
mSwitchBar.removeOnSwitchChangeListener(this);
|
||||
mSwitchBar.hide();
|
||||
}
|
||||
|
||||
public void resume(Context context) {
|
||||
mContext = context;
|
||||
// Wi-Fi state is sticky, so just let the receiver update UI
|
||||
mContext.registerReceiver(mReceiver, mIntentFilter);
|
||||
}
|
||||
|
||||
public void pause() {
|
||||
mContext.unregisterReceiver(mReceiver);
|
||||
}
|
||||
|
||||
private void handleWifiStateChanged(int state) {
|
||||
switch (state) {
|
||||
case WifiManager.WIFI_STATE_ENABLING:
|
||||
|
Reference in New Issue
Block a user