Add singen button
This commit is contained in:
@@ -53,5 +53,16 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
Toast.makeText(this, toast, Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, toast, Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void btnSingen(View view) {
|
||||||
|
String toast = "Obacht! Etwas ist schief gelaufen.";
|
||||||
|
try {
|
||||||
|
REST.getString(URL + "/singen");
|
||||||
|
toast = "Singen aktiviert";
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
Toast.makeText(this, toast, Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -64,4 +64,25 @@
|
|||||||
android:text="Nächstes Muster:"
|
android:text="Nächstes Muster:"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="41dp"
|
||||||
|
android:text="Singen:"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textViewMuster" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnSingen"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="90dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:onClick="btnSingen"
|
||||||
|
android:text="Singen"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/textView"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/state" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
Reference in New Issue
Block a user