Den Tür schließen button hinzugefügt.

This commit is contained in:
Tim Schumacher 2015-01-27 18:23:34 +01:00
parent 80e03d1cb7
commit da310a7e67
3 changed files with 18 additions and 0 deletions

View file

@ -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();
}
}
}

View file

@ -64,6 +64,14 @@
android:text="@string/button_inner_door_open"
android:enabled="false"
android:onClick="buttonUnlockInnerDoor" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/door_lock"
android:id="@+id/button"
android:enabled="false"
android:onClick="buttonLockInnerDoor" />
</LinearLayout>
</LinearLayout>

View file

@ -14,5 +14,6 @@
<string name="buzzer_success">Buzzer betätigt</string>
<string name="door_unlock">Tür entsperrt</string>
<string name="door_open">Tür geöffnet</string>
<string name="door_lock">Schließen</string>
</resources>