From da310a7e67364be9e747aa072c8c717118a3d8d5 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Tue, 27 Jan 2015 18:23:34 +0100 Subject: [PATCH] =?UTF-8?q?Den=20T=C3=BCr=20schlie=C3=9Fen=20button=20hinz?= =?UTF-8?q?ugef=C3=BCgt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/me/datenknoten/tueroeffner/MainActivity.java | 9 +++++++++ app/src/main/res/layout/fragment_main.xml | 8 ++++++++ app/src/main/res/values/strings.xml | 1 + 3 files changed, 18 insertions(+) diff --git a/app/src/main/java/me/datenknoten/tueroeffner/MainActivity.java b/app/src/main/java/me/datenknoten/tueroeffner/MainActivity.java index e1b82e2..b931bc5 100644 --- a/app/src/main/java/me/datenknoten/tueroeffner/MainActivity.java +++ b/app/src/main/java/me/datenknoten/tueroeffner/MainActivity.java @@ -216,4 +216,13 @@ public class MainActivity extends ActionBarActivity { Toast.makeText(v.getContext(), "Konnte Befehl „Tür öffnen“ nicht ausführen.", Toast.LENGTH_SHORT).show(); } } + + public void buttonLockInnerDoor(View v) { + try { + new CommandExecuter(getDoorKey()).doInBackground("indoor_lock"); + Toast.makeText(v.getContext(), getString(R.string.door_open), Toast.LENGTH_SHORT).show(); + } catch (Exception e) { + Toast.makeText(v.getContext(), "Konnte Befehl „Tür schließen“ nicht ausführen.", Toast.LENGTH_SHORT).show(); + } + } } diff --git a/app/src/main/res/layout/fragment_main.xml b/app/src/main/res/layout/fragment_main.xml index 5fce1ab..a8ad2a0 100644 --- a/app/src/main/res/layout/fragment_main.xml +++ b/app/src/main/res/layout/fragment_main.xml @@ -64,6 +64,14 @@ android:text="@string/button_inner_door_open" android:enabled="false" android:onClick="buttonUnlockInnerDoor" /> + +