From 80e03d1cb758f61263cc223e85b071227f6fb43f Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Tue, 27 Jan 2015 08:34:09 +0100 Subject: [PATCH] Die Buttons umbennant. --- .../tueroeffner/DerivBroadcastReceiver.java | 12 ++--- app/src/main/res/layout/fragment_main.xml | 44 +++++++++++-------- 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/app/src/main/java/me/datenknoten/tueroeffner/DerivBroadcastReceiver.java b/app/src/main/java/me/datenknoten/tueroeffner/DerivBroadcastReceiver.java index 453638c..9123269 100644 --- a/app/src/main/java/me/datenknoten/tueroeffner/DerivBroadcastReceiver.java +++ b/app/src/main/java/me/datenknoten/tueroeffner/DerivBroadcastReceiver.java @@ -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); } } diff --git a/app/src/main/res/layout/fragment_main.xml b/app/src/main/res/layout/fragment_main.xml index 2ebe490..5fce1ab 100644 --- a/app/src/main/res/layout/fragment_main.xml +++ b/app/src/main/res/layout/fragment_main.xml @@ -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" /> -