Zurück-Button minimiert app

Homescreen zeigt an als was man noch angemeldet ist
Felder können bei eingabe nicht mehr leer sein
app erzeugt bei installation nicht mehr 2 Icons
This commit is contained in:
JG-Cody 2021-04-16 21:41:45 +02:00
parent cb08627b0a
commit d2ebb91397
40 changed files with 578 additions and 111 deletions

View File

@ -11,6 +11,9 @@ android {
targetSdkVersion 29
versionCode 1
versionName "1.0"
multiDexEnabled true
archivesBaseName = "Teraplex"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

View File

@ -3,6 +3,7 @@
package="de.jg_cody.Teraplex">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 KiB

After

Width:  |  Height:  |  Size: 491 KiB

View File

@ -1,10 +1,15 @@
package de.jg_cody.Teraplex.ui.Schlafzimmer;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@ -13,13 +18,28 @@ import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import de.jg_cody.Teraplex.R;
import de.jg_cody.Teraplex.SSH_connection;
public class SchlafzimmerFragment extends Fragment {
public static String user, password, ip;
Button schlafzimmeru1aus;
Button schlafzimmeru1an;
Button schlafzimmeru2aus;
Button schlafzimmeru2an;
Button schlafzimmeru3aus;
Button schlafzimmeru3an;
private SchlafzimmerViewModel schlafzimmerViewModel;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
SharedPreferences prefs = getContext().getSharedPreferences("logindata", Context.MODE_PRIVATE);
user = prefs.getString("user", null);
password = prefs.getString("password", null);
ip = prefs.getString("ip", null);
schlafzimmerViewModel =
new ViewModelProvider(this).get(SchlafzimmerViewModel.class);
View root = inflater.inflate(R.layout.fragment_schlafzimmer, container, false);
@ -30,6 +50,85 @@ public class SchlafzimmerFragment extends Fragment {
textView.setText(s);
}
});
schlafzimmeru1aus = (Button) root.findViewById(R.id.schlafzimmeru1aus);
schlafzimmeru1aus.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
Toast.makeText(getContext(), "Lampe wird ausgeschaltet...", Toast.LENGTH_SHORT).show();
SSH_connection.executeRemoteCommand(ip, user, password, "sudo /root/raspberry-remote/send 11111 4 0");
} catch (Exception e) {
}
}
});
schlafzimmeru1an = (Button) root.findViewById(R.id.schlafzimmeru1an);
schlafzimmeru1an.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
Toast.makeText(getContext(), "Lampe wird angeschaltet...", Toast.LENGTH_SHORT).show();
SSH_connection.executeRemoteCommand(ip, user, password, "sudo /root/raspberry-remote/send 11111 4 1");
} catch (Exception e) {
}
}
});
schlafzimmeru2aus = (Button) root.findViewById(R.id.schlafzimmeru2aus);
schlafzimmeru2aus.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
Toast.makeText(getContext(), "Lampe wird ausgeschaltet...", Toast.LENGTH_SHORT).show();
SSH_connection.executeRemoteCommand(ip, user, password, "sudo /root/raspberry-remote/send 11111 2 0");
} catch (Exception e) {
}
}
});
schlafzimmeru2an = (Button) root.findViewById(R.id.schlafzimmeru2an);
schlafzimmeru2an.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
Toast.makeText(getContext(), "Lampe wird angeschaltet...", Toast.LENGTH_SHORT).show();
SSH_connection.executeRemoteCommand(ip, user, password, "sudo /root/raspberry-remote/send 11111 2 1");
} catch (Exception e) {
}
}
});
schlafzimmeru3aus = (Button) root.findViewById(R.id.schlafzimmeru3aus);
schlafzimmeru3aus.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
Toast.makeText(getContext(), "Lampe wird ausgeschaltet...", Toast.LENGTH_SHORT).show();
SSH_connection.executeRemoteCommand(ip, user, password, "sudo /root/raspberry-remote/send 11111 3 0");
} catch (Exception e) {
}
}
});
schlafzimmeru3an = (Button) root.findViewById(R.id.schlafzimmeru3an);
schlafzimmeru3an.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
Toast.makeText(getContext(), "Lampe wird angeschaltet...", Toast.LENGTH_SHORT).show();
SSH_connection.executeRemoteCommand(ip, user, password, "sudo /root/raspberry-remote/send 11111 3 1");
} catch (Exception e) {
}
}
});
return root;
}
}

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M11,7L9.6,8.4l2.6,2.6H2v2h10.2l-2.6,2.6L11,17l5,-5L11,7zM20,19h-8v2h8c1.1,0 2,-0.9 2,-2V5c0,-1.1 -0.9,-2 -2,-2h-8v2h8V19z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M17,7l-1.41,1.41L18.17,11H8v2h10.17l-2.58,2.58L17,17l5,-5zM4,5h8V3H4c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h8v-2H4V5z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M24,8.98C20.93,5.9 16.69,4 12,4C7.31,4 3.07,5.9 0,8.98L12,21v0l0,0L24,8.98zM2.92,9.07C5.51,7.08 8.67,6 12,6s6.49,1.08 9.08,3.07l-1.43,1.43C17.5,8.94 14.86,8 12,8s-5.5,0.94 -7.65,2.51L2.92,9.07z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M13,3h-2v10h2L13,3zM17.83,5.17l-1.42,1.42C17.99,7.86 19,9.81 19,12c0,3.87 -3.13,7 -7,7s-7,-3.13 -7,-7c0,-2.19 1.01,-4.14 2.58,-5.42L6.17,5.17C4.23,6.82 3,9.26 3,12c0,4.97 4.03,9 9,9s9,-4.03 9,-9c0,-2.74 -1.23,-5.18 -3.17,-6.83z"/>
</vector>

View File

@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M12,5V2L8,6l4,4V7c3.31,0 6,2.69 6,6c0,2.97 -2.17,5.43 -5,5.91v2.02c3.95,-0.49 7,-3.85 7,-7.93C20,8.58 16.42,5 12,5z"/>
<path
android:fillColor="#FF000000"
android:pathData="M6,13c0,-1.65 0.67,-3.15 1.76,-4.24L6.34,7.34C4.9,8.79 4,10.79 4,13c0,4.08 3.05,7.44 7,7.93v-2.02C8.17,18.43 6,15.97 6,13z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M23.64,7c-0.45,-0.34 -4.93,-4 -11.64,-4 -1.5,0 -2.89,0.19 -4.15,0.48L18.18,13.8 23.64,7zM17.04,15.22L3.27,1.44 2,2.72l2.05,2.06C1.91,5.76 0.59,6.82 0.36,7l11.63,14.49 0.01,0.01 0.01,-0.01 3.9,-4.86 3.32,3.32 1.27,-1.27 -3.46,-3.46z"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M12,4C7.31,4 3.07,5.9 0,8.98L12,21L24,8.98C20.93,5.9 16.69,4 12,4z"/>
</vector>

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Theme.Teraplex.AppBarOverlay">
</com.google.android.material.appbar.AppBarLayout>
<include
android:id="@+id/include"
layout="@layout/content_main" />
<de.jg_cody.Teraplex.MovableFloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="?android:attr/fingerprintAuthDrawable" />
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_anchorGravity="center"
app:popupTheme="@style/Theme.Teraplex.PopupOverlay" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -17,10 +17,11 @@
<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:background="@drawable/background"
android:fitsSystemWindows="true"
android:scaleType="centerInside"
app:headerLayout="@layout/nav_header_main"
app:itemIconTint="@color/white"
app:itemTextColor="#FFFFFF"

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
@ -13,16 +12,11 @@
android:layout_height="wrap_content"
android:theme="@style/Theme.Teraplex.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/Theme.Teraplex.PopupOverlay" />
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_main" />
<include
android:id="@+id/include"
layout="@layout/content_main" />
<de.jg_cody.Teraplex.MovableFloatingActionButton
android:id="@+id/fab"
@ -30,6 +24,14 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_dialog_email" />
app:srcCompat="?android:attr/fingerprintAuthDrawable" />
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_anchorGravity="center"
app:popupTheme="@style/Theme.Teraplex.PopupOverlay" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -8,17 +8,234 @@
tools:context=".ui.Schlafzimmer.SchlafzimmerFragment"
android:background="@drawable/background">
<TextView
android:id="@+id/überschrift5"
android:layout_width="193dp"
android:layout_height="33dp"
android:layout_marginTop="100dp"
android:gravity="center_horizontal"
android:text="Überschrift4"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@+id/seekBar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/überschrift4" />
<Button
android:id="@+id/ü10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hapticFeedbackEnabled="true"
android:text="AN"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/ü11"
app:layout_constraintTop_toBottomOf="@+id/überschrift5" />
<Button
android:id="@+id/ü11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hapticFeedbackEnabled="true"
android:text="AUS"
app:layout_constraintEnd_toStartOf="@+id/ü10"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/überschrift5" />
<TextView
android:id="@+id/überschrift4"
android:layout_width="193dp"
android:layout_height="33dp"
android:layout_marginTop="100dp"
android:gravity="center_horizontal"
android:text="Überschrift4"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@+id/seekBar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/überschrift3" />
<Button
android:id="@+id/ü7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hapticFeedbackEnabled="true"
android:text="AUS"
app:layout_constraintEnd_toStartOf="@+id/ü9"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/überschrift4" />
<Button
android:id="@+id/ü9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hapticFeedbackEnabled="true"
android:text="AN"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/ü7"
app:layout_constraintTop_toBottomOf="@+id/überschrift4" />
<TextView
android:id="@+id/überschrift3"
android:layout_width="193dp"
android:layout_height="33dp"
android:layout_marginTop="100dp"
android:gravity="center_horizontal"
android:text="Überschrift3"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@+id/seekBar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/überschrift2" />
<Button
android:id="@+id/ü6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hapticFeedbackEnabled="true"
android:text="AN"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/ü5"
app:layout_constraintTop_toBottomOf="@+id/überschrift3" />
<Button
android:id="@+id/ü5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hapticFeedbackEnabled="true"
android:text="AUS"
app:layout_constraintEnd_toStartOf="@+id/ü6"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/überschrift3" />
<TextView
android:id="@+id/überschrift1"
android:layout_width="193dp"
android:layout_height="33dp"
android:layout_marginTop="50dp"
android:gravity="center_horizontal"
android:text="Überschrift1"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@+id/seekBar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/divider" />
<Button
android:id="@+id/ü1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hapticFeedbackEnabled="true"
android:text="AUS"
app:layout_constraintEnd_toStartOf="@+id/ü2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/überschrift1" />
<Button
android:id="@+id/ü2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hapticFeedbackEnabled="true"
android:text="AN"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/ü1"
app:layout_constraintTop_toBottomOf="@+id/überschrift1" />
<TextView
android:id="@+id/überschrift2"
android:layout_width="193dp"
android:layout_height="33dp"
android:layout_marginTop="100dp"
android:gravity="center_horizontal"
android:text="Überschrift2"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@+id/seekBar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/überschrift1" />
<Button
android:id="@+id/ü3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hapticFeedbackEnabled="true"
android:text="AUS"
app:layout_constraintEnd_toStartOf="@+id/ü4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/überschrift2" />
<Button
android:id="@+id/ü4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hapticFeedbackEnabled="true"
android:text="AN"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/ü3"
app:layout_constraintTop_toBottomOf="@+id/überschrift2" />
<EditText
android:id="@+id/button_input"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="75dp"
android:backgroundTint="#FFFFFF"
android:ems="10"
android:hint="NAME"
android:inputType="text"
android:textColor="#FFFFFF"
android:textColorHint="#FFFFFF"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.542"
app:layout_constraintStart_toEndOf="@+id/add_button"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/add_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="75dp"
android:hapticFeedbackEnabled="true"
android:text="ADD BUTTON"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/text_flur"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="4dp"
android:gravity="center_horizontal"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent" />
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="20dp"
android:background="@color/white"
android:fadingEdge="horizontal|vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/button_input" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -95,7 +95,9 @@
android:id="@+id/loginButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hapticFeedbackEnabled="true"
android:text="Login"
app:icon="@drawable/login_24px"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/passwordInput" />
@ -104,9 +106,9 @@
android:id="@+id/wlan_an"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="118dp"
android:layout_marginLeft="118dp"
android:hapticFeedbackEnabled="true"
android:text="AN"
app:icon="@drawable/signal_wifi_statusbar_4_bar_24px"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/wlan_aus"
app:layout_constraintTop_toBottomOf="@+id/textView5" />
@ -115,7 +117,9 @@
android:id="@+id/wlan_aus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hapticFeedbackEnabled="true"
android:text="AUS"
app:icon="@drawable/signal_wifi_off_24px"
app:layout_constraintEnd_toStartOf="@+id/wlan_an"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView5" />

View File

@ -26,7 +26,9 @@
android:id="@+id/shutdown"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hapticFeedbackEnabled="true"
android:text="SHUTDOWN"
app:icon="@drawable/power_settings_new_24px"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/reboot"
app:layout_constraintTop_toBottomOf="@+id/Serverbefehle" />
@ -35,7 +37,9 @@
android:id="@+id/reboot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hapticFeedbackEnabled="true"
android:text="REBOOT"
app:icon="@drawable/restart_alt_24px"
app:layout_constraintEnd_toStartOf="@+id/shutdown"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/Serverbefehle" />
@ -86,7 +90,9 @@
android:id="@+id/SendCommandButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hapticFeedbackEnabled="true"
android:text="SEND COMMAND"
app:icon="@drawable/send_24px"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/befehlInput" />

View File

@ -8,6 +8,108 @@
tools:context=".ui.Schlafzimmer.SchlafzimmerFragment"
android:background="@drawable/background">
<Button
android:id="@+id/schlafzimmeru3an"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hapticFeedbackEnabled="true"
android:text="AN"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/schlafzimmeru1aus"
app:layout_constraintTop_toBottomOf="@+id/schlafzimmeru3" />
<TextView
android:id="@+id/schlafzimmeru2"
android:layout_width="193dp"
android:layout_height="33dp"
android:gravity="center_horizontal"
android:text="Steckdose 2"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/schlafzimmeru3aus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hapticFeedbackEnabled="true"
android:text="AUS"
app:layout_constraintEnd_toStartOf="@+id/schlafzimmeru1an"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/schlafzimmeru3" />
<Button
android:id="@+id/schlafzimmeru2an"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hapticFeedbackEnabled="true"
android:text="AN"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/schlafzimmeru1aus"
app:layout_constraintTop_toBottomOf="@+id/schlafzimmeru2" />
<Button
android:id="@+id/schlafzimmeru2aus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hapticFeedbackEnabled="true"
android:text="AUS"
app:layout_constraintEnd_toStartOf="@+id/schlafzimmeru1an"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/schlafzimmeru2" />
<TextView
android:id="@+id/schlafzimmeru1"
android:layout_width="193dp"
android:layout_height="33dp"
android:gravity="center_horizontal"
android:text="Steckdose 1"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@+id/schlafzimmeru2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/schlafzimmeru3"
android:layout_width="193dp"
android:layout_height="33dp"
android:gravity="center_horizontal"
android:text="Steckdose 3"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/schlafzimmeru2" />
<Button
android:id="@+id/schlafzimmeru1aus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hapticFeedbackEnabled="true"
android:text="AUS"
app:layout_constraintEnd_toStartOf="@+id/schlafzimmeru1an"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/schlafzimmeru1" />
<Button
android:id="@+id/schlafzimmeru1an"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hapticFeedbackEnabled="true"
android:text="AN"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/schlafzimmeru1aus"
app:layout_constraintTop_toBottomOf="@+id/schlafzimmeru1" />
<TextView
android:id="@+id/text_schlafzimmer"
android:layout_width="match_parent"
@ -22,96 +124,4 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/textView3"
android:layout_width="193dp"
android:layout_height="33dp"
android:text="Raumtemperatur in °C"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@+id/seekBar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:gravity="center_horizontal" />
<TextView
android:id="@+id/textView4"
android:layout_width="193dp"
android:layout_height="33dp"
android:text="Elektrogeräte EIN/AUS"
android:textAlignment="center"
android:textColor="#FFFFFF"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@+id/switch1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/seekBar"
android:gravity="center_horizontal" />
<SeekBar
android:id="@+id/seekBar"
style="@android:style/Widget.DeviceDefault.Light.SeekBar"
android:layout_width="235dp"
android:layout_height="45dp"
android:max="30"
android:progress="15"
app:layout_constraintBottom_toTopOf="@+id/textView4"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView3" />
<Switch
android:id="@+id/switch1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="50dp"
android:layout_marginLeft="50dp"
android:text="Steckdose 1 "
android:textColor="#FFFFFF"
app:layout_constraintBottom_toTopOf="@+id/switch3"
app:layout_constraintEnd_toStartOf="@+id/switch2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView4" />
<Switch
android:id="@+id/switch3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="50dp"
android:layout_marginLeft="50dp"
android:text="Steckdose 3 "
android:textColor="#FFFFFF"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/switch4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/switch1" />
<Switch
android:id="@+id/switch2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="50dp"
android:layout_marginRight="50dp"
android:text="Steckdose 2 "
android:textColor="#FFFFFF"
app:layout_constraintBottom_toTopOf="@+id/switch4"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/switch1"
app:layout_constraintTop_toBottomOf="@+id/textView4" />
<Switch
android:id="@+id/switch4"
android:layout_width="129dp"
android:layout_height="22dp"
android:layout_marginEnd="50dp"
android:layout_marginRight="50dp"
android:text="Steckdose 4 "
android:textColor="#FFFFFF"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/switch3"
app:layout_constraintTop_toBottomOf="@+id/switch2" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -29,6 +29,7 @@
android:layout_height="wrap_content"
android:timePickerMode="clock"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

View File

@ -3,8 +3,15 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_settings"
android:id="@+id/logout"
android:icon="@drawable/ic_menu_share"
android:orderInCategory="100"
android:title="@string/action_logout"
android:title="LOGOUT"
app:showAsAction="never" />
<item
android:id="@+id/exit"
android:icon="@drawable/logout_24px"
android:orderInCategory="100"
android:title="EXIT"
app:showAsAction="always|never|collapseActionView" />
</menu>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_background"/>
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_background"/>
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

After

Width:  |  Height:  |  Size: 296 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -4,7 +4,7 @@
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/black</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_200</item>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#3DDC84</color>
</resources>