Merge branch 'master' of /home/rara/git/AndroidStudioProjects/tueroeffner with conflicts.

This commit is contained in:
Gerome Bochmann 2015-02-10 19:19:55 +01:00
parent da310a7e67
commit 4fc40bf02b
2 changed files with 19 additions and 19 deletions

View file

@ -83,8 +83,8 @@
</content>
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-annotations-21.0.2" level="project" />
<orderEntry type="library" exported="" name="support-v4-21.0.2" level="project" />
<orderEntry type="library" exported="" name="support-annotations-21.0.2" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-21.0.2" level="project" />
</component>
</module>

View file

@ -21,24 +21,24 @@ public class DerivBroadcastReceiver extends BroadcastReceiver {
final String action = intent.getAction();
if (action.equals(WifiManager.NETWORK_STATE_CHANGED_ACTION)) {
NetworkInfo nwInfo = intent.getParcelableExtra(WifiManager.EXTRA_NETWORK_INFO);
if (nwInfo.getExtraInfo().equals(MainActivity.networkSSID) && nwInfo.isConnected()) {
View rootView = ((Activity)context).getWindow().getDecorView().findViewById(android.R.id.content);
Button button = (Button) rootView.findViewById(R.id.button_buzzer);
button.setEnabled(true);
button = (Button) rootView.findViewById(R.id.button_door_unlock);
button.setEnabled(true);
button = (Button) rootView.findViewById(R.id.button_door_open);
button.setEnabled(true);
Toast.makeText(context, context.getString(R.string.wlan_connected), Toast.LENGTH_SHORT).show();
} else {
View rootView = ((Activity)context).getWindow().getDecorView().findViewById(android.R.id.content);
Button button = (Button) rootView.findViewById(R.id.button_buzzer);
button.setEnabled(false);
button = (Button) rootView.findViewById(R.id.button_door_unlock);
button.setEnabled(false);
button = (Button) rootView.findViewById(R.id.button_door_open);
button.setEnabled(false);
}
if (nwInfo.getExtraInfo() != null && nwInfo.getExtraInfo().equals(MainActivity.networkSSID) && nwInfo.isConnected()) {
View rootView = ((Activity)context).getWindow().getDecorView().findViewById(android.R.id.content);
Button button = (Button) rootView.findViewById(R.id.button2);
button.setEnabled(true);
button = (Button) rootView.findViewById(R.id.button3);
button.setEnabled(true);
button = (Button) rootView.findViewById(R.id.button);
button.setEnabled(true);
Toast.makeText(context, context.getString(R.string.wlan_connected), Toast.LENGTH_SHORT).show();
} else {
View rootView = ((Activity)context).getWindow().getDecorView().findViewById(android.R.id.content);
Button button = (Button) rootView.findViewById(R.id.button2);
button.setEnabled(false);
button = (Button) rootView.findViewById(R.id.button3);
button.setEnabled(false);
button = (Button) rootView.findViewById(R.id.button);
button.setEnabled(false);
}
}
}
}