Die Buttons umbennant.

This commit is contained in:
Tim Schumacher 2015-01-27 08:34:09 +01:00
parent c66fa6cd32
commit 80e03d1cb7
2 changed files with 32 additions and 24 deletions

View file

@ -23,20 +23,20 @@ public class DerivBroadcastReceiver extends BroadcastReceiver {
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.button2);
Button button = (Button) rootView.findViewById(R.id.button_buzzer);
button.setEnabled(true);
button = (Button) rootView.findViewById(R.id.button3);
button = (Button) rootView.findViewById(R.id.button_door_unlock);
button.setEnabled(true);
button = (Button) rootView.findViewById(R.id.button);
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.button2);
Button button = (Button) rootView.findViewById(R.id.button_buzzer);
button.setEnabled(false);
button = (Button) rootView.findViewById(R.id.button3);
button = (Button) rootView.findViewById(R.id.button_door_unlock);
button.setEnabled(false);
button = (Button) rootView.findViewById(R.id.button);
button = (Button) rootView.findViewById(R.id.button_door_open);
button.setEnabled(false);
}
}

View file

@ -37,25 +37,33 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_outer_door"
android:id="@+id/button3"
android:onClick="buttonOpenOuterDoor"
android:clickable="false"
android:enabled="false" />
android:id="@+id/button_buzzer"
android:enabled="false"
android:onClick="buttonOpenOuterDoor" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_inner_door"
android:id="@+id/button2"
android:onClick="buttonOpenInnerDoor"
android:enabled="false" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/button"
android:text="@string/button_inner_door_open"
android:enabled="false" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_inner_door"
android:id="@+id/button_door_unlock"
android:onClick="buttonOpenInnerDoor"
android:enabled="false" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/button_door_open"
android:text="@string/button_inner_door_open"
android:enabled="false"
android:onClick="buttonUnlockInnerDoor" />
</LinearLayout>
</LinearLayout>