Old version with non-working Camera photo download

This commit is contained in:
2025-10-06 18:33:41 +02:00
parent d46c1a3f0c
commit 7fa666bcd4
119 changed files with 9673 additions and 0 deletions

18
.gitignore vendored
View File

@@ -1,3 +1,4 @@
<<<<<<< HEAD
# ---> Java
# Compiled class file
*.class
@@ -59,3 +60,20 @@ google-services.json
# Android Profiling
*.hprof
=======
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
>>>>>>> fe08e92 (Old version with non-working Camera photo download)

3
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

1
.idea/.name generated Normal file
View File

@@ -0,0 +1 @@
Haussteuerung

6
.idea/compiler.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="17" />
</component>
</project>

10
.idea/deploymentTargetDropDown.xml generated Normal file
View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<value>
<entry key="app">
<State />
</entry>
</value>
</component>
</project>

19
.idea/gradle.xml generated Normal file
View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveExternalAnnotations" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>

10
.idea/migrations.xml generated Normal file
View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>

9
.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,9 @@
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

6
.idea/render.experimental.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RenderSettings">
<option name="showDecorations" value="true" />
</component>
</project>

1
app/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/build

47
app/build.gradle Normal file
View File

@@ -0,0 +1,47 @@
plugins {
alias(libs.plugins.androidApplication)
id 'com.google.gms.google-services'
}
android {
namespace 'com.haussteuerung'
compileSdk 34
defaultConfig {
applicationId "com.haussteuerung"
minSdk 26
targetSdk 34
versionCode 1
versionName "25.531.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation libs.appcompat
implementation libs.material
implementation libs.activity
implementation libs.constraintlayout
testImplementation libs.junit
androidTestImplementation libs.ext.junit
androidTestImplementation libs.espresso.core
implementation libs.pahoMqttv3
implementation libs.pahoMqttService
implementation libs.firebase.messaging
implementation libs.google.services
implementation libs.touchImageView
implementation libs.gson
}

47
app/google-services.json Normal file
View File

@@ -0,0 +1,47 @@
{
"project_info": {
"project_number": "90338321703",
"project_id": "haussteuerung-2c0bc",
"storage_bucket": "haussteuerung-2c0bc.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:90338321703:android:e1268a5a9e17bbaee57502",
"android_client_info": {
"package_name": "com.haussteuerung"
}
},
"oauth_client": [
{
"client_id": "90338321703-h3qke5pi2kvh2ddd7dm1jhig6sfp8tdk.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.haussteuerung",
"certificate_hash": "1ea709802c0d889e9860150e007ea0660e85a870"
}
},
{
"client_id": "90338321703-kmrum42be0923jpr611ggap4h123gd2q.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAl0JQ26RQ4j8xqfLCEpYFkrRtEVpKPTc0"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "90338321703-kmrum42be0923jpr611ggap4h123gd2q.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}

21
app/proguard-rules.pro vendored Normal file
View File

@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

BIN
app/release/app-release.apk Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,37 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.haussteuerung",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 1,
"versionName": "25.1002.1",
"outputFile": "app-release.apk"
}
],
"elementType": "File",
"baselineProfiles": [
{
"minApi": 28,
"maxApi": 30,
"baselineProfiles": [
"baselineProfiles/1/app-release.dm"
]
},
{
"minApi": 31,
"maxApi": 2147483647,
"baselineProfiles": [
"baselineProfiles/0/app-release.dm"
]
}
],
"minSdkVersionForDexing": 26
}

View File

@@ -0,0 +1,26 @@
package com.haussteuerung;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.haussteuerung", appContext.getPackageName());
}
}

View File

@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@drawable/haus_icon"
android:label="@string/app_name"
android:roundIcon="@drawable/haus_icon"
android:supportsRtl="true"
android:theme="@style/Theme.Haussteuerung"
tools:targetApi="31"
android:usesCleartextTraffic="true">
<activity
android:name=".activityChristmas"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".noConnection"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".FileDownload"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".activitySky"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".activityLWP"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".activityLog"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".activityLicht"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".activityHaus"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".activityGlocke"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".activityDorisLicht"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".activityDoris"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".MainActivity"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="@string/default_notification_channel_id" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/haus_icon" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/purple_200" />
<service
android:name=".MyFirebaseMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
</application>
</manifest>

View File

@@ -0,0 +1,125 @@
package com.haussteuerung;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.content.FileProvider;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import com.google.firebase.encoders.json.BuildConfig;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
public class FileDownload extends AppCompatActivity {
static String f1 = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + "/Haussteuerung_Flo.apk";
static File apk = new File(f1);
static boolean downloadFinished = false;
TextView txt_status;
Button button_Install;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_file_download);
// Ändern der Statusbar-Farbe
androidx.appcompat.app.ActionBar actionBar = getSupportActionBar();
assert actionBar != null;
actionBar.setBackgroundDrawable(AppCompatResources.getDrawable(getApplicationContext(), R.drawable.gradient_titlebar));
button_Install = findViewById(R.id.button_Install);
TextView txt_changelog = findViewById(R.id.txt_changelog);
txt_status = findViewById(R.id.txt_status);
downloadFile();
button_Install.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
installAPK();
}
});
}
Uri uriFromFile(Context context, File file) {
return FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".provider", file);
}
void installAPK() {
if (apk.exists()) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uriFromFile(getApplicationContext(), apk), "application/vnd.android.package-archive");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
try {
getApplicationContext().startActivity(intent);
} catch (ActivityNotFoundException e) {
e.printStackTrace();
Log.e("TAG", "Error in opening the file!");
}
} else {
Toast.makeText(getApplicationContext(), "installing", Toast.LENGTH_LONG).show();
}
}
public void downloadFile() {
if (apk.exists()) {
apk.delete();
}
String url = "http://www.klebl.info/download/Haussteuerung_Flo.apk";
Log.d("Foto", url);
Thread gfgThread = new Thread(() -> {
try {
InputStream in = null;
try {
in = new URL(url).openStream();
String text = "Verbindung zum Server erfolgreich. Download wird durchgeführt.";
txt_status.setText(text);
Log.d("APK", "Verbindung zum Server erfolgreich. Download wird durchgeführt.");
} catch (IOException e) {
String text = "Verbindungsfehler.";
txt_status.setText(text);
Log.d("APK", "Verbindungsfehler.");
}
try {
Files.copy(in, Paths.get(f1), StandardCopyOption.REPLACE_EXISTING);
downloadFinished = true;
button_Install.setBackgroundResource(R.drawable.alarm_false);
String text = "Download erfolgreich. Zum Installieren drücken!";
txt_status.setText(text);
Log.d("APK", "Download und Speichern erfolgreich.");
} catch (IOException e) {
String text = "Download fehlgeschlagen.";
txt_status.setText(text);
Log.d("APK", "Download fehlgeschlagen.");
}
} catch (Exception e) {
e.printStackTrace();
}
});
gfgThread.start();
}
}

View File

@@ -0,0 +1,596 @@
package com.haussteuerung;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import androidx.appcompat.widget.SwitchCompat;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import android.os.Handler;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.NumberPicker;
import android.widget.TextView;
import java.util.Timer;
import java.util.TimerTask;
public class FragmentHeizkoerper extends Fragment {
private Button btn_HK_Grossraum, btn_HK_Doris, btn_HK_Doris_Bad, btn_HK_Arbeitszimmer, btn_HK_Vorraum,
btn_HK_WCEG, btn_HK_Bad, btn_HK_Florian, btn_HK_Stefan, btn_HK_Dachboden;
private TextView tv_temp_Grossraum, tv_temp_Doris, tv_temp_Doris_Bad, tv_temp_Arbeitszimmer, tv_temp_Vorraum,
tv_temp_WCEG, tv_temp_Bad, tv_temp_Florian, tv_temp_Stefan, tv_temp_Dachboden;
private SwitchCompat switch_HK_Grossraum, switch_HK_Doris, switch_HK_Doris_Bad, switch_HK_Arbeitszimmer, switch_HK_Vorraum,
switch_HK_WCEG, switch_HK_Bad, switch_HK_Florian, switch_HK_Stefan, switch_HK_Dachboden;
public static String modeHKGrossraum = "", modeHKDoris = "", modeHKDorisBad = "", modeHKArbeitszimmer = "",
modeHKVorraum = "", modeHKWCEG = "", modeHKBad = "", modeHKFlorian = "", modeHKStefan = "", modeHKDachboden = "";
public static String istTempHKGrossraum = "", istTempHKDoris = "", istTempHKDorisBad = "", istTempHKArbeitszimmer = "",
istTempHKVorraum = "", istTempHKWCEG = "", istTempHKBad = "", istTempHKFlorian = "", istTempHKStefan = "", istTempHKDachboden = "";
public static String sollTempHKGrossraum = "", sollTempHKDoris = "", sollTempHKDorisBad = "", sollTempHKArbeitszimmer = "",
sollTempHKVorraum = "", sollTempHKWCEG = "", sollTempHKBad = "", sollTempHKFlorian = "", sollTempHKStefan = "", sollTempHKDachboden = "";
final Handler myHandler = new Handler();
final Timer myTimer = new Timer();
TimerTask myTask;
Context context;
View view;
public FragmentHeizkoerper() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// Inflate the layout for this fragment
view = inflater.inflate(R.layout.fragment_heizkoerper, container, false);
requireActivity().setTitle("Haussteuerung - Heizkörper");
handleButtons();
handleTextViews();
handleSwitches();
context = getContext();
return view;
}
// Runnable method
final Runnable myRunnable = new Runnable() {
public void run() {
Log.d("Heizkoerper","OK");
tv_temp_Grossraum.setText(istTempHKGrossraum);
setTextColor(tv_temp_Grossraum, istTempHKGrossraum);
tv_temp_Doris.setText(istTempHKDoris);
setTextColor(tv_temp_Doris, istTempHKDoris);
tv_temp_Doris_Bad.setText(istTempHKDorisBad);
setTextColor(tv_temp_Doris_Bad, istTempHKDorisBad);
tv_temp_Arbeitszimmer.setText(istTempHKArbeitszimmer);
setTextColor(tv_temp_Arbeitszimmer, istTempHKArbeitszimmer);
tv_temp_Vorraum.setText(istTempHKVorraum);
setTextColor(tv_temp_Vorraum, istTempHKVorraum);
tv_temp_WCEG.setText(istTempHKWCEG);
setTextColor(tv_temp_WCEG, istTempHKWCEG);
tv_temp_Bad.setText(istTempHKBad);
setTextColor(tv_temp_Bad, istTempHKBad);
tv_temp_Florian.setText(istTempHKFlorian);
setTextColor(tv_temp_Florian, istTempHKFlorian);
tv_temp_Stefan.setText(istTempHKStefan);
setTextColor(tv_temp_Stefan, istTempHKStefan);
tv_temp_Dachboden.setText(istTempHKDachboden);
setTextColor(tv_temp_Dachboden, istTempHKDachboden);
}
};
private void showNumberPickerDialog(Button button, String roomSollTemp, String room, SwitchCompat switchCompat) {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
final View view = this.getLayoutInflater().inflate(R.layout.layout_numberpicker, null);
builder.setView(view);
//builder.setTitle();
final NumberPicker picker = view.findViewById(R.id.picker);
String[] values = {"off","12.0","12.5","13.0","13.5","14.0","14.5","15.0","15.5","16.0","16.5","17.0","17.5","18.0",
"18.5","19.0","19.5","20.0","20.5","21.0","21.5","22.0","22.5","23.0","23.5","24.0","24.5","25.0",
"25.5","26.0","26.5","27.0","27.5","28.0","28.5","29.0","29.5","30.0","on"};
int ml = values.length;
picker.setWrapSelectorWheel(false);
picker.setMinValue(0);
picker.setMaxValue(ml - 1);
for(int y=0; y<values.length; y++) {
// Log.d("NumberPicker", values[y]);
if (values[y].equals(button.getText().toString())) {
picker.setValue(y);
}
}
picker.setDisplayedValues(values);
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
// Log.d("NumberPicker", String.valueOf(picker.getValue()));
// Log.d("NumberPicker", values[picker.getValue()]);
if (values[picker.getValue()].equals("on") || values[picker.getValue()].equals("off")) {
button.setText(values[picker.getValue()]);
} else {
button.setText(values[picker.getValue()]);
}
Log.d("SollTempGrossraum", "Solltemp" + roomSollTemp + ", Button " + button.getText());
if (!roomSollTemp.contentEquals(button.getText()))
{
if (switchCompat.isChecked()) {
Log.d("SollTemp" + room, "Temp zu Auto+Temp geändert");
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/temp", "auto " + button.getText().toString(), 2, false);
} else {
Log.d("SollTemp" + room, "Temp geändert");
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/temp", button.getText().toString(), 2, false);
}
} else {
Log.d("SollTemp" + room, "Temp gleich");
}
}
})
.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
builder.create().cancel();
}
});
builder.create().show();
}
private void handleButtons() {
btn_HK_Grossraum = view.findViewById(R.id.btn_HK_Grossraum);
btn_HK_Doris = view.findViewById(R.id.btn_HK_Doris);
btn_HK_Doris_Bad = view.findViewById(R.id.btn_HK_Doris_Bad);
btn_HK_Arbeitszimmer = view.findViewById(R.id.btn_HK_Arbeitszimmer);
btn_HK_Vorraum = view.findViewById(R.id.btn_HK_Vorraum);
btn_HK_WCEG = view.findViewById(R.id.btn_HK_WCEG);
btn_HK_Bad = view.findViewById(R.id.btn_HK_Bad);
btn_HK_Florian = view.findViewById(R.id.btn_HK_Florian);
btn_HK_Stefan = view.findViewById(R.id.btn_HK_Stefan);
btn_HK_Dachboden = view.findViewById(R.id.btn_HK_Dachboden);
Log.d("SollTempGrossraum", sollTempHKGrossraum);
Log.d("SollTempDoris", sollTempHKDoris);
Log.d("SollTempDorisBad", sollTempHKDorisBad);
Log.d("SollTempArbeitszimmer", sollTempHKArbeitszimmer);
Log.d("SollTempVorraum", sollTempHKVorraum);
Log.d("SollTempWCEG", sollTempHKWCEG);
Log.d("SollTempBad", sollTempHKBad);
Log.d("SollTempFlorian", sollTempHKFlorian);
Log.d("SollTempStefan", sollTempHKStefan);
Log.d("SollTempDachboden", sollTempHKDachboden);
btn_HK_Grossraum.setText(sollTempHKGrossraum);
btn_HK_Doris.setText(sollTempHKDoris);
btn_HK_Doris_Bad.setText(sollTempHKDorisBad);
btn_HK_Arbeitszimmer.setText(sollTempHKArbeitszimmer);
btn_HK_Vorraum.setText(sollTempHKVorraum);
btn_HK_WCEG.setText(sollTempHKWCEG);
btn_HK_Bad.setText(sollTempHKBad);
btn_HK_Florian.setText(sollTempHKFlorian);
btn_HK_Stefan.setText(sollTempHKStefan);
btn_HK_Dachboden.setText(sollTempHKDachboden);
btn_HK_Grossraum.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showNumberPickerDialog(btn_HK_Grossraum, sollTempHKGrossraum, "Grossraum", switch_HK_Grossraum);
}
});
btn_HK_Doris.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showNumberPickerDialog(btn_HK_Doris, sollTempHKDoris, "Doris_klein", switch_HK_Doris);
}
});
btn_HK_Doris_Bad.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showNumberPickerDialog(btn_HK_Doris_Bad, sollTempHKDorisBad, "Doris_Bad", switch_HK_Doris_Bad);
}
});
btn_HK_Arbeitszimmer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showNumberPickerDialog(btn_HK_Arbeitszimmer, sollTempHKArbeitszimmer, "Arbeitszimmer", switch_HK_Arbeitszimmer);
}
});
btn_HK_Vorraum.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showNumberPickerDialog(btn_HK_Vorraum, sollTempHKVorraum, "Vorraum", switch_HK_Vorraum);
}
});
btn_HK_WCEG.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showNumberPickerDialog(btn_HK_WCEG, sollTempHKWCEG, "WC", switch_HK_WCEG);
}
});
btn_HK_Bad.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showNumberPickerDialog(btn_HK_Bad, sollTempHKBad, "Bad", switch_HK_Bad);
}
});
btn_HK_Florian.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showNumberPickerDialog(btn_HK_Florian, sollTempHKFlorian, "Florian", switch_HK_Florian);
}
});
btn_HK_Stefan.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showNumberPickerDialog(btn_HK_Stefan, sollTempHKStefan, "Stefan", switch_HK_Stefan);
}
});
btn_HK_Dachboden.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showNumberPickerDialog(btn_HK_Dachboden, sollTempHKDachboden, "Dachboden", switch_HK_Dachboden);
}
});
}
private void handleTextViews() {
tv_temp_Grossraum = view.findViewById(R.id.tv_temp_Grossraum);
tv_temp_Doris = view.findViewById(R.id.tv_temp_Doris);
tv_temp_Doris_Bad = view.findViewById(R.id.tv_temp_Doris_Bad);
tv_temp_Arbeitszimmer = view.findViewById(R.id.tv_temp_Arbeitszimmer);
tv_temp_Vorraum = view.findViewById(R.id.tv_temp_Vorraum);
tv_temp_WCEG = view.findViewById(R.id.tv_temp_WCEG);
tv_temp_Bad = view.findViewById(R.id.tv_temp_Bad);
tv_temp_Florian = view.findViewById(R.id.tv_temp_Florian);
tv_temp_Stefan = view.findViewById(R.id.tv_temp_Stefan);
tv_temp_Dachboden = view.findViewById(R.id.tv_temp_Dachboden);
}
private void handleSwitches() {
switch_HK_Grossraum = view.findViewById(R.id.switch_HK_Grossraum);
switch_HK_Doris = view.findViewById(R.id.switch_HK_Doris);
switch_HK_Doris_Bad = view.findViewById(R.id.switch_HK_Doris_Bad);
switch_HK_Arbeitszimmer = view.findViewById(R.id.switch_HK_Arbeitszimmer);
switch_HK_Vorraum = view.findViewById(R.id.switch_HK_Vorraum);
switch_HK_WCEG = view.findViewById(R.id.switch_HK_WCEG);
switch_HK_Bad = view.findViewById(R.id.switch_HK_Bad);
switch_HK_Florian = view.findViewById(R.id.switch_HK_Florian);
switch_HK_Stefan = view.findViewById(R.id.switch_HK_Stefan);
switch_HK_Dachboden = view.findViewById(R.id.switch_HK_Dachboden);
if (modeHKGrossraum.equals("manual")) {
switch_HK_Grossraum.setChecked(false);
switch_HK_Grossraum.setText(R.string.man);
} else {
switch_HK_Grossraum.setChecked(true);
switch_HK_Grossraum.setText(R.string.auto);
}
if (modeHKDoris.equals("manual")) {
switch_HK_Doris.setChecked(false);
switch_HK_Doris.setText(R.string.man);
} else {
switch_HK_Doris.setChecked(true);
switch_HK_Doris.setText(R.string.auto);
}
if (modeHKDorisBad.equals("manual")) {
switch_HK_Doris_Bad.setChecked(false);
switch_HK_Doris_Bad.setText(R.string.man);
} else {
switch_HK_Doris_Bad.setChecked(true);
switch_HK_Doris_Bad.setText(R.string.auto);
}
if (modeHKArbeitszimmer.equals("manual")) {
switch_HK_Arbeitszimmer.setChecked(false);
switch_HK_Arbeitszimmer.setText(R.string.man);
} else {
switch_HK_Arbeitszimmer.setChecked(true);
switch_HK_Arbeitszimmer.setText(R.string.auto);
}
if (modeHKVorraum.equals("manual")) {
switch_HK_Vorraum.setChecked(false);
switch_HK_Vorraum.setText(R.string.man);
} else {
switch_HK_Vorraum.setChecked(true);
switch_HK_Vorraum.setText(R.string.auto);
}
if (modeHKWCEG.equals("manual")) {
switch_HK_WCEG.setChecked(false);
switch_HK_WCEG.setText(R.string.man);
} else {
switch_HK_WCEG.setChecked(true);
switch_HK_WCEG.setText(R.string.auto);
}
if (modeHKBad.equals("manual")) {
switch_HK_Bad.setChecked(false);
switch_HK_Bad.setText(R.string.man);
} else {
switch_HK_Bad.setChecked(true);
switch_HK_Bad.setText(R.string.auto);
}
if (modeHKFlorian.equals("manual")) {
switch_HK_Florian.setChecked(false);
switch_HK_Florian.setText(R.string.man);
} else {
switch_HK_Florian.setChecked(true);
switch_HK_Florian.setText(R.string.auto);
}
if (modeHKStefan.equals("manual")) {
switch_HK_Stefan.setChecked(false);
switch_HK_Stefan.setText(R.string.man);
} else {
switch_HK_Stefan.setChecked(true);
switch_HK_Stefan.setText(R.string.auto);
}
if (modeHKDachboden.equals("manual")) {
switch_HK_Dachboden.setChecked(false);
switch_HK_Dachboden.setText(R.string.man);
} else {
switch_HK_Dachboden.setChecked(true);
switch_HK_Dachboden.setText(R.string.auto);
}
switch_HK_Grossraum.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (switch_HK_Grossraum.isChecked()) {
Log.d("Mode" + modeHKGrossraum, "Mode geändert");
switch_HK_Grossraum.setText(R.string.auto);
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_Grossraum/set/mode", "auto", 2, false);
} else if (!switch_HK_Grossraum.isChecked()){
Log.d("Mode" + modeHKGrossraum, "Mode geändert");
switch_HK_Grossraum.setText(R.string.man);
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_Grossraum/set/mode", "manual", 2, false);
}
}
});
switch_HK_Doris.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (switch_HK_Doris.isChecked()) {
Log.d("Mode" + modeHKDoris, "Mode geändert");
switch_HK_Doris.setText(R.string.auto);
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_Doris_klein/set/mode", "auto", 2, false);
} else if (!switch_HK_Doris.isChecked()){
Log.d("Mode" + modeHKDoris, "Mode geändert");
switch_HK_Doris.setText(R.string.man);
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_Doris_klein/set/mode", "manual", 2, false);
}
}
});
switch_HK_Doris_Bad.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (switch_HK_Doris_Bad.isChecked()) {
Log.d("Mode" + modeHKDorisBad, "Mode auto");
switch_HK_Doris_Bad.setText(R.string.auto);
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_Doris_Bad/set/mode", "auto", 2, false);
} else if (!switch_HK_Doris_Bad.isChecked()){
Log.d("Mode" + modeHKDorisBad, "Mode manual");
switch_HK_Doris_Bad.setText(R.string.man);
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_Doris_Bad/set/mode", "manual", 2, false);
}
}
});
switch_HK_Arbeitszimmer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (switch_HK_Arbeitszimmer.isChecked()) {
Log.d("Mode" + modeHKArbeitszimmer, "Mode auto");
switch_HK_Arbeitszimmer.setText(R.string.auto);
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_Arbeitszimmer/set/mode", "auto", 2, false);
} else if (!switch_HK_Arbeitszimmer.isChecked()){
Log.d("Mode" + modeHKArbeitszimmer, "Mode manual");
switch_HK_Arbeitszimmer.setText(R.string.man);
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_Arbeitszimmer/set/mode", "manual", 2, false);
}
}
});
switch_HK_Vorraum.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (switch_HK_Vorraum.isChecked()) {
Log.d("Mode" + modeHKVorraum, "Mode auto");
switch_HK_Vorraum.setText(R.string.auto);
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_Vorraum/set/mode", "auto", 2, false);
} else if (!switch_HK_Vorraum.isChecked()) {
Log.d("Mode" + modeHKVorraum, "Mode manual");
switch_HK_Vorraum.setText(R.string.man);
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_Vorraum/set/mode", "manual", 2, false);
}
}
});
switch_HK_WCEG.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (switch_HK_WCEG.isChecked()) {
Log.d("Mode" + modeHKWCEG, "Mode auto");
switch_HK_WCEG.setText(R.string.auto);
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_WC/set/mode", "auto", 2, false);
} else if (!switch_HK_WCEG.isChecked()){
Log.d("Mode" + modeHKWCEG, "Mode manual");
switch_HK_WCEG.setText(R.string.man);
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_WC/set/mode", "manual", 2, false);
}
}
});
switch_HK_Bad.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (switch_HK_Bad.isChecked()) {
Log.d("Mode" + modeHKBad, "Mode auto");
switch_HK_Bad.setText(R.string.auto);
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_Bad/set/mode", "auto", 2, false);
} else if (!switch_HK_Bad.isChecked()){
Log.d("Mode" + modeHKBad, "Mode manual");
switch_HK_Bad.setText(R.string.man);
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_Bad/set/mode", "manual", 2, false);
}
}
});
switch_HK_Florian.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (switch_HK_Florian.isChecked()) {
Log.d("Mode" + modeHKFlorian, "Mode geändert");
switch_HK_Florian.setText(R.string.auto);
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_Florian/set/mode", "auto", 2, false);
} else if (!switch_HK_Florian.isChecked()){
Log.d("Mode" + modeHKFlorian, "Mode geändert");
switch_HK_Florian.setText(R.string.man);
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_Florian/set/mode", "manual", 2, false);
}
}
});
switch_HK_Stefan.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (switch_HK_Stefan.isChecked()) {
Log.d("Mode" + modeHKStefan, "Mode auto");
switch_HK_Stefan.setText(R.string.auto);
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_Stefan/set/mode", "auto", 2, false);
} else if (!switch_HK_Stefan.isChecked()){
Log.d("Mode" + modeHKStefan, "Mode manual");
switch_HK_Stefan.setText(R.string.man);
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_Stefan/set/mode", "manual", 2, false);
}
}
});
switch_HK_Dachboden.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (switch_HK_Dachboden.isChecked()) {
Log.d("Mode" + modeHKDachboden, "Mode auto");
switch_HK_Dachboden.setText(R.string.auto);
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_Dachboden/set/mode", "auto", 2, false);
} else if (!switch_HK_Dachboden.isChecked()){
Log.d("Mode" + modeHKDachboden, "Mode manual");
switch_HK_Dachboden.setText(R.string.man);
//MqttClient.publish("fhem/Heizung/MAX_" + room + "/set/Temp", button.getText().toString(), 2, false);
MqttClient.publish("fhem/Heizung/MAX_Dachboden/set/mode", "manual", 2, false);
}
}
});
}
private void setTextColor(TextView tv, String temp) {
if (!temp.equals("")) {
double tempDouble = Double.parseDouble(temp);
if (tempDouble >= 25) {
tv.setTextColor(ContextCompat.getColor(context, R.color.twoFive));
}
if (tempDouble >= 24 && tempDouble < 25) {
tv.setTextColor(ContextCompat.getColor(context, R.color.twoFour));
}
if (tempDouble >= 23 && tempDouble < 24) {
tv.setTextColor(ContextCompat.getColor(context, R.color.twoThree));
}
if (tempDouble >= 22 && tempDouble < 23) {
tv.setTextColor(ContextCompat.getColor(context, R.color.twoTwo));
}
if (tempDouble >= 21 && tempDouble < 22) {
tv.setTextColor(ContextCompat.getColor(context, R.color.twoOne));
}
if (tempDouble >= 20 && tempDouble < 21) {
tv.setTextColor(ContextCompat.getColor(context, R.color.twoZero));
}
if (tempDouble >= 19 && tempDouble < 20) {
tv.setTextColor(ContextCompat.getColor(context, R.color.oneNine));
}
if (tempDouble < 19) {
tv.setTextColor(ContextCompat.getColor(context, R.color.oneEight));
}
} else {
Log.d("Temp", "String Temp in FragmentHeizkörper is empty.");
}
}
@Override
public void onResume() {
super.onResume();
myTask = new TimerTask() {
public void run() {
myHandler.post(myRunnable); // updateUI method
}
};
myTimer.schedule(myTask,0,1000); // TimerTask, delay, period
Log.d("State", "on Resume");
}
@Override
public void onStop() {
super.onStop();
myTask.cancel();
Log.d("State", "on Stop");
}
@Override
public void onPause() {
super.onPause();
Log.d("State", "on Pause");
}
@Override
public void onDestroy() {
super.onDestroy();
// myTimer.cancel();
}
}

View File

@@ -0,0 +1,334 @@
package com.haussteuerung;
import android.app.AlertDialog;
import android.app.TimePickerDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import androidx.appcompat.widget.SwitchCompat;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.NumberPicker;
import android.widget.TimePicker;
import java.time.LocalTime;
import java.util.Locale;
public class FragmentHeizung extends Fragment {
private Button btn_hzZeit1, btn_hzZeit2, btn_hzZeit3, btn_hzZeit4, btn_hzZeit5, btn_hzZeit6, btn_hzVL1, btn_hzVL2, btn_hzVL3;
private CheckBox check_hzZeit1, check_hzZeit2, check_hzZeit3;
SwitchCompat switch_silentModeHz1, switch_silentModeHz2, switch_silentModeHz3;
public static String hzZeit1Mqtt = "00:00", hzZeit2Mqtt = "00:00", hzZeit3Mqtt = "00:00", hzZeit4Mqtt = "00:00", hzZeit5Mqtt = "00:00", hzZeit6Mqtt = "00:00";
public static boolean isCheckedHZ1 = false, isCheckedHZ2 = false, isCheckedHZ3 = false;
public static boolean switchHZ1 = false, switchHZ2 = false, switchHZ3 = false;
public static int tempHz1 = 48, tempHz2 = 45, tempHz3 = 50;
View view;
public FragmentHeizung() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// Inflate the layout for this fragment
view = inflater.inflate(R.layout.fragment_heizung, container, false);
requireActivity().setTitle("Haussteuerung - Heizung");
// handleSwitch();
// handleButtons();
// handleCheckBoxes();
// sendValues();
return view;
}
public void sendValues() {
Button btn_HzSend = view.findViewById(R.id.btn_HzSend);
btn_HzSend.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String msgHzZeit1 = "{" +
"\"DeviceID\":\"" + MainActivity.ID + "\"," +
"\"CheckHZ1\":" + "\"" + check_hzZeit1.isChecked() + "\"," +
"\"SilentModeHZ1\":" + "\"" + switch_silentModeHz1.isChecked() + "\"," +
"\"ZeitHZ1\": " + "\"" + btn_hzZeit1.getText().toString() + "\"," +
"\"ZeitHZ2\": " + "\"" + btn_hzZeit2.getText().toString() + "\"," +
"\"TempHZ1\":" + btn_hzVL1.getText().toString() + "," +
"\"CheckHZ2\":" + "\"" + check_hzZeit2.isChecked() + "\"," +
"\"SilentModeHZ2\":" + "\"" + switch_silentModeHz2.isChecked() + "\"," +
"\"ZeitHZ3\": " + "\"" + btn_hzZeit3.getText().toString() + "\"," +
"\"ZeitHZ4\": " + "\"" + btn_hzZeit4.getText().toString() + "\"," +
"\"TempHZ2\":" + btn_hzVL2.getText().toString() + "," +
"\"CheckHZ3\":" + "\"" + check_hzZeit3.isChecked() + "\"," +
"\"SilentModeHZ3\":" + "\"" + switch_silentModeHz3.isChecked() + "\"," +
"\"ZeitHZ5\": " + "\"" + btn_hzZeit5.getText().toString() + "\"," +
"\"ZeitHZ6\": " + "\"" + btn_hzZeit6.getText().toString() + "\"," +
"\"TempHZ3\": " + btn_hzVL3.getText() +
"}";
MqttClient.publish("stat/Haussteuerung/LWP/Heizung", msgHzZeit1, 2, true);
MqttClient.publish("cmnd/Haussteuerung/LWP/Heizung", "{\"DeviceID\":\"" + MainActivity.ID + "\"}", 2, false);
requireActivity().onBackPressed();
}
});
}
public void handleButtons() {
btn_hzZeit1 = view.findViewById(R.id.btn_hzZeit1);
btn_hzZeit1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
timePickerDialog(btn_hzZeit1);
}
});
btn_hzZeit1.setText(hzZeit1Mqtt.substring(0,5));
btn_hzZeit2 = view.findViewById(R.id.btn_hzZeit2);
btn_hzZeit2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
timePickerDialog(btn_hzZeit2);
}
});
btn_hzZeit2.setText(hzZeit2Mqtt.substring(0,5));
btn_hzZeit3 = view.findViewById(R.id.btn_hzZeit3);
btn_hzZeit3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
timePickerDialog(btn_hzZeit3);
}
});
btn_hzZeit3.setText(hzZeit3Mqtt.substring(0,5));
btn_hzZeit4 = view.findViewById(R.id.btn_hzZeit4);
btn_hzZeit4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
timePickerDialog(btn_hzZeit4);
}
});
btn_hzZeit4.setText(hzZeit4Mqtt.substring(0,5));
btn_hzZeit5 = view.findViewById(R.id.btn_hzZeit5);
btn_hzZeit5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
timePickerDialog(btn_hzZeit5);
}
});
btn_hzZeit5.setText(hzZeit5Mqtt.substring(0,5));
btn_hzZeit6 = view.findViewById(R.id.btn_hzZeit6);
btn_hzZeit6.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
timePickerDialog(btn_hzZeit6);
}
});
btn_hzZeit6.setText(hzZeit6Mqtt.substring(0,5));
btn_hzVL1 = view.findViewById(R.id.btn_hzVL1);
btn_hzVL2 = view.findViewById(R.id.btn_hzVL2);
btn_hzVL3 = view.findViewById(R.id.btn_hzVL3);
btn_hzVL1.setText(String.valueOf(tempHz1));
btn_hzVL2.setText(String.valueOf(tempHz2));
btn_hzVL3.setText(String.valueOf(tempHz3));
btn_hzVL1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showNumberPickerDialog(btn_hzVL1);
}
});
btn_hzVL2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showNumberPickerDialog(btn_hzVL2);
}
});
btn_hzVL3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showNumberPickerDialog(btn_hzVL3);
}
});
}
public void handleCheckBoxes() {
check_hzZeit1 = view.findViewById(R.id.check_hzZeit1);
check_hzZeit2 = view.findViewById(R.id.check_hzZeit2);
check_hzZeit3 = view.findViewById(R.id.check_hzZeit3);
check_hzZeit1.setChecked(isCheckedHZ1);
check_hzZeit2.setChecked(isCheckedHZ2);
check_hzZeit3.setChecked(isCheckedHZ3);
// Set visibilty of buttons
if (check_hzZeit1.isChecked()) {
switch_silentModeHz1.setEnabled(true);
btn_hzZeit1.setEnabled(true);
btn_hzZeit2.setEnabled(true);
btn_hzVL1.setEnabled(true);
} else {
switch_silentModeHz1.setEnabled(false);
btn_hzZeit1.setEnabled(false);
btn_hzZeit2.setEnabled(false);
btn_hzVL1.setEnabled(false);
}
check_hzZeit1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (check_hzZeit1.isChecked()) {
switch_silentModeHz1.setEnabled(true);
btn_hzZeit1.setEnabled(true);
btn_hzZeit2.setEnabled(true);
btn_hzVL1.setEnabled(true);
} else {
switch_silentModeHz1.setEnabled(false);
btn_hzZeit1.setEnabled(false);
btn_hzZeit2.setEnabled(false);
btn_hzVL1.setEnabled(false);
}
}
});
if (check_hzZeit2.isChecked()) {
switch_silentModeHz2.setEnabled(true);
btn_hzZeit3.setEnabled(true);
btn_hzZeit4.setEnabled(true);
btn_hzVL2.setEnabled(true);
} else {
switch_silentModeHz2.setEnabled(false);
btn_hzZeit3.setEnabled(false);
btn_hzZeit4.setEnabled(false);
btn_hzVL2.setEnabled(false);
}
check_hzZeit2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (check_hzZeit2.isChecked()) {
switch_silentModeHz2.setEnabled(true);
btn_hzZeit3.setEnabled(true);
btn_hzZeit4.setEnabled(true);
btn_hzVL2.setEnabled(true);
} else {
switch_silentModeHz2.setEnabled(false);
btn_hzZeit3.setEnabled(false);
btn_hzZeit4.setEnabled(false);
btn_hzVL2.setEnabled(false);
}
}
});
if (check_hzZeit3.isChecked()) {
switch_silentModeHz3.setEnabled(true);
btn_hzZeit5.setEnabled(true);
btn_hzZeit6.setEnabled(true);
btn_hzVL3.setEnabled(true);
} else {
switch_silentModeHz3.setEnabled(false);
btn_hzZeit5.setEnabled(false);
btn_hzZeit6.setEnabled(false);
btn_hzVL3.setEnabled(false);
}
check_hzZeit3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (check_hzZeit3.isChecked()) {
switch_silentModeHz3.setEnabled(true);
btn_hzZeit5.setEnabled(true);
btn_hzZeit6.setEnabled(true);
btn_hzVL3.setEnabled(true);
} else {
switch_silentModeHz3.setEnabled(false);
btn_hzZeit5.setEnabled(false);
btn_hzZeit6.setEnabled(false);
btn_hzVL3.setEnabled(false);
}
}
});
}
public void handleSwitch() {
switch_silentModeHz1 = view.findViewById(R.id.switch_silentModeHz1);
switch_silentModeHz2 = view.findViewById(R.id.switch_silentModeHz2);
switch_silentModeHz3 = view.findViewById(R.id.switch_silentModeHz3);
switch_silentModeHz1.setChecked(switchHZ1);
switch_silentModeHz2.setChecked(switchHZ2);
switch_silentModeHz3.setChecked(switchHZ3);
}
private void showNumberPickerDialog(Button button) {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
final View view = this.getLayoutInflater().inflate(R.layout.layout_numberpicker, null);
builder.setView(view);
//builder.setTitle();
final NumberPicker picker = view.findViewById(R.id.picker);
String[] values = {"30","31","32","33","34","35","36","37","38","39","40","41","42","43",
"44","45","46","47","48","49","50"};
int ml = values.length;
picker.setWrapSelectorWheel(false);
picker.setMinValue(0);
picker.setMaxValue(ml - 1);
for(int y=0; y<values.length; y++) {
// Log.d("NumberPicker", values[y]);
if (values[y].equals(button.getText().toString())) {
picker.setValue(y);
}
}
picker.setDisplayedValues(values);
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
// Log.d("NumberPicker", String.valueOf(picker.getValue()));
// Log.d("NumberPicker", values[picker.getValue()]);
button.setText(values[picker.getValue()]);
}
})
.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
builder.create().cancel();
}
});
builder.create().show();
}
public void timePickerDialog(Button button) {
LocalTime localTime = LocalTime.parse(button.getText());
int hour = localTime.getHour();
int minute = localTime.getMinute();
TimePickerDialog.OnTimeSetListener onTimeSetListener = new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker timePicker, int selectedHour, int selectedMinute) {
button.setText(String.format(Locale.getDefault(), "%02d:%02d", selectedHour, selectedMinute));
}
};
TimePickerDialog timePickerDialog = new TimePickerDialog(getContext(), onTimeSetListener, hour, minute, true);
timePickerDialog.show();
}
@Override
public void onResume() {
super.onResume();
handleSwitch();
handleButtons();
handleCheckBoxes();
sendValues();
}
@Override
public void onStop() {
super.onStop();
}
}

View File

@@ -0,0 +1,342 @@
package com.haussteuerung;
import android.app.TimePickerDialog;
import android.os.Bundle;
import androidx.appcompat.widget.SwitchCompat;
import androidx.fragment.app.Fragment;
import android.os.Handler;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.TimePicker;
import java.time.LocalTime;
import java.util.Locale;
import java.util.Timer;
import java.util.TimerTask;
public class FragmentWW extends Fragment {
Button btn_wwZeit1, btn_wwZeit2, btn_wwZeit3, btn_wwZeit4, btn_wwZeit5, btn_wwZeit6;
CheckBox check_wwZeit1, check_wwZeit2, check_wwZeit3;
SwitchCompat switch_silentModeWw1, switch_silentModeWw2, switch_silentModeWw3;
public static String wwZeit1Mqtt = "00:00", wwZeit2Mqtt = "00:00", wwZeit3Mqtt = "00:00", wwZeit4Mqtt = "00:00", wwZeit5Mqtt = "00:00", wwZeit6Mqtt = "00:00";
public static boolean isCheckedWW1 = false, isCheckedWW2 = false, isCheckedWW3 = false;
public static boolean switchWW1 = false, switchWW2 = false, switchWW3 = false;
public static int tempWw1 = 39, tempWw2 = 44;
public static String tempBoilerOben = "40", tempBoilerUnten = "35";
public SeekBar seekBar_WwMin, seekBar_WwMax;
public TextView tv_WwMinVal, tv_WwMaxVal, tv_boilerObenVal, tv_boilerUntenVal;
View view;
final Handler myHandler = new Handler();
final Timer myTimer = new Timer();
TimerTask myTask;
public FragmentWW() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// Inflate the layout for this fragment
view = inflater.inflate(R.layout.fragment_ww, container, false);
requireActivity().setTitle("Haussteuerung - Warmwasser");
tv_boilerObenVal = view.findViewById(R.id.tv_boilerObenVal);
tv_boilerUntenVal = view.findViewById(R.id.tv_boilerUntenVal);
// handleSwitch();
// handleTextViews();
// handleButtons();
// handleCheckBoxes();
// handleSeekBars();
// sendValues();
return view;
}
// Runnable method
final Runnable myRunnable = new Runnable() {
public void run() {
Log.d("FragmentWW", "Timer 1s");
String oben = tempBoilerOben + "°";
tv_boilerObenVal.setText(oben);
String unten = tempBoilerUnten + "°";
tv_boilerUntenVal.setText(unten);
}
};
public void sendValues() {
Button btn_WwSend = view.findViewById(R.id.btn_HzSend);
btn_WwSend.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String msgWwZeit1 = "{" +
"\"DeviceID\":\"" + MainActivity.ID + "\"," +
"\"CheckWW1\":" + "\"" + check_wwZeit1.isChecked() + "\"," +
"\"SilentModeWW1\": " + "\"" + switch_silentModeWw1.isChecked() + "\"," +
"\"ZeitWW1\": " + "\"" + btn_wwZeit1.getText().toString() + "\"," +
"\"ZeitWW2\": " + "\"" + btn_wwZeit2.getText().toString() + "\"," +
"\"CheckWW2\":" + "\"" + check_wwZeit2.isChecked() + "\"," +
"\"SilentModeWW2\": " + "\"" + switch_silentModeWw2.isChecked() + "\"," +
"\"ZeitWW3\": " + "\"" + btn_wwZeit3.getText().toString() + "\"," +
"\"ZeitWW4\": " + "\"" + btn_wwZeit4.getText().toString() + "\"," +
"\"CheckWW3\":" + "\"" + check_wwZeit3.isChecked() + "\"," +
"\"SilentModeWW3\": " + "\"" + switch_silentModeWw3.isChecked() + "\"," +
"\"ZeitWW5\": " + "\"" + btn_wwZeit5.getText().toString() + "\"," +
"\"ZeitWW6\": " + "\"" + btn_wwZeit6.getText().toString() + "\"," +
"\"TempWW1\": " + tv_WwMinVal.getText() + "," +
"\"TempWW2\": " + tv_WwMaxVal.getText() +
"}";
MqttClient.publish("stat/Haussteuerung/LWP/Warmwasser", msgWwZeit1, 2, true);
MqttClient.publish("cmnd/Haussteuerung/LWP/Warmwasser", "{\"DeviceID\":\"" + MainActivity.ID + "\"}", 2, false);
requireActivity().onBackPressed();
}
});
}
public void handleSwitch() {
switch_silentModeWw1 = view.findViewById(R.id.switch_silentModeWw1);
switch_silentModeWw2 = view.findViewById(R.id.switch_silentModeWw2);
switch_silentModeWw3 = view.findViewById(R.id.switch_silentModeWw3);
switch_silentModeWw1.setChecked(switchWW1);
switch_silentModeWw2.setChecked(switchWW2);
switch_silentModeWw3.setChecked(switchWW3);
}
public void handleButtons() {
btn_wwZeit1 = view.findViewById(R.id.btn_wwZeit1);
btn_wwZeit1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
timePickerDialog(btn_wwZeit1);
}
});
btn_wwZeit1.setText(wwZeit1Mqtt.substring(0, 5));
btn_wwZeit2 = view.findViewById(R.id.btn_wwZeit2);
btn_wwZeit2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
timePickerDialog(btn_wwZeit2);
}
});
btn_wwZeit2.setText(wwZeit2Mqtt.substring(0, 5));
btn_wwZeit3 = view.findViewById(R.id.btn_wwZeit3);
btn_wwZeit3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
timePickerDialog(btn_wwZeit3);
}
});
btn_wwZeit3.setText(wwZeit3Mqtt.substring(0, 5));
btn_wwZeit4 = view.findViewById(R.id.btn_wwZeit4);
btn_wwZeit4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
timePickerDialog(btn_wwZeit4);
}
});
btn_wwZeit4.setText(wwZeit4Mqtt.substring(0, 5));
btn_wwZeit5 = view.findViewById(R.id.btn_wwZeit5);
btn_wwZeit5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
timePickerDialog(btn_wwZeit5);
}
});
btn_wwZeit5.setText(wwZeit5Mqtt.substring(0, 5));
btn_wwZeit6 = view.findViewById(R.id.btn_wwZeit6);
btn_wwZeit6.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
timePickerDialog(btn_wwZeit6);
}
});
btn_wwZeit6.setText(wwZeit6Mqtt.substring(0, 5));
}
public void handleCheckBoxes() {
check_wwZeit1 = view.findViewById(R.id.check_wwZeit1);
check_wwZeit2 = view.findViewById(R.id.check_wwZeit2);
check_wwZeit3 = view.findViewById(R.id.check_wwZeit3);
check_wwZeit1.setChecked(isCheckedWW1);
check_wwZeit2.setChecked(isCheckedWW2);
check_wwZeit3.setChecked(isCheckedWW3);
// Set visibilty of buttons
if (check_wwZeit1.isChecked()) {
switch_silentModeWw1.setEnabled(true);
btn_wwZeit1.setEnabled(true);
btn_wwZeit2.setEnabled(true);
} else {
switch_silentModeWw1.setEnabled(false);
btn_wwZeit1.setEnabled(false);
btn_wwZeit2.setEnabled(false);
}
check_wwZeit1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (check_wwZeit1.isChecked()) {
switch_silentModeWw1.setEnabled(true);
btn_wwZeit1.setEnabled(true);
btn_wwZeit2.setEnabled(true);
} else {
switch_silentModeWw1.setEnabled(false);
btn_wwZeit1.setEnabled(false);
btn_wwZeit2.setEnabled(false);
}
}
});
if (check_wwZeit2.isChecked()) {
switch_silentModeWw2.setEnabled(true);
btn_wwZeit3.setEnabled(true);
btn_wwZeit4.setEnabled(true);
} else {
switch_silentModeWw2.setEnabled(false);
btn_wwZeit3.setEnabled(false);
btn_wwZeit4.setEnabled(false);
}
check_wwZeit2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (check_wwZeit2.isChecked()) {
switch_silentModeWw2.setEnabled(true);
btn_wwZeit3.setEnabled(true);
btn_wwZeit4.setEnabled(true);
} else {
switch_silentModeWw2.setEnabled(false);
btn_wwZeit3.setEnabled(false);
btn_wwZeit4.setEnabled(false);
}
}
});
if (check_wwZeit3.isChecked()) {
switch_silentModeWw3.setEnabled(true);
btn_wwZeit5.setEnabled(true);
btn_wwZeit6.setEnabled(true);
} else {
switch_silentModeWw3.setEnabled(false);
btn_wwZeit5.setEnabled(false);
btn_wwZeit6.setEnabled(false);
}
check_wwZeit3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (check_wwZeit3.isChecked()) {
switch_silentModeWw3.setEnabled(true);
btn_wwZeit5.setEnabled(true);
btn_wwZeit6.setEnabled(true);
} else {
switch_silentModeWw3.setEnabled(false);
btn_wwZeit5.setEnabled(false);
btn_wwZeit6.setEnabled(false);
}
}
});
}
public void handleTextViews() {
tv_WwMinVal = view.findViewById(R.id.tv_wwMinVal);
tv_WwMaxVal = view.findViewById(R.id.tv_wwMaxVal);
tv_WwMinVal.setText(String.valueOf(tempWw1));
tv_WwMaxVal.setText(String.valueOf(tempWw2));
}
public void handleSeekBars() {
seekBar_WwMin = view.findViewById(R.id.seekBar_wwMin);
seekBar_WwMin.setProgress(tempWw1);
seekBar_WwMin.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
tv_WwMinVal.setText(String.valueOf(progress));
seekBar_WwMax.setMin(progress + 2);
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
seekBar_WwMax = view.findViewById(R.id.seekBar_wwMax);
seekBar_WwMax.setProgress(tempWw2);
seekBar_WwMax.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
tv_WwMaxVal.setText(String.valueOf(progress));
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
}
public void timePickerDialog(Button button) {
LocalTime localTime = LocalTime.parse(button.getText());
int hour = localTime.getHour();
int minute = localTime.getMinute();
int hourWwZeit = 0, minuteWwZeit = 0;
TimePickerDialog.OnTimeSetListener onTimeSetListener = new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker timePicker, int selectedHour, int selectedMinute) {
button.setText(String.format(Locale.getDefault(), "%02d:%02d", selectedHour, selectedMinute));
}
};
TimePickerDialog timePickerDialog = new TimePickerDialog(getContext(), onTimeSetListener, hourWwZeit, minuteWwZeit, true);
timePickerDialog.updateTime(hour, minute);
timePickerDialog.show();
}
@Override
public void onResume() {
super.onResume();
handleSwitch();
handleTextViews();
handleButtons();
handleCheckBoxes();
handleSeekBars();
sendValues();
myTask = new TimerTask() {
public void run() {
myHandler.post(myRunnable); // updateUI method
}
};
myTimer.schedule(myTask, 0, 1000); // TimerTask, delay, period
}
@Override
public void onStop() {
super.onStop();
myTask.cancel();
Log.d("State", "on Stop");
}
}

View File

@@ -0,0 +1,18 @@
package com.haussteuerung;
import com.google.gson.annotations.SerializedName;
public class Licht {
@SerializedName("DeviceID")
private final String deviceId;
@SerializedName("Name")
private final String name;
@SerializedName("Device")
private final String device;
public Licht(String deviceId, String name, String device) {
this.deviceId = deviceId;
this.name = name;
this.device = device;
}
}

View File

@@ -0,0 +1,504 @@
package com.haussteuerung;
import static android.os.Build.VERSION.SDK_INT;
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Environment;
import android.provider.Settings;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import com.google.firebase.messaging.FirebaseMessaging;
import com.google.gson.Gson;
import org.eclipse.paho.client.mqttv3.MqttException;
import java.io.File;
import java.util.Timer;
import java.util.TimerTask;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
private TextView tv_WM1;
private TextView tv_WM2;
private TextView tv_mqtt;
private Button buttonAlarm;
public static String ID = "";
public static boolean pausedMainActivity = true;
public static boolean alarmStatus = false, wm1Status = false, wm2Status = false;
private Context mContext;
Timer myTimer = new Timer();
Gson gson = new Gson();
String msg;
@SuppressLint("HardwareIds")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mContext = this;
pausedMainActivity = false;
Log.d("MainActivityPause", "onCreate true");
// Ändern der Statusbar-Farbe
androidx.appcompat.app.ActionBar actionBar = getSupportActionBar();
assert actionBar != null;
actionBar.setBackgroundDrawable(AppCompatResources.getDrawable(getApplicationContext(), R.drawable.gradient_titlebar));
setContentView(R.layout.activity_main);
ID = Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID);
Log.d("ID", ID);
int permissionState = ContextCompat.checkSelfPermission(this, android.Manifest.permission.POST_NOTIFICATIONS);
// If the permission is not granted, request it.
if (permissionState == PackageManager.PERMISSION_DENIED) {
ActivityCompat.requestPermissions(this, new String[]{android.Manifest.permission.POST_NOTIFICATIONS}, 1);
}
// Abfrage am Gerät, ob Speicher verwendet werden darf
if (SDK_INT >= Build.VERSION_CODES.R) {
Log.d("Permission", "" + SDK_INT);
if (!Environment.isExternalStorageManager()) {
ActivityCompat.requestPermissions(this,
new String[]{android.Manifest.permission.READ_EXTERNAL_STORAGE,
android.Manifest.permission.MANAGE_EXTERNAL_STORAGE}, 1);//permission request code is just an int
File file = new File(Environment.getExternalStorageDirectory().getPath() + "/Pictures/Haussteuerung/");
if (!file.exists()) {
file.mkdir();
}
}
} else {
if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED || ActivityCompat.checkSelfPermission(this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{android.Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1);
}
}
FirebaseMessaging.getInstance().subscribeToTopic("general");
FirebaseMessaging.getInstance().subscribeToTopic(ID);
// Connecten des Mqtt-Clients
try {
MqttClient.connect();
} catch (Exception e) {
Log.d("MQTT", "Verbindung fehlgeschlagen");
}
// Log.d("MQTT", String.valueOf(MqttClient.connSuccess));
// if (!MqttClient.connSuccess) {
// MqttClient.connect();
// }
// Instanzieren der Buttons und TextViews
ImageView imageViewHaus = findViewById(R.id.imageViewHaus);
Button buttonHaus = findViewById(R.id.buttonHaus);
Button buttonGlocke = findViewById(R.id.buttonGlocke);
Button buttonLicht = findViewById(R.id.buttonLicht);
Button buttonLog = findViewById(R.id.buttonLog);
Button buttonLWP = findViewById(R.id.buttonLWP);
Button buttonDoris = findViewById(R.id.buttonDoris);
Button buttonDorisLicht = findViewById(R.id.buttonDorisLicht);
buttonAlarm = findViewById(R.id.buttonAlarm);
tv_WM1 = findViewById(R.id.textview_WM1);
tv_WM2 = findViewById(R.id.textview_WM2);
tv_mqtt = findViewById(R.id.textView_Mqtt);
buttonHaus.setOnClickListener(this);
buttonGlocke.setOnClickListener(this);
buttonLicht.setOnClickListener(this);
buttonLog.setOnClickListener(this);
buttonLWP.setOnClickListener(this);
buttonDoris.setOnClickListener(this);
buttonDorisLicht.setOnClickListener(this);
imageViewHaus.setOnClickListener(this);
imageViewHaus.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
alertDialogHaus();
}
});
imageViewHaus.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
alertDialogVersion();
return true;
}
});
buttonAlarm.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Log.d("Alarm", String.valueOf(alarmStatus));
if (alarmStatus) {
// Alarm ein, also ausschalten
MqttClient.publish("cmnd/Haussteuerung/Alarm", "{\"DeviceID\":\"" + ID + "\",\"Name\":\"Alarm\",\"Zustand\":\"true\"}");
} else {
// Alarm aus, also einschalten
alertDialogAlarm();
}
}
});
Intent i = getIntent();
if (i.getExtras() != null) {
if (i.getExtras() != null && i.hasExtra("Time")) {
Log.d("GlockeZeit", i.getStringExtra("Time"));
}
if ((i.getExtras() != null) && (i.hasExtra("Time"))) {
Intent iGlocke = new Intent(MainActivity.this, activityGlocke.class);
iGlocke.putExtra("TimeFB", i.getStringExtra("Time"));
Log.d("GlockeZeit", i.getStringExtra("Time"));
startActivity(iGlocke);
}
if ((i.getExtras() != null) && (i.hasExtra("Sky"))) {
Intent iSky = new Intent(MainActivity.this, activitySky.class);
Log.d("Sky", i.getStringExtra("Sky"));
startActivity(iSky);
}
if ((i.getExtras() != null) && (i.hasExtra("Other"))) {
Log.d("Other", i.getStringExtra("Other"));
alertDialogNotification(i.getStringExtra("Other"));
}
}
Log.d("MainActivityPause", "false");
}
private void TimerMethod() {
this.runOnUiThread(Timer_Tick);
}
private final Runnable Timer_Tick = new Runnable() {
public void run() {
if (MqttClient.client.isConnected()) {
tv_mqtt.setTextColor(Color.parseColor("#64DD17"));
} else {
tv_mqtt.setTextColor(Color.RED);
}
if (alarmStatus) {
buttonAlarm.setText(R.string.alarm_ein);
buttonAlarm.setBackgroundResource(R.drawable.alarm_true);
} else {
buttonAlarm.setText(R.string.alarm_aus);
buttonAlarm.setBackgroundResource(R.drawable.alarm_false);
}
if (wm1Status) {
tv_WM1.setText(R.string.wm1_laeuft);
} else {
tv_WM1.setText(R.string.wm1_aus);
}
if (wm2Status) {
tv_WM2.setText(R.string.wm2_laeuft);
} else {
tv_WM2.setText(R.string.wm2_aus);
}
Log.d("TimerMainActivity", "Running");
}
};
@SuppressLint("NonConstantResourceId")
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.buttonLWP:
Intent iLWP = new Intent(MainActivity.this, activityLWP.class);
startActivity(iLWP);
break;
case R.id.buttonDoris:
Intent iDoris = new Intent(MainActivity.this, activityDoris.class);
startActivity(iDoris);
break;
case R.id.buttonDorisLicht:
Intent iDorisLicht = new Intent(MainActivity.this, activityDorisLicht.class);
startActivity(iDorisLicht);
break;
case R.id.buttonHaus:
Intent intent = new Intent(MainActivity.this, activityHaus.class);
startActivity(intent);
break;
case R.id.buttonGlocke:
Intent iGlocke = new Intent(MainActivity.this, activityGlocke.class);
startActivity(iGlocke);
break;
case R.id.buttonLicht:
Intent iLicht = new Intent(MainActivity.this, activityLicht.class);
startActivity(iLicht);
break;
case R.id.buttonLog:
Intent iLog = new Intent(MainActivity.this, activityLog.class);
startActivity(iLog);
break;
}
}
// Methode zum Öffnen des AlertDialogs beim Klick aufs Haus-Foto
public void alertDialogHaus() {
// Titlebar ändern
TextView textView = new TextView(getApplicationContext());
textView.setText(R.string.tor_steuerung);
textView.setPadding(20, 30, 20, 30);
textView.setTextSize(20F);
textView.setBackgroundResource(R.drawable.gradient_titlebar);
textView.setTextColor(Color.WHITE);
// AlertDialog instanzieren
AlertDialog.Builder alertDialog = new AlertDialog.Builder(MainActivity.this);
final View customLayout = getLayoutInflater().inflate(R.layout.layout_haus, null);
alertDialog.setView(customLayout);
alertDialog.setCustomTitle(textView);
AlertDialog alert = alertDialog.create();
alert.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
Button buttonGarage, buttonSchiebetor;
buttonGarage = customLayout.findViewById(R.id.buttonAlarmJa);
buttonSchiebetor = customLayout.findViewById(R.id.buttonAlarmNein);
buttonGarage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
msg = gson.toJson(new Licht(MainActivity.ID, "Garagentor", "Lamp12"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
alert.cancel();
}
});
buttonSchiebetor.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
msg = gson.toJson(new Licht(MainActivity.ID, "Schiebetor", "Lamp31"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);Toast.makeText(mContext, "Schiebetor außer Betrieb", Toast.LENGTH_LONG).show();
alert.cancel();
}
});
alert.show();
}
public void alertDialogAlarm() {
// Titlebar ändern
TextView textView = new TextView(getApplicationContext());
textView.setText(R.string.alarm_steuerung);
textView.setPadding(20, 30, 20, 30);
textView.setTextSize(20F);
textView.setBackgroundResource(R.drawable.gradient_titlebar);
textView.setTextColor(Color.WHITE);
// AlertDialog instanzieren
AlertDialog.Builder alertDialog = new AlertDialog.Builder(MainActivity.this);
final View customLayout = getLayoutInflater().inflate(R.layout.layout_alarm, null);
alertDialog.setView(customLayout);
alertDialog.setCustomTitle(textView);
AlertDialog alert = alertDialog.create();
alert.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
Button buttonAlarmJa, buttonAlarmNein;
buttonAlarmJa = customLayout.findViewById(R.id.buttonAlarmJa);
buttonAlarmNein = customLayout.findViewById(R.id.buttonAlarmNein);
buttonAlarmJa.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (MqttClient.tv_Zustand1.equals("zu") &&
MqttClient.tv_Zustand2.equals("zu") &&
MqttClient.tv_Zustand3.equals("zu") &&
MqttClient.tv_Zustand4.equals("zu") &&
MqttClient.tv_Zustand5.equals("zu") &&
MqttClient.tv_Zustand6.equals("zu") &&
MqttClient.tv_Zustand7.equals("zu") &&
MqttClient.tv_Zustand9.equals("zu") &&
MqttClient.tv_Zustand10.equals("zu") &&
MqttClient.tv_Zustand11.equals("zu") &&
MqttClient.tv_Zustand12.equals("zu") &&
MqttClient.tv_Zustand13.equals("zu") &&
MqttClient.tv_Zustand14.equals("zu") //&&
//MqttClient.tv_Zustand15.equals("zu") &&
//MqttClient.tv_Zustand16.equals("zu") &&
//MqttClient.tv_Zustand17.equals("zu") &&
//MqttClient.tv_Zustand18.equals("zu")
) {
MqttClient.publish("cmnd/Haussteuerung/Alarm", "{\"DeviceID\":\"" + ID + "\",\"Name\":\"Alarm\",\"Zustand\":\"false\"}");
alert.cancel();
} else {
Toast.makeText(mContext, "Bitte offene Fenster/Türen schließen!", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(MainActivity.this, activityHaus.class);
startActivity(intent);
}
}
});
buttonAlarmNein.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
alert.cancel();
}
});
alert.show();
}
public void alertDialogVersion() {
// Titlebar ändern
TextView textView = new TextView(getApplicationContext());
textView.setText(R.string.version_ad);
textView.setPadding(20, 30, 20, 30);
textView.setTextSize(20F);
textView.setBackgroundResource(R.drawable.gradient_titlebar);
textView.setTextColor(Color.WHITE);
// AlertDialog instanzieren
AlertDialog.Builder alertDialog = new AlertDialog.Builder(MainActivity.this);
final View customLayout = getLayoutInflater().inflate(R.layout.layout_version, null);
alertDialog.setView(customLayout);
alertDialog.setCustomTitle(textView);
AlertDialog alert = alertDialog.create();
alert.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
alert.show();
}
public void alertDialogNotification(String content) {
// Titlebar ändern
TextView textView = new TextView(getApplicationContext());
String title = "Benachrichtigung";
textView.setText(title);
textView.setPadding(20, 30, 20, 30);
textView.setTextSize(20F);
textView.setBackgroundResource(R.drawable.gradient_titlebar);
textView.setTextColor(Color.WHITE);
// AlertDialog instanzieren
AlertDialog.Builder alertDialog = new AlertDialog.Builder(MainActivity.this);
final View customLayout = getLayoutInflater().inflate(R.layout.layout_adnotification, null);
alertDialog.setView(customLayout);
alertDialog.setCustomTitle(textView);
AlertDialog alert = alertDialog.create();
alert.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
TextView textView_adConent, textView_adTimer;
textView_adConent = customLayout.findViewById(R.id.tv_adcontent);
textView_adTimer = customLayout.findViewById(R.id.tv_adtimer);
ProgressBar pg_adProgressBar;
pg_adProgressBar = customLayout.findViewById(R.id.progressBar);
textView_adConent.setText(content);
new CountDownTimer(10000, 1000) {
public void onTick(long millisUntilFinished) {
long timeRemain = ((millisUntilFinished / 1000));
pg_adProgressBar.setProgress((int) timeRemain);
textView_adTimer.setText(String.valueOf(timeRemain));
}
public void onFinish() {
alert.cancel();
}
}.start();
alert.show();
}
@Override
protected void onPause() {
super.onPause();
pausedMainActivity = true;
Log.d("MainActivityPause", "onPause true");
// Log.d("1MQTT onPause", String.valueOf(MqttClient.connSuccess));
myTimer.cancel();
Log.d("TimerMainActivity", "Canceled");
}
@Override
protected void onStop() {
super.onStop();
pausedMainActivity = true;
Log.d("MainActivityPause", "onStop true");
// Log.d("1MQTT onStop", String.valueOf(MqttClient.connSuccess));
// myTimer.cancel();
// Log.d("TimerMainActivity", "Canceled");
}
@Override
protected void onStart() {
super.onStart();
Log.d("MainActivityPause", "onStart true");
}
@Override
protected void onRestart() {
super.onRestart();
Log.d("MainActivityPause", "onRestart true");
}
@Override
protected void onResume() {
super.onResume();
Log.d("MainActivityPause", "onResume true");
Log.d("1MQTT onResume", String.valueOf(MqttClient.client.isConnected()));
pausedMainActivity = false;
buttonAlarm.setBackgroundResource(R.drawable.gradient_pressed);
myTimer = new Timer();
myTimer.schedule(new TimerTask() {
@Override
public void run() {
TimerMethod();
}
}, 0, 1000);
Log.d("TimerMainActivity", "Started");
if (!MqttClient.client.isConnected()) {
Log.d("1MQTT onResume", "Client connected: " + MqttClient.client.isConnected());
try {
MqttClient.client.reconnect();
Log.d("1MQTT onResume", "Try to reconnect client");
} catch (MqttException e) {
e.printStackTrace();
}
}
}
@Override
protected void onDestroy() {
super.onDestroy();
pausedMainActivity = true;
// myTimer.cancel();
Log.d("MainActivityPause", "onDestroy true");
MqttClient.disconnect();
// Log.d("1MQTT onDestroy", String.valueOf(MqttClient.connSuccess));
finishAffinity();
}
}

View File

@@ -0,0 +1,506 @@
package com.haussteuerung;
import static java.nio.charset.StandardCharsets.UTF_8;
import android.util.Log;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.eclipse.paho.android.service.MqttAndroidClient;
import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken;
import org.eclipse.paho.client.mqttv3.MqttCallback;
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
import java.util.ArrayList;
import java.util.Arrays;
import javax.net.ssl.SSLSocketFactory;
public class MqttClient {
static org.eclipse.paho.client.mqttv3.MqttClient client = null;
static boolean connSuccess = false;
static String logContent = "";
static String tv_Zustand1 = "", tv_Zustand2 = "", tv_Zustand3 = "", tv_Zustand4 = "", tv_Zustand5 = "", tv_Zustand6 = "";
static String tv_Zustand7 = "", tv_Zustand8 = "", tv_Zustand9 = "", tv_Zustand10 = "", tv_Zustand11 = "", tv_Zustand12 = "";
static String tv_Zustand13 = "", tv_Zustand14 = "", tv_Zustand15 = "", tv_Zustand16 = "", tv_Zustand17 = "", tv_Zustand18 = "";
public static void connect() {
try {
client = new org.eclipse.paho.client.mqttv3.MqttClient(
"wss://mqtt.klebl.info:443",
MainActivity.ID, // ClientId
new MemoryPersistence());
client.setCallback(new MqttCallback() {
@Override
public void connectionLost(Throwable cause) {
Log.d("MQTT connloss", "client lost connection " + cause);
Log.d("MQTT connloss", cause.getMessage());
Log.d("MQTT connless", String.valueOf(client.getDebug()));
Log.d("MQTT connloss", String.valueOf(MqttClient.client.isConnected()));
// MainActivity.tv_mqtt.setTextColor(Color.RED);
// if (!MqttClient.client.isConnected()) {
// try {
// client.reconnect();
// client.subscribe("stat/Haussteuerung/#");
// client.subscribe("fhem/temp/#");
// client.subscribe("fhem/Heizung/#");
// } catch (MqttException e) {
// e.printStackTrace();
// }
// }
// Log.d("MQTT connloss2", String.valueOf(MqttClient.client.isConnected()));
// disconnect();
// Log.d("MQTT connloss", "client disconnected after connection lost");
// connect();
}
@Override
public void messageArrived(String topic, MqttMessage message) {
Log.d("MQTTLOG", topic + ": " + message.toString());
if (topic.equals("stat/Haussteuerung/Alarm")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
if (jsonObject.get("Zustand").getAsString().equals("true")) {
// MainActivity.buttonAlarm.setText(R.string.alarm_ein);
// MainActivity.buttonAlarm.setBackgroundResource(R.drawable.alarm_true);
MainActivity.alarmStatus = true;
} else if (jsonObject.get("Zustand").getAsString().equals("false")) {
// MainActivity.buttonAlarm.setText(R.string.alarm_aus);
// MainActivity.buttonAlarm.setBackgroundResource(R.drawable.alarm_false);
MainActivity.alarmStatus = false;
}
}
if (topic.equals("stat/Haussteuerung/Waschmaschine/WM1")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
if (jsonObject.get("Zustand").getAsString().equals("ein")) {
// MainActivity.tv_WM1.setText(R.string.wm1_laeuft);
MainActivity.wm1Status = true;
} else if (jsonObject.get("Zustand").getAsString().equals("aus")) {
// MainActivity.tv_WM1.setText(R.string.wm1_aus);
MainActivity.wm1Status = false;
}
}
if (topic.equals("stat/Haussteuerung/Waschmaschine/WM2")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
if (jsonObject.get("Zustand").getAsString().equals("ein")) {
// MainActivity.tv_WM2.setText(R.string.wm2_laeuft);
MainActivity.wm2Status = true;
} else if (jsonObject.get("Zustand").getAsString().equals("aus")) {
// MainActivity.tv_WM2.setText(R.string.wm2_aus);
MainActivity.wm2Status = false;
}
}
if (topic.equals("stat/Haussteuerung/Log/List_Log")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
logContent = jsonObject.get("Zustand").getAsString().replace(";", "\n");
}
if (topic.equals("stat/Haussteuerung/Sky")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
activitySky.zeitSkyMqtt = jsonObject.get("Datum").getAsString();
activitySky.isChecked = jsonObject.get("CheckboxSky").getAsBoolean();
}
if (topic.equals("stat/Haussteuerung/Waschmaschine/Tom")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
activityLicht.nameTom = jsonObject.get("Name").getAsString();
activityLicht.checkedTom = jsonObject.get("Checkbox").getAsBoolean();
}
if (topic.equals("stat/Haussteuerung/Waschmaschine/Flo")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
activityLicht.nameFlo = jsonObject.get("Name").getAsString();
activityLicht.checkedFlo = jsonObject.get("Checkbox").getAsBoolean();
}
if (topic.equals("stat/Haussteuerung/Waschmaschine/Stefan")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
activityLicht.nameStefan = jsonObject.get("Name").getAsString();
activityLicht.checkedStefan = jsonObject.get("Checkbox").getAsBoolean();
}
if (topic.equals("stat/Haussteuerung/Glocke")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
activityLicht.nameGlocke = jsonObject.get("Name").getAsString();
activityLicht.checkedGlocke = jsonObject.get("Checkbox").getAsBoolean();
}
// WEIHNACHTSBELEUCHTUNG
if (topic.equals("tele/sonoff153/STATE")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
activityChristmas.power = jsonObject.get("POWER").getAsString();
activityChristmas.hsbColorArray = new ArrayList<>(Arrays.asList(jsonObject.get("HSBColor").getAsString().split(",")));
}
// WEIHNACHTSBELEUCHTUNG
handleLWP(topic, message);
fensterZustaende(topic, message);
}
@Override
public void deliveryComplete(IMqttDeliveryToken token) {
Log.d("MQTTLOG", "delivery complete " + token);
}
});
} catch (MqttException e) {
e.printStackTrace();
}
MqttConnectOptions mqttConnectOptions = new MqttConnectOptions();
mqttConnectOptions.setUserName("steve");
mqttConnectOptions.setPassword("Florian1".toCharArray());
mqttConnectOptions.setAutomaticReconnect(true);
mqttConnectOptions.setCleanSession(false);
mqttConnectOptions.setKeepAliveInterval(15);
mqttConnectOptions.setConnectionTimeout(30);
mqttConnectOptions.setSocketFactory(SSLSocketFactory.getDefault()); // using the default socket factory
try {
client.connect(mqttConnectOptions);
// connSuccess = true;
subscribe("stat/Haussteuerung/#");
subscribe("fhem/temp/#");
subscribe("fhem/Heizung/#");
subscribe("tele/sonoff153/#");
subscribe("growatt/#");
Log.d("MQTTLOG", "client connected");
// MainActivity.tv_mqtt.setTextColor(Color.parseColor("#64DD17"));
} catch (MqttException e) {
e.printStackTrace();
// connSuccess = false;
Log.d("MQTTLOG", "connection failed " + e.getMessage());
// MainActivity.tv_mqtt.setTextColor(Color.RED);
}
}
public static void subscribe(String topic) {
try {
// if (!client.isConnected()) {
// client.reconnect();
// }
client.subscribe(topic);
} catch (MqttException e) {
e.printStackTrace();
}
}
public static void publish(String topic, String message) {
try {
// if (!client.isConnected()) {
// client.reconnect();
// }
client.publish(topic, message.getBytes(UTF_8),2, false);
Log.d("MQTTLOG", "Message" + message + "published.");
} catch (MqttException e) {
e.printStackTrace();
}
}
public static void publish(String topic, String message, int qos, boolean retained) {
try {
// if (!client.isConnected()) {
// client.reconnect();
// }
client.publish(topic, message.getBytes(UTF_8), qos, retained);
Log.d("MQTTLOG", "Message" + message + "published.");
} catch (MqttException e) {
e.printStackTrace();
}
}
public static void disconnect() {
try {
client.disconnect();
} catch (MqttException e) {
e.printStackTrace();
}
// MainActivity.tv_mqtt.setTextColor(Color.RED);
}
private static void handleLWP(String topic, MqttMessage message) {
if (topic.equals("stat/Haussteuerung/LWP/Warmwasser")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
FragmentWW.isCheckedWW1 = jsonObject.get("CheckWW1").getAsBoolean();
FragmentWW.isCheckedWW2 = jsonObject.get("CheckWW2").getAsBoolean();
FragmentWW.isCheckedWW3 = jsonObject.get("CheckWW3").getAsBoolean();
FragmentWW.switchWW1 = jsonObject.get("SilentModeWW1").getAsBoolean();
FragmentWW.switchWW2 = jsonObject.get("SilentModeWW2").getAsBoolean();
FragmentWW.switchWW3 = jsonObject.get("SilentModeWW3").getAsBoolean();
FragmentWW.wwZeit1Mqtt = jsonObject.get("ZeitWW1").getAsString();
FragmentWW.wwZeit2Mqtt = jsonObject.get("ZeitWW2").getAsString();
FragmentWW.wwZeit3Mqtt = jsonObject.get("ZeitWW3").getAsString();
FragmentWW.wwZeit4Mqtt = jsonObject.get("ZeitWW4").getAsString();
FragmentWW.wwZeit5Mqtt = jsonObject.get("ZeitWW5").getAsString();
FragmentWW.wwZeit6Mqtt = jsonObject.get("ZeitWW6").getAsString();
FragmentWW.tempWw1 = jsonObject.get("TempWW1").getAsInt();
FragmentWW.tempWw2 = jsonObject.get("TempWW2").getAsInt();
}
if (topic.equals("stat/Haussteuerung/LWP/Heizung")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
FragmentHeizung.isCheckedHZ1 = jsonObject.get("CheckHZ1").getAsBoolean();
FragmentHeizung.isCheckedHZ2 = jsonObject.get("CheckHZ2").getAsBoolean();
FragmentHeizung.isCheckedHZ3 = jsonObject.get("CheckHZ3").getAsBoolean();
FragmentHeizung.hzZeit1Mqtt = jsonObject.get("ZeitHZ1").getAsString();
FragmentHeizung.hzZeit2Mqtt = jsonObject.get("ZeitHZ2").getAsString();
FragmentHeizung.hzZeit3Mqtt = jsonObject.get("ZeitHZ3").getAsString();
FragmentHeizung.hzZeit4Mqtt = jsonObject.get("ZeitHZ4").getAsString();
FragmentHeizung.hzZeit5Mqtt = jsonObject.get("ZeitHZ5").getAsString();
FragmentHeizung.hzZeit6Mqtt = jsonObject.get("ZeitHZ6").getAsString();
FragmentHeizung.switchHZ1 = jsonObject.get("SilentModeHZ1").getAsBoolean();
FragmentHeizung.switchHZ2 = jsonObject.get("SilentModeHZ2").getAsBoolean();
FragmentHeizung.switchHZ3 = jsonObject.get("SilentModeHZ3").getAsBoolean();
FragmentHeizung.tempHz1 = jsonObject.get("TempHZ1").getAsInt();
FragmentHeizung.tempHz2 = jsonObject.get("TempHZ2").getAsInt();
FragmentHeizung.tempHz3 = jsonObject.get("TempHZ3").getAsInt();
}
if (topic.equals("fhem/temp/Temp_Boiler_oben")) {
FragmentWW.tempBoilerOben = message.toString();
}
if (topic.equals("fhem/temp/Temp_Boiler_unten")) {
FragmentWW.tempBoilerUnten = message.toString();
}
// Grossraum
if (topic.equals("fhem/Heizung/MAX_Grossraum/Mode")) {
FragmentHeizkoerper.modeHKGrossraum = message.toString();
}
if (topic.equals("fhem/Heizung/MAX_Grossraum/Solltemperatur")) {
FragmentHeizkoerper.sollTempHKGrossraum = message.toString();
}
if (topic.equals("fhem/temp/Temp_Grossraum")) {
FragmentHeizkoerper.istTempHKGrossraum = message.toString();
}
// Doris
if (topic.equals("fhem/Heizung/MAX_Doris_klein/Mode")) {
FragmentHeizkoerper.modeHKDoris = message.toString();
}
if (topic.equals("fhem/Heizung/MAX_Doris_klein/Solltemperatur")) {
FragmentHeizkoerper.sollTempHKDoris = message.toString();
}
if (topic.equals("fhem/temp/Temp_Doris")) {
FragmentHeizkoerper.istTempHKDoris = message.toString();
}
// Doris Bad
if (topic.equals("fhem/Heizung/MAX_Doris_Bad/Mode")) {
FragmentHeizkoerper.modeHKDorisBad = message.toString();
}
if (topic.equals("fhem/Heizung/MAX_Doris_Bad/Solltemperatur")) {
FragmentHeizkoerper.sollTempHKDorisBad = message.toString();
}
if (topic.equals("fhem/temp/Temp_DorisBad")) {
FragmentHeizkoerper.istTempHKDorisBad = message.toString();
}
// Arbeitszimmer
if (topic.equals("fhem/Heizung/MAX_Arbeitszimmer/Mode")) {
FragmentHeizkoerper.modeHKArbeitszimmer = message.toString();
}
if (topic.equals("fhem/Heizung/MAX_Arbeitszimmer/Solltemperatur")) {
FragmentHeizkoerper.sollTempHKArbeitszimmer = message.toString();
}
if (topic.equals("fhem/temp/Temp_Arbeitszimmer")) {
FragmentHeizkoerper.istTempHKArbeitszimmer = message.toString();
}
// Vorraum
if (topic.equals("fhem/Heizung/MAX_Vorraum/Mode")) {
FragmentHeizkoerper.modeHKVorraum = message.toString();
}
if (topic.equals("fhem/Heizung/MAX_Vorraum/Solltemperatur")) {
FragmentHeizkoerper.sollTempHKVorraum = message.toString();
}
if (topic.equals("fhem/Heizung/MAX_Vorraum/Temperatur")) {
FragmentHeizkoerper.istTempHKVorraum = message.toString();
}
// WC EG
if (topic.equals("fhem/Heizung/MAX_WC/Mode")) {
FragmentHeizkoerper.modeHKWCEG = message.toString();
}
if (topic.equals("fhem/Heizung/MAX_WC/Solltemperatur")) {
FragmentHeizkoerper.sollTempHKWCEG = message.toString();
}
if (topic.equals("fhem/Heizung/MAX_WC/Temperatur")) {
FragmentHeizkoerper.istTempHKWCEG = message.toString();
}
// Bad
if (topic.equals("fhem/Heizung/MAX_Bad/Mode")) {
FragmentHeizkoerper.modeHKBad = message.toString();
}
if (topic.equals("fhem/Heizung/MAX_Bad/Solltemperatur")) {
FragmentHeizkoerper.sollTempHKBad = message.toString();
}
if (topic.equals("fhem/temp/Temp_Bad")) {
FragmentHeizkoerper.istTempHKBad = message.toString();
}
// Florian
if (topic.equals("fhem/Heizung/MAX_Florian/Mode")) {
FragmentHeizkoerper.modeHKFlorian = message.toString();
}
if (topic.equals("fhem/Heizung/MAX_Florian/Solltemperatur")) {
FragmentHeizkoerper.sollTempHKFlorian = message.toString();
}
if (topic.equals("fhem/temp/Temp_Flo")) {
FragmentHeizkoerper.istTempHKFlorian = message.toString();
}
// Stefan
if (topic.equals("fhem/Heizung/MAX_Stefan/Mode")) {
FragmentHeizkoerper.modeHKStefan = message.toString();
}
if (topic.equals("fhem/Heizung/MAX_Stefan/Solltemperatur")) {
FragmentHeizkoerper.sollTempHKStefan = message.toString();
Log.d("SollTempStefan", message.toString());
}
if (topic.equals("fhem/temp/Temp_Stefan")) {
FragmentHeizkoerper.istTempHKStefan = message.toString();
Log.d("IstTempStefan", message.toString());
}
// Dachboden
if (topic.equals("fhem/Heizung/MAX_Dachboden/Mode")) {
FragmentHeizkoerper.modeHKDachboden = message.toString();
}
if (topic.equals("fhem/Heizung/MAX_Dachboden/Solltemperatur")) {
FragmentHeizkoerper.sollTempHKDachboden = message.toString();
}
if (topic.equals("fhem/temp/Temp_Dachboden")) {
FragmentHeizkoerper.istTempHKDachboden = message.toString();
}
}
public static void fensterZustaende(String topic, MqttMessage message) {
if (topic.equals("stat/Haussteuerung/Fenster/Eingangstuer")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
tv_Zustand1 = jsonObject.get("Zustand").getAsString();
}
if (topic.equals("stat/Haussteuerung/Fenster/Garagetuer")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
tv_Zustand2 = jsonObject.get("Zustand").getAsString();
}
if (topic.equals("stat/Haussteuerung/Fenster/Kellertuer")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
tv_Zustand3 = jsonObject.get("Zustand").getAsString();
}
if (topic.equals("stat/Haussteuerung/Fenster/TerrassenTuer_Doris")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
tv_Zustand4 = jsonObject.get("Zustand").getAsString();
}
if (topic.equals("stat/Haussteuerung/Fenster/FensterLinks_Doris")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
tv_Zustand5 = jsonObject.get("Zustand").getAsString();
}
if (topic.equals("stat/Haussteuerung/Fenster/FensterRechts_Doris")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
tv_Zustand6 = jsonObject.get("Zustand").getAsString();
}
if (topic.equals("stat/Haussteuerung/Fenster/FensterBad_Doris")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
tv_Zustand7 = jsonObject.get("Zustand").getAsString();
}
if (topic.equals("stat/Haussteuerung/Fenster/Tom")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
tv_Zustand8 = jsonObject.get("Zustand").getAsString();
}
if (topic.equals("stat/Haussteuerung/Fenster/Wohnzimmer")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
tv_Zustand9 = jsonObject.get("Zustand").getAsString();
}
if (topic.equals("stat/Haussteuerung/Fenster/Esszimmer")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
tv_Zustand10 = jsonObject.get("Zustand").getAsString();
}
if (topic.equals("stat/Haussteuerung/Fenster/EssplatzKueche")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
tv_Zustand11 = jsonObject.get("Zustand").getAsString();
}
if (topic.equals("stat/Haussteuerung/Fenster/Kueche")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
tv_Zustand12 = jsonObject.get("Zustand").getAsString();
}
if (topic.equals("stat/Haussteuerung/Fenster/Garderobe")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
tv_Zustand13 = jsonObject.get("Zustand").getAsString();
}
if (topic.equals("stat/Haussteuerung/Fenster/WC")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
tv_Zustand14 = jsonObject.get("Zustand").getAsString();
}
if (topic.equals("stat/Haussteuerung/Fenster/Dachflaechenfenster")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
tv_Zustand15 = jsonObject.get("Zustand").getAsString();
}
if (topic.equals("stat/Haussteuerung/Fenster/Flo")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
tv_Zustand16 = jsonObject.get("Zustand").getAsString();
}
if (topic.equals("stat/Haussteuerung/Fenster/Stefan")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
tv_Zustand17 = jsonObject.get("Zustand").getAsString();
}
if (topic.equals("stat/Haussteuerung/Fenster/Bad")) {
JsonObject jsonObject = JsonParser.parseString(message.toString()).getAsJsonObject();
tv_Zustand18 = jsonObject.get("Zustand").getAsString();
}
}
}

View File

@@ -0,0 +1,234 @@
package com.haussteuerung;
import android.annotation.SuppressLint;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.media.MediaScannerConnection;
import android.os.Build;
import android.os.Environment;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.widget.Toast;
import androidx.core.app.NotificationCompat;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.Map;
import java.util.Objects;
import java.util.Random;
@SuppressLint("MissingFirebaseInstanceTokenRefresh")
public class MyFirebaseMessagingService extends FirebaseMessagingService {
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
super.onMessageReceived(remoteMessage);
Log.d("Firebase", remoteMessage.getFrom() + ", " + remoteMessage.getData().get("content"));
// Wenn eine Activity geöffnet ist oder die FB-Nachricht nicht "Es hat gel" enthält, eine Toastbox zeigen, ansonsten eine Notification senden
if (((!MainActivity.pausedMainActivity)
|| (!activityDoris.pausedDoris)
|| (!activityDorisLicht.pausedDorisLicht)
|| (!activityGlocke.pausedGlocke)
|| (!activityHaus.pausedHaus)
|| (!activityLicht.pausedLicht)
|| (!activityLog.pausedLog)
|| (!activitySky.pausedSky)
|| (!activityLWP.pausedLWP))
&& (!Objects.requireNonNull(remoteMessage.getData().get("content")).contains("Es hat gel"))) {
Handler handler = new Handler(Looper.getMainLooper());
handler.post(() -> Toast.makeText(getApplicationContext(), remoteMessage.getData().get("content"), Toast.LENGTH_LONG).show());
} else {
if (Objects.requireNonNull(remoteMessage.getData().get("content")).contains("Es hat gel")) {
downloadFile(remoteMessage);
try {
Thread.sleep(700);
} catch (InterruptedException e) {
e.printStackTrace();
}
sendNotification(remoteMessage);
Log.d("Notification", "Glocke");
} else {
sendNotification(remoteMessage);
Log.d("Notification", "Everything else");
}
}
}
public void downloadFile(RemoteMessage remoteMessage) {
File fileCam = new File(Environment.getExternalStorageDirectory().getPath() + "/Pictures/Haussteuerung/");
if (!fileCam.exists()) {
fileCam.mkdir();
}
if (Objects.requireNonNull(remoteMessage.getData().get("content")).contains("Es hat gel")) {
Log.d("Foto", remoteMessage.getData().get("content"));
String url = "https://www.klebl.info/cam/" + Objects.requireNonNull(remoteMessage.getData().get("content")).substring(28, 43) + ".jpg";
Log.d("Foto", url);
String f1 = Environment.getExternalStorageDirectory().getPath() + "/Pictures/Haussteuerung/" + Objects.requireNonNull(remoteMessage.getData().get("content")).substring(28, 43) + ".jpg";
String f2 = Environment.getExternalStorageDirectory().getPath() + "/Pictures/Haussteuerung/cam.jpg";
Handler handler = new Handler(Looper.getMainLooper());
handler.post(() -> {
Thread gfgThread = new Thread(() -> {
try {
InputStream in = null;
try {
in = new URL(url).openStream();
Log.d("Foto", "Verbindung zum Server erfolgreich. Download wird durchgeführt.");
} catch (IOException e) {
// Wenn kein Foto gemacht wurde, hat das Foto 0kb, daher 404 error.
Log.d("Foto", "Verbindungsfehler. Foto am Server prüfen.");
}
try {
Files.copy(in, Paths.get(f1), StandardCopyOption.REPLACE_EXISTING);
Log.d("Foto", "Foto 1 Download");
Thread.sleep(200);
Files.copy(Paths.get(f1), Paths.get(f2), StandardCopyOption.REPLACE_EXISTING);
Log.d("Foto", "Foto 2 Download");
Log.d("Foto", "Download und Speichern erfolgreich.");
} catch (IOException e) {
Log.d("Foto", "Download fehlgeschlagen.");
}
} catch (Exception e) {
e.printStackTrace();
}
});
gfgThread.start();
// MediaScanner starten um das Foto in die Gallery zu bringen
MediaScannerConnection.scanFile(getApplicationContext(), new String[]{f1},
new String[]{"image/jpg"}, null);
MediaScannerConnection.scanFile(getApplicationContext(), new String[]{f2},
new String[]{"image/jpg"}, null);
});
}
}
public void sendNotification(RemoteMessage remoteMessage) {
String content;
PendingIntent pendingIntent = null;
Map<String, String> data = remoteMessage.getData();
String title = data.get("title");
if (Objects.requireNonNull(remoteMessage.getData().get("content")).contains("Es hat gel")) {
content = "Es hat um "
+ Objects.requireNonNull(remoteMessage.getData().get("content")).substring(37, 39) + ":"
+ Objects.requireNonNull(remoteMessage.getData().get("content")).substring(39, 41) + ":"
+ Objects.requireNonNull(remoteMessage.getData().get("content")).substring(41, 43) + " geläutet, Tür öffnen!";
} else {
content = data.get("content");
}
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
String NOTIFICATION_CHANNEL_ID;
// Entscheiden, welche Activity mit welchen Extras gestartet werden soll
if (Objects.requireNonNull(remoteMessage.getData().get("content")).contains("Es hat gel")) {
NOTIFICATION_CHANNEL_ID = "Glocke";
Intent intent1 = new Intent(this, MainActivity.class);
intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
Log.d("GlockeFirebase", Objects.requireNonNull(remoteMessage.getData().get("content")).substring(28, 43));
// intent1.putExtra("Glocke", "Glocke");
intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
intent1.putExtra("Glocke", "Glocke");
intent1.putExtra("Time", Objects.requireNonNull(remoteMessage.getData().get("content")).substring(28, 43));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
intent1.setIdentifier(Objects.requireNonNull(remoteMessage.getData().get("content")).substring(28, 43));
}
pendingIntent = PendingIntent.getActivity(getApplicationContext(), 0 /* Request code */, intent1, PendingIntent.FLAG_IMMUTABLE);
} else if (Objects.requireNonNull(remoteMessage.getData().get("content")).contains("Sky")) {
NOTIFICATION_CHANNEL_ID = "Sky";
Intent intent2 = new Intent(this, MainActivity.class);
intent2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
intent2.putExtra("Sky", "Sky");
pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent2, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT);
} else if (Objects.requireNonNull(remoteMessage.getData().get("content")).contains("Update")) {
NOTIFICATION_CHANNEL_ID = "Update";
Intent intent3 = new Intent(this, FileDownload.class);
intent3.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent3, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT);
} else if (Objects.requireNonNull(remoteMessage.getData().get("content")).contains("Waschmaschine")) {
NOTIFICATION_CHANNEL_ID = "Waschmaschine";
} else {
NOTIFICATION_CHANNEL_ID = "Sonstiges";
Intent intent4 = new Intent(this, MainActivity.class);
intent4.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent4.putExtra("Other", remoteMessage.getData().get("content"));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
intent4.setIdentifier(remoteMessage.getData().get("content"));
}
Log.d("OtherFirebase", Objects.requireNonNull(remoteMessage.getData().get("content")));
pendingIntent = PendingIntent.getActivity(getApplicationContext(), 0 /* Request code */, intent4, PendingIntent.FLAG_IMMUTABLE);
}
String description = "Haussteuerung - " + NOTIFICATION_CHANNEL_ID;
NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, description, NotificationManager.IMPORTANCE_HIGH);
channel.setDescription(description);
channel.setShowBadge(true);
channel.canShowBadge();
channel.enableLights(true);
channel.setLightColor(getResources().getColor(R.color.gradient_blue));
channel.enableVibration(true);
channel.setVibrationPattern(new long[]{100, 200, 300, 400, 500});
notificationManager.createNotificationChannel(channel);
Random notification_id = new Random();
NotificationCompat.Builder notificationBuilder = null;
if (Objects.requireNonNull(remoteMessage.getData().get("content")).contains("Es hat gel")) {
notificationBuilder = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
.setDefaults(Notification.DEFAULT_ALL)
.setContentIntent(pendingIntent)
.setContentTitle(title)
.setContentText(content)
.setAutoCancel(true)
.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.haus_icon))
.setLights(getResources().getColor(R.color.gradient_blue), 1000, 300)
.setStyle(new NotificationCompat.BigPictureStyle()
.bigPicture(BitmapFactory.decodeFile(Environment.getExternalStorageDirectory().getPath() + "/Pictures/Haussteuerung/" + Objects.requireNonNull(remoteMessage.getData().get("content")).substring(28, 43) + ".jpg")))
.setSmallIcon(R.drawable.haus_icon);
} else {
notificationBuilder = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
.setDefaults(Notification.DEFAULT_ALL)
.setContentIntent(pendingIntent)
.setContentTitle(title)
.setContentText(content)
.setAutoCancel(true)
.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.haus_icon))
.setLights(getResources().getColor(R.color.gradient_blue), 1000, 300)
.setSmallIcon(R.drawable.haus_icon);
}
Log.d("num", String.valueOf(notification_id.nextInt(1000)));
assert notificationManager != null;
notificationManager.notify(notification_id.nextInt(1000), notificationBuilder.build());
}
}

View File

@@ -0,0 +1,283 @@
package com.haussteuerung;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.NumberPicker;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import java.util.ArrayList;
public class activityChristmas extends AppCompatActivity {
static String power = "OFF";
private String hsbColorMqtt = "";
static ArrayList<String> hsbColorArray;
private Button buttonPower;
private Button buttonColor1, buttonColor2,
buttonColor3, buttonColor4,
buttonColor5,buttonColor6,
buttonColor7, buttonColor8;
private NumberPicker picker;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Ändern der Statusbar-Farbe
androidx.appcompat.app.ActionBar actionBar = getSupportActionBar();
assert actionBar != null;
actionBar.setBackgroundDrawable(AppCompatResources.getDrawable(getApplicationContext(), R.drawable.gradient_titlebar));
setContentView(R.layout.activity_christmas);
setTitle("Haussteuerung - Christmas");
Log.d("HSBColor0", hsbColorArray.get(0));
Log.d("HSBColor1", hsbColorArray.get(1));
Log.d("HSBColor2", hsbColorArray.get(2));
buttonPower = findViewById(R.id.buttonPower);
buttonColor1 = findViewById(R.id.buttonColor1);
buttonColor2 = findViewById(R.id.buttonColor2);
buttonColor3 = findViewById(R.id.buttonColor3);
buttonColor4 = findViewById(R.id.buttonColor4);
buttonColor5 = findViewById(R.id.buttonColor5);
buttonColor6 = findViewById(R.id.buttonColor6);
buttonColor7 = findViewById(R.id.buttonColor7);
buttonColor8 = findViewById(R.id.buttonColor8);
picker = findViewById(R.id.picker);
handleButton();
handleNumberPicker();
}
private void handleButton() {
if (power.equals("ON")) {
buttonPower.setText(R.string.on);
} else if (power.equals("OFF")) {
buttonPower.setText(R.string.off);
}
buttonColor1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
setHSBColor("10");
Log.d("HSBColorRed", hsbColorMqtt);
MqttClient.publish("tele/sonoff153/STATE", "{\"POWER\":\"" + buttonPower.getText() +"\",\"HSBColor\":\""+ hsbColorMqtt + "\"}", 2, true);
MqttClient.publish("cmnd/sonoff153/HSBColor", hsbColorMqtt);
}
});
buttonColor2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
setHSBColor("50");
Log.d("HSBColorYellow", hsbColorMqtt);
MqttClient.publish("tele/sonoff153/STATE", "{\"POWER\":\"" + buttonPower.getText() +"\",\"HSBColor\":\""+ hsbColorMqtt + "\"}", 2, true);
MqttClient.publish("cmnd/sonoff153/HSBColor", hsbColorMqtt);
}
});
buttonColor3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
setHSBColor("100");
Log.d("HSBColorGreen", hsbColorMqtt);
MqttClient.publish("tele/sonoff153/STATE", "{\"POWER\":\"" + buttonPower.getText() +"\",\"HSBColor\":\""+ hsbColorMqtt + "\"}", 2, true);
MqttClient.publish("cmnd/sonoff153/HSBColor", hsbColorMqtt);
}
});
buttonColor4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
setHSBColor("150");
Log.d("HSBColorLightBlue", hsbColorMqtt);
MqttClient.publish("tele/sonoff153/STATE", "{\"POWER\":\"" + buttonPower.getText() +"\",\"HSBColor\":\""+ hsbColorMqtt + "\"}", 2, true);
MqttClient.publish("cmnd/sonoff153/HSBColor", hsbColorMqtt);
}
});
buttonColor5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
setHSBColor("200");
Log.d("HSBColorBlue", hsbColorMqtt);
MqttClient.publish("tele/sonoff153/STATE", "{\"POWER\":\"" + buttonPower.getText() +"\",\"HSBColor\":\""+ hsbColorMqtt + "\"}", 2, true);
MqttClient.publish("cmnd/sonoff153/HSBColor", hsbColorMqtt);
}
});
buttonColor6.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
setHSBColor("250");
Log.d("HSBColorPurple", hsbColorMqtt);
MqttClient.publish("tele/sonoff153/STATE", "{\"POWER\":\"" + buttonPower.getText() +"\",\"HSBColor\":\""+ hsbColorMqtt + "\"}", 2, true);
MqttClient.publish("cmnd/sonoff153/HSBColor", hsbColorMqtt);
}
});
buttonColor7.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
setHSBColor("300");
Log.d("HSBColorWhite", hsbColorMqtt);
MqttClient.publish("tele/sonoff153/STATE", "{\"POWER\":\"" + buttonPower.getText() +"\",\"HSBColor\":\""+ hsbColorMqtt + "\"}", 2, true);
MqttClient.publish("cmnd/sonoff153/HSBColor", hsbColorMqtt);
}
});
buttonColor8.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
setHSBColor("350");
Log.d("HSBColorChanging", hsbColorMqtt);
MqttClient.publish("tele/sonoff153/STATE", "{\"POWER\":\"" + buttonPower.getText() +"\",\"HSBColor\":\""+ hsbColorMqtt + "\"}", 2, true);
MqttClient.publish("cmnd/sonoff153/HSBColor", hsbColorMqtt);
}
});
buttonPower.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String hsbColorMqtt = hsbColorArray.get(0) + "," + hsbColorArray.get(1) + "," + hsbColorArray.get(2);
if (buttonPower.getText().equals("ON")) {
MqttClient.publish("tele/sonoff153/STATE", "{\"POWER\":\"OFF\",\"HSBColor\":\""+ hsbColorMqtt + "\"}", 2, true);
MqttClient.publish("cmnd/sonoff153/POWER", "0");
buttonPower.setText(R.string.off);
} else if (buttonPower.getText().equals("OFF")) {
MqttClient.publish("tele/sonoff153/STATE", "{\"POWER\":\"ON\",\"HSBColor\":\""+ hsbColorMqtt + "\"}", 2, true);
MqttClient.publish("cmnd/sonoff153/POWER", "1");
buttonPower.setText(R.string.on);
}
}
});
}
private void handleNumberPicker() {
String[] values = {"Bright (Steady On)","Gradually (Slow Fade)","Star (Sequential)","Flower (In Waves)",
"Marquee (Chasing / Flash)","Fireworks (Twinkle / Flash)","Meteor","Stream"};
picker.setWrapSelectorWheel(false);
picker.setMinValue(0);
picker.setMaxValue(values.length - 1);
if (Integer.parseInt(hsbColorArray.get(2)) >= 0 && Integer.parseInt(hsbColorArray.get(2)) <= 12) {
picker.setValue(0);
}
if (Integer.parseInt(hsbColorArray.get(2)) >= 13 && Integer.parseInt(hsbColorArray.get(2)) <= 24) {
picker.setValue(1);
}
if (Integer.parseInt(hsbColorArray.get(2)) >= 25 && Integer.parseInt(hsbColorArray.get(2)) <= 37) {
picker.setValue(2);
}
if (Integer.parseInt(hsbColorArray.get(2)) >= 38 && Integer.parseInt(hsbColorArray.get(2)) <= 49) {
picker.setValue(3);
}
if (Integer.parseInt(hsbColorArray.get(2)) >= 50 && Integer.parseInt(hsbColorArray.get(2)) <= 62) {
picker.setValue(4);
}
if (Integer.parseInt(hsbColorArray.get(2)) >= 63 && Integer.parseInt(hsbColorArray.get(2)) <= 74) {
picker.setValue(5);
}
if (Integer.parseInt(hsbColorArray.get(2)) >= 75 && Integer.parseInt(hsbColorArray.get(2)) <= 87) {
picker.setValue(6);
}
if (Integer.parseInt(hsbColorArray.get(2)) >= 88 && Integer.parseInt(hsbColorArray.get(2)) <= 100) {
picker.setValue(7);
}
picker.setDisplayedValues(values);
picker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener() {
@Override
public void onValueChange(NumberPicker numberPicker, int i, int i1) {
if (numberPicker.getValue() == 0) {
String hsbColorMqtt = hsbColorArray.get(0) + ",100,10";
MqttClient.publish("tele/sonoff153/STATE", "{\"POWER\":\"" + buttonPower.getText() +"\",\"HSBColor\":\""+ hsbColorMqtt + "\"}", 2, true);
MqttClient.publish("cmnd/sonoff153/HSBColor", hsbColorMqtt);
}
if (numberPicker.getValue() == 1) {
String hsbColorMqtt = hsbColorArray.get(0) + ",100,20";
MqttClient.publish("tele/sonoff153/STATE", "{\"POWER\":\"" + buttonPower.getText() +"\",\"HSBColor\":\""+ hsbColorMqtt + "\"}", 2, true);
MqttClient.publish("cmnd/sonoff153/HSBColor", hsbColorMqtt);
}
if (numberPicker.getValue() == 2) {
String hsbColorMqtt = hsbColorArray.get(0) + ",100,30";
MqttClient.publish("tele/sonoff153/STATE", "{\"POWER\":\"" + buttonPower.getText() +"\",\"HSBColor\":\""+ hsbColorMqtt + "\"}", 2, true);
MqttClient.publish("cmnd/sonoff153/HSBColor", hsbColorMqtt);
}
if (numberPicker.getValue() == 3) {
String hsbColorMqtt = hsbColorArray.get(0) + ",100,40";
MqttClient.publish("tele/sonoff153/STATE", "{\"POWER\":\"" + buttonPower.getText() +"\",\"HSBColor\":\""+ hsbColorMqtt + "\"}", 2, true);
MqttClient.publish("cmnd/sonoff153/HSBColor", hsbColorMqtt);
}
if (numberPicker.getValue() == 4) {
String hsbColorMqtt = hsbColorArray.get(0) + ",100,50";
MqttClient.publish("tele/sonoff153/STATE", "{\"POWER\":\"" + buttonPower.getText() +"\",\"HSBColor\":\""+ hsbColorMqtt + "\"}", 2, true);
MqttClient.publish("cmnd/sonoff153/HSBColor", hsbColorMqtt);
}
if (numberPicker.getValue() == 5) {
String hsbColorMqtt = hsbColorArray.get(0) + ",100,70";
MqttClient.publish("tele/sonoff153/STATE", "{\"POWER\":\"" + buttonPower.getText() +"\",\"HSBColor\":\""+ hsbColorMqtt + "\"}", 2, true);
MqttClient.publish("cmnd/sonoff153/HSBColor", hsbColorMqtt);
}
if (numberPicker.getValue() == 6) {
String hsbColorMqtt = hsbColorArray.get(0) + ",100,80";
MqttClient.publish("tele/sonoff153/STATE", "{\"POWER\":\"" + buttonPower.getText() +"\",\"HSBColor\":\""+ hsbColorMqtt + "\"}", 2, true);
MqttClient.publish("cmnd/sonoff153/HSBColor", hsbColorMqtt);
}
if (numberPicker.getValue() == 7) {
String hsbColorMqtt = hsbColorArray.get(0) + ",100,90";
MqttClient.publish("tele/sonoff153/STATE", "{\"POWER\":\"" + buttonPower.getText() +"\",\"HSBColor\":\""+ hsbColorMqtt + "\"}", 2, true);
MqttClient.publish("cmnd/sonoff153/HSBColor", hsbColorMqtt);
}
Log.d("NumberPicker", String.valueOf(numberPicker.getValue()));
}
});
}
private void setHSBColor(String color) {
if (picker.getValue() == 0) {
hsbColorMqtt = color + ",100,10";
}
if (picker.getValue() == 1) {
hsbColorMqtt = color + ",100,20";
}
if (picker.getValue() == 2) {
hsbColorMqtt = color + ",100,30";
}
if (picker.getValue() == 3) {
hsbColorMqtt = color + ",100,40";
}
if (picker.getValue() == 4) {
hsbColorMqtt = color + ",100,50";
}
if (picker.getValue() == 5) {
hsbColorMqtt = color + ",100,70";
}
if (picker.getValue() == 6) {
hsbColorMqtt = color + ",100,80";
}
if (picker.getValue() == 7) {
hsbColorMqtt = color + ",100,90";
}
}
@Override
protected void onResume() {
super.onResume();
}
@Override
protected void onPause() {
super.onPause();
}
}

View File

@@ -0,0 +1,204 @@
package com.haussteuerung;
import android.app.TimePickerDialog;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.Locale;
public class activityDoris extends AppCompatActivity {
Button buttonSend, zeitBlutdruck, zeitFiebertemp;
int hourBlutdruck = 0, minuteBlutdruck = 0, hourFiebertemp = 0, minuteFiebertemp = 0;
static String werteBlutdruck = "";
static String wertFiebertemp = "";
TextView textSYS, textDIA, textFiebertemp;
LocalDateTime datetime = LocalDateTime.now();
DateTimeFormatter dateTimeFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String formattedDate = datetime.format(dateTimeFormat);
public static boolean pausedDoris = true;
Gson gson = new Gson();
String msg;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
androidx.appcompat.app.ActionBar actionBar = getSupportActionBar();
assert actionBar != null;
actionBar.setBackgroundDrawable(AppCompatResources.getDrawable(getApplicationContext(), R.color.black));
pausedDoris = false;
setContentView(R.layout.activity_doris);
setTitle("Haussteuerung - Doris");
buttonSend = findViewById(R.id.buttonSend);
// Blutdruck ---------------------------------------
zeitBlutdruck = findViewById(R.id.zeitBlutdruck);
CheckBox checkBlutdruck = findViewById(R.id.checkBlutdruck);
textSYS = findViewById(R.id.textSYS);
textDIA = findViewById(R.id.textDIA);
TextView tv_SYS = findViewById(R.id.tvSYS);
TextView tv_DIA = findViewById(R.id.tvDIA);
hourBlutdruck = datetime.getHour();
minuteBlutdruck = datetime.getMinute();
zeitBlutdruck.setText(String.format(Locale.getDefault(), "%02d:%02d", datetime.getHour(), datetime.getMinute()));
zeitBlutdruck.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
timePickerDialog(zeitBlutdruck);
}
});
checkBlutdruck.setOnClickListener(view -> {
if (checkBlutdruck.isChecked()) {
zeitBlutdruck.setEnabled(true);
tv_SYS.setEnabled(true);
tv_DIA.setEnabled(true);
textSYS.setEnabled(true);
textDIA.setEnabled(true);
} else {
zeitBlutdruck.setEnabled(false);
tv_SYS.setEnabled(false);
tv_DIA.setEnabled(false);
textSYS.setEnabled(false);
textDIA.setEnabled(false);
}
});
// Fiebertemperatur --------------------------------
zeitFiebertemp = findViewById(R.id.zeitFiebertemp);
CheckBox checkFiebertemp = findViewById(R.id.checkFiebertemp);
TextView tvFiebertemp = findViewById(R.id.tvFiebertemp);
textFiebertemp = findViewById(R.id.textFiebertemp);
hourFiebertemp = datetime.getHour();
minuteFiebertemp = datetime.getMinute();
zeitFiebertemp.setText(String.format(Locale.getDefault(), "%02d:%02d", datetime.getHour(), datetime.getMinute()));
zeitFiebertemp.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
timePickerDialog(zeitFiebertemp);
}
});
checkFiebertemp.setOnClickListener(view -> {
if (checkFiebertemp.isChecked()) {
zeitFiebertemp.setEnabled(true);
tvFiebertemp.setEnabled(true);
textFiebertemp.setEnabled(true);
} else {
zeitFiebertemp.setEnabled(false);
tvFiebertemp.setEnabled(false);
textFiebertemp.setEnabled(false);
}
});
// Send-Button -------------------------------------
buttonSend.setOnClickListener(view -> {
boolean setBlutdruck = false;
if (checkBlutdruck.isChecked() && (textSYS.getText().length() == 0 || textDIA.getText().length() == 0)) {
Toast.makeText(activityDoris.this, "Bitte alle Blutdruck-Werte ausfüllen!", Toast.LENGTH_LONG).show();
} else if (checkBlutdruck.isChecked() && (textSYS.getText().length() > 0 || textDIA.getText().length() > 0)) {
String hour = Integer.toString(hourBlutdruck);
String minute = Integer.toString(minuteBlutdruck);
String sys = textSYS.getText().toString();
String dia = textDIA.getText().toString();
werteBlutdruck = "{\"DeviceID\":\"" + MainActivity.ID + "\", \"Datum\":" + "\"" + formattedDate + " " + hour + ":" + minute + ":00" + "\"," + "\"SYS\":" + "\"" + sys + "\"," + "\"DIA\":" + "\"" + dia + "\"}";
Log.d("Doris", werteBlutdruck);
MqttClient.publish("cmnd/Haussteuerung/Doris/Blutdruck", werteBlutdruck);
setBlutdruck = true;
}
boolean setFiebertemp = false;
if (checkFiebertemp.isChecked() && (textFiebertemp.getText().length() == 0)) {
Toast.makeText(activityDoris.this, "Bitte einen Temperaturwert eingeben!", Toast.LENGTH_LONG).show();
} else if (checkFiebertemp.isChecked() && (textFiebertemp.getText().length() > 0)) {
String formattedDate = datetime.format(dateTimeFormat);
String hour = Integer.toString(hourFiebertemp);
String minute = Integer.toString(minuteFiebertemp);
String fiebertemp = textFiebertemp.getText().toString();
msg = gson.toJson(new Temperatur(MainActivity.ID, formattedDate + " " + hour + ":" + minute + ":00", fiebertemp));
MqttClient.publish("cmnd/Haussteuerung/Doris/Temperatur", msg);
// wertFiebertemp = "{\"DeviceID\":\"" + MainActivity.ID + "\", \"Datum\":" + "\"" + formattedDate + " " + hour + ":" + minute + ":00" + "\"," + "\"Temperatur\": " + "\"" + fiebertemp + "\"}";
Log.d("Doris", msg);
// MqttClient.publish("cmnd/Haussteuerung/Doris/Temperatur", wertFiebertemp);
setFiebertemp = true;
}
if (setBlutdruck || setFiebertemp) {
finish();
}
});
}
public void timePickerDialog(Button button) {
LocalTime localTime = LocalTime.parse(button.getText());
int hour = localTime.getHour();
int minute = localTime.getMinute();
TimePickerDialog.OnTimeSetListener onTimeSetListener = new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker timePicker, int selectedHour, int selectedMinute) {
button.setText(String.format(Locale.getDefault(), "%02d:%02d", selectedHour, selectedMinute));
}
};
TimePickerDialog timePickerDialog = new TimePickerDialog(this, onTimeSetListener, hour, minute, true);
timePickerDialog.show();
}
@Override
protected void onPause() {
super.onPause();
pausedDoris = true;
}
@Override
protected void onResume() {
super.onResume();
pausedDoris = false;
}
@Override
protected void onStop() {
super.onStop();
pausedDoris = true;
}
}
class Temperatur {
@SerializedName("DeviceID")
private final String deviceId;
@SerializedName("Datum")
private final String datum;
@SerializedName("Temperatur")
private final String temperatur;
public Temperatur(String deviceId, String datum, String temperatur) {
this.deviceId = deviceId;
this.datum = datum;
this.temperatur = temperatur;
}
}

View File

@@ -0,0 +1,253 @@
package com.haussteuerung;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
public class activityDorisLicht extends AppCompatActivity implements View.OnClickListener {
// Position 0 = unten
// Position 100 = oben
public static boolean pausedDorisLicht = true;
Gson gson = new Gson();
String msg;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
androidx.appcompat.app.ActionBar actionBar = getSupportActionBar();
assert actionBar != null;
actionBar.setBackgroundDrawable(AppCompatResources.getDrawable(getApplicationContext(), R.color.black));
pausedDorisLicht = false;
setContentView(R.layout.activity_doris_licht);
setTitle("Haussteuerung - Doris Licht");
Button buttonDeckenlampe = findViewById(R.id.buttonDeckenlampe);
Button buttonDorisStehlampe = findViewById(R.id.buttonStehlampe);
Button buttonBadDeckenlampe = findViewById(R.id.buttonDeckenlampeBad);
Button buttonBadWandlampe = findViewById(R.id.buttonWandlampeBad);
Button buttonRollo1 = findViewById(R.id.buttonRollo1);
Button buttonRollo2 = findViewById(R.id.buttonRollo2);
Button buttonRollo3 = findViewById(R.id.buttonRollo3);
Button buttonRollo4 = findViewById(R.id.buttonRollo4);
Button buttonRollo5 = findViewById(R.id.buttonRollo5);
Button buttonRollo6 = findViewById(R.id.buttonRollo6);
Button buttonRollo7 = findViewById(R.id.buttonRollo7);
Button buttonRollo8 = findViewById(R.id.buttonRollo8);
Button buttonRollo9 = findViewById(R.id.buttonRollo9);
Button buttonRollo10 = findViewById(R.id.buttonRollo10);
Button buttonRollo11 = findViewById(R.id.buttonRollo11);
Button buttonRollo12 = findViewById(R.id.buttonRollo12);
Button buttonRollo13 = findViewById(R.id.buttonRollo13);
Button buttonRollo14 = findViewById(R.id.buttonRollo14);
Button buttonRollo15 = findViewById(R.id.buttonRollo15);
buttonDeckenlampe.setOnClickListener(this);
buttonDorisStehlampe.setOnClickListener(this);
buttonBadDeckenlampe.setOnClickListener(this);
buttonBadWandlampe.setOnClickListener(this);
buttonRollo1.setOnClickListener(this);
buttonRollo2.setOnClickListener(this);
buttonRollo3.setOnClickListener(this);
buttonRollo4.setOnClickListener(this);
buttonRollo5.setOnClickListener(this);
buttonRollo6.setOnClickListener(this);
buttonRollo7.setOnClickListener(this);
buttonRollo8.setOnClickListener(this);
buttonRollo9.setOnClickListener(this);
buttonRollo10.setOnClickListener(this);
buttonRollo11.setOnClickListener(this);
buttonRollo12.setOnClickListener(this);
buttonRollo13.setOnClickListener(this);
buttonRollo14.setOnClickListener(this);
buttonRollo15.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.buttonDeckenlampe:
msg = gson.toJson(new Licht(MainActivity.ID, "Doris Deckenlampe", "Lamp21"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
// String msg1 = "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"Doris Deckenlampe" + "\",\"Device\":\"" + v.getTag().toString() + "\",\"Power\":\"power" + "\",\"Message\":\"2\"}";
// MqttClient.publish("cmnd/Haussteuerung/Licht", msg1);
break;
case R.id.buttonStehlampe:
msg = gson.toJson(new Licht(MainActivity.ID, "Doris Stehlampe", "Lamp22"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
// String msg2 = "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"Doris Stehlampe" + "\",\"Device\":\"" + v.getTag().toString() + "\",\"Power\":\"power" + "\",\"Message\":\"2\"}";
// MqttClient.publish("cmnd/Haussteuerung/Licht", msg2);
break;
case R.id.buttonDeckenlampeBad:
msg = gson.toJson(new Licht(MainActivity.ID, "Doris Bad Deckenlampe", "Lamp23"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
// String msg3 = "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"Doris Bad Deckenlampe" + "\",\"Device\":\"" + "sonoff177" + "\",\"Power\":\"power1" + "\",\"Message\":\"2\"}";
// MqttClient.publish("cmnd/Haussteuerung/Licht", msg3);
break;
case R.id.buttonWandlampeBad:
msg = gson.toJson(new Licht(MainActivity.ID, "Doris Bad Wandlampe", "Lamp24"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
// String msg4 = "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"Doris Bad Wandlampe" + "\",\"Device\":\"" + "sonoff177" + "\",\"Power\":\"power2" + "\",\"Message\":\"2\"}";
// MqttClient.publish("cmnd/Haussteuerung/Licht", msg4);
break;
case R.id.buttonRollo1:
msg = gson.toJson(new Rollo(MainActivity.ID, "Alle Rollo", "Rollo1", 100));
MqttClient.publish("cmnd/Haussteuerung/Rollo", msg);
// String msg5 = "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"Alle Rollo" + "\",\"Device\":\"" + v.getTag().toString() + "\",\"Power\":\"SHUTTERPOSITION" + "\",\"Message\":\"100\"}";
// MqttClient.publish("cmnd/Haussteuerung/Rollo", msg5);
break;
case R.id.buttonRollo2:
msg = gson.toJson(new Rollo(MainActivity.ID, "Alle Rollo", "Rollo1", 50));
MqttClient.publish("cmnd/Haussteuerung/Rollo", msg);
// String msg6 = "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"Alle Rollo" + "\",\"Device\":\"" + v.getTag().toString() + "\",\"Power\":\"SHUTTERPOSITION" + "\",\"Message\":\"50\"}";
// MqttClient.publish("cmnd/Haussteuerung/Rollo", msg6);
break;
case R.id.buttonRollo3:
msg = gson.toJson(new Rollo(MainActivity.ID, "Alle Rollo", "Rollo1", 0));
MqttClient.publish("cmnd/Haussteuerung/Rollo", msg);
// String msg7 = "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"Alle Rollo" + "\",\"Device\":\"" + v.getTag().toString() + "\",\"Power\":\"SHUTTERPOSITION" + "\",\"Message\":\"0\"}";
// MqttClient.publish("cmnd/Haussteuerung/Rollo", msg7);
break;
case R.id.buttonRollo4:
msg = gson.toJson(new Rollo(MainActivity.ID, "Terrasse Rollo", "sonoff171", 100));
MqttClient.publish("cmnd/Haussteuerung/Rollo", msg);
// String msg8 = "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"Terrasse Rollo" + "\",\"Device\":\"" + v.getTag().toString() + "\",\"Power\":\"SHUTTERPOSITION" + "\",\"Message\":\"100\"}";
// MqttClient.publish("cmnd/Haussteuerung/Rollo", msg8);
break;
case R.id.buttonRollo5:
msg = gson.toJson(new Rollo(MainActivity.ID, "Terrasse Rollo", "sonoff171", 50));
MqttClient.publish("cmnd/Haussteuerung/Rollo", msg);
// String msg9 = "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"Terrasse Rollo" + "\",\"Device\":\"" + v.getTag().toString() + "\",\"Power\":\"SHUTTERPOSITION" + "\",\"Message\":\"50\"}";
// MqttClient.publish("cmnd/Haussteuerung/Rollo", msg9);
break;
case R.id.buttonRollo6:
msg = gson.toJson(new Rollo(MainActivity.ID, "Terrasse Rollo", "sonoff171", 0));
MqttClient.publish("cmnd/Haussteuerung/Rollo", msg);
// String msg10 = "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"Terrasse Rollo" + "\",\"Device\":\"" + v.getTag().toString() + "\",\"Power\":\"SHUTTERPOSITION" + "\",\"Message\":\"0\"}";
// MqttClient.publish("cmnd/Haussteuerung/Rollo", msg10);
break;
case R.id.buttonRollo7:
msg = gson.toJson(new Rollo(MainActivity.ID, "Rollo Fenster links", "sonoff172", 100));
MqttClient.publish("cmnd/Haussteuerung/Rollo", msg);
// String msg11 = "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"Rollo Fenster links" + "\",\"Device\":\"" + v.getTag().toString() + "\",\"Power\":\"SHUTTERPOSITION" + "\",\"Message\":\"100\"}";
// MqttClient.publish("cmnd/Haussteuerung/Rollo", msg11);
break;
case R.id.buttonRollo8:
msg = gson.toJson(new Rollo(MainActivity.ID, "Rollo Fenster links", "sonoff172", 50));
MqttClient.publish("cmnd/Haussteuerung/Rollo", msg);
// String msg12 = "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"Rollo Fenster links" + "\",\"Device\":\"" + v.getTag().toString() + "\",\"Power\":\"SHUTTERPOSITION" + "\",\"Message\":\"50\"}";
// MqttClient.publish("cmnd/Haussteuerung/Rollo", msg12);
break;
case R.id.buttonRollo9:
msg = gson.toJson(new Rollo(MainActivity.ID, "Rollo Fenster links", "sonoff172", 0));
MqttClient.publish("cmnd/Haussteuerung/Rollo", msg);
// String msg13 = "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"Rollo Fenster links" + "\",\"Device\":\"" + v.getTag().toString() + "\",\"Power\":\"SHUTTERPOSITION" + "\",\"Message\":\"0\"}";
// MqttClient.publish("cmnd/Haussteuerung/Rollo", msg13);
break;
case R.id.buttonRollo10:
msg = gson.toJson(new Rollo(MainActivity.ID, "Rollo Fenster rechts", "sonoff173", 100));
MqttClient.publish("cmnd/Haussteuerung/Rollo", msg);
// String msg14 = "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"Rollo Fenster rechts" + "\",\"Device\":\"" + v.getTag().toString() + "\",\"Power\":\"SHUTTERPOSITION" + "\",\"Message\":\"100\"}";
// MqttClient.publish("cmnd/Haussteuerung/Rollo", msg14);
break;
case R.id.buttonRollo11:
msg = gson.toJson(new Rollo(MainActivity.ID, "Rollo Fenster rechts", "sonoff173", 50));
MqttClient.publish("cmnd/Haussteuerung/Rollo", msg);
// String msg15 = "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"Rollo Fenster rechts" + "\",\"Device\":\"" + v.getTag().toString() + "\",\"Power\":\"SHUTTERPOSITION" + "\",\"Message\":\"50\"}";
// MqttClient.publish("cmnd/Haussteuerung/Rollo", msg15);
break;
case R.id.buttonRollo12:
msg = gson.toJson(new Rollo(MainActivity.ID, "Rollo Fenster rechts", "sonoff173", 0));
MqttClient.publish("cmnd/Haussteuerung/Rollo", msg);
// String msg16 = "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"Rollo Fenster rechts" + "\",\"Device\":\"" + v.getTag().toString() + "\",\"Power\":\"SHUTTERPOSITION" + "\",\"Message\":\"0\"}";
// MqttClient.publish("cmnd/Haussteuerung/Rollo", msg16);
break;
case R.id.buttonRollo13:
msg = gson.toJson(new Rollo(MainActivity.ID, "Bad Rollo", "sonoff174", 100));
MqttClient.publish("cmnd/Haussteuerung/Rollo", msg);
// String msg17 = "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"Bad Rollo" + "\",\"Device\":\"" + v.getTag().toString() + "\",\"Power\":\"SHUTTERPOSITION" + "\",\"Message\":\"100\"}";
// MqttClient.publish("cmnd/Haussteuerung/Rollo", msg17);
break;
case R.id.buttonRollo14:
msg = gson.toJson(new Rollo(MainActivity.ID, "Bad Rollo", "sonoff174", 50));
MqttClient.publish("cmnd/Haussteuerung/Rollo", msg);
// String msg18 = "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"Bad Rollo" + "\",\"Device\":\"" + v.getTag().toString() + "\",\"Power\":\"SHUTTERPOSITION" + "\",\"Message\":\"50\"}";
// MqttClient.publish("cmnd/Haussteuerung/Rollo", msg18);
break;
case R.id.buttonRollo15:
msg = gson.toJson(new Rollo(MainActivity.ID, "Bad Rollo", "sonoff174", 0));
MqttClient.publish("cmnd/Haussteuerung/Rollo", msg);
// String msg19 = "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"Bad Rollo" + "\",\"Device\":\"" + v.getTag().toString() + "\",\"Power\":\"SHUTTERPOSITION" + "\",\"Message\":\"0\"}";
// MqttClient.publish("cmnd/Haussteuerung/Rollo", msg19);
break;
}
}
@Override
protected void onPause() {
super.onPause();
pausedDorisLicht = true;
}
@Override
protected void onResume() {
super.onResume();
pausedDorisLicht = false;
}
@Override
protected void onStop() {
super.onStop();
pausedDorisLicht = true;
}
}
class Rollo {
@SerializedName("DeviceID")
private final String deviceId;
@SerializedName("Name")
private final String name;
@SerializedName("Device")
private final String device;
@SerializedName("Shutterposition")
private final int shutterposition;
public Rollo(String deviceId, String name, String device, int shutterposition) {
this.deviceId = deviceId;
this.name = name;
this.device = device;
this.shutterposition = shutterposition;
}
}

View File

@@ -0,0 +1,101 @@
package com.haussteuerung;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.widget.Button;
import android.widget.Toast;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import com.google.gson.Gson;
import com.ortiz.touchview.TouchImageView;
import java.io.File;
public class activityGlocke extends AppCompatActivity {
public static boolean pausedGlocke = true;
Gson gson = new Gson();
String msg;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
androidx.appcompat.app.ActionBar actionBar = getSupportActionBar();
assert actionBar != null;
actionBar.setBackgroundDrawable(AppCompatResources.getDrawable(getApplicationContext(), R.color.black));
pausedGlocke = false;
setContentView(R.layout.activity_glocke);
setTitle("Haussteuerung - Glocke");
TouchImageView fotoGlocke = findViewById(R.id.fotoGlocke);
Intent i = getIntent();
File file = new File(Environment.getExternalStorageDirectory().getPath() + "/Pictures/Haussteuerung/cam.jpg");
if (i.getExtras() != null) {
if (i.getExtras() != null && i.hasExtra("TimeFB")) {
file = new File(Environment.getExternalStorageDirectory().getPath() + "/Pictures/Haussteuerung/" + i.getStringExtra("TimeFB") + ".jpg");
Log.d("ZeitGlocke", i.getStringExtra("TimeFB"));
} else {
file = new File(Environment.getExternalStorageDirectory().getPath() + "/Pictures/Haussteuerung/cam.jpg");
}
}
if(file.exists()){
Bitmap myBitmap = BitmapFactory.decodeFile(file.getAbsolutePath());
Log.d("ImageView", file.getAbsolutePath());
fotoGlocke.setImageBitmap(myBitmap);
Log.d("Foto", "ImageView erfolgreich");
} else {
Log.d("Foto", "ImageView fehlgeschlagen");
Toast.makeText(this, "Laden des Fotos fehlgeschlagen", Toast.LENGTH_LONG).show();
}
Button buttonGlockeDoors = findViewById(R.id.buttonGlockeDoors);
buttonGlockeDoors.setOnClickListener(view -> {
msg = gson.toJson(new Licht(MainActivity.ID, "Gartentor", "Lamp10"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
msg = gson.toJson(new Licht(MainActivity.ID, "Eingangstuer", "Lamp11"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
});
Button buttonKamera = findViewById(R.id.buttonKamera);
buttonKamera.setOnClickListener(view -> {
String url = "https://webcam.klebl.info/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C&user=admin&password=Florian1";
Intent intentOne = new Intent(Intent.ACTION_VIEW);
intentOne.setData(Uri.parse(url));
startActivity(intentOne);
});
}
@Override
protected void onPause() {
super.onPause();
pausedGlocke = true;
}
@Override
protected void onResume() {
super.onResume();
pausedGlocke = false;
}
@Override
protected void onStop() {
super.onStop();
pausedGlocke = true;
}
}

View File

@@ -0,0 +1,240 @@
package com.haussteuerung;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.widget.TextView;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import java.util.Timer;
import java.util.TimerTask;
public class activityHaus extends AppCompatActivity {
public static boolean pausedHaus = true;
private TextView tv_Zustand1;
private TextView tv_Zustand2;
private TextView tv_Zustand3;
private TextView tv_Zustand4;
private TextView tv_Zustand5;
private TextView tv_Zustand6;
private TextView tv_Zustand7;
// private TextView tv_Zustand8;
private TextView tv_Zustand9;
private TextView tv_Zustand10;
private TextView tv_Zustand11;
private TextView tv_Zustand12;
private TextView tv_Zustand13;
private TextView tv_Zustand14;
private TextView tv_Zustand15;
private TextView tv_Zustand16;
private TextView tv_Zustand17;
private TextView tv_Zustand18;
final Handler myHandler = new Handler();
final Timer myTimer = new Timer();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
androidx.appcompat.app.ActionBar actionBar = getSupportActionBar();
assert actionBar != null;
actionBar.setBackgroundDrawable(AppCompatResources.getDrawable(getApplicationContext(), R.color.black));
pausedHaus = false;
setContentView(R.layout.activity_haus);
setTitle("Haussteuerung - Hausansicht");
tv_Zustand1 = findViewById(R.id.tv_Zustand1);
tv_Zustand2 = findViewById(R.id.tv_Zustand2);
tv_Zustand3 = findViewById(R.id.tv_Zustand3);
tv_Zustand4 = findViewById(R.id.tv_Zustand4);
tv_Zustand5 = findViewById(R.id.tv_Zustand5);
tv_Zustand6 = findViewById(R.id.tv_Zustand6);
tv_Zustand7 = findViewById(R.id.tv_Zustand7);
tv_Zustand9 = findViewById(R.id.tv_Zustand9);
tv_Zustand10 = findViewById(R.id.tv_Zustand10);
tv_Zustand11 = findViewById(R.id.tv_Zustand11);
tv_Zustand12 = findViewById(R.id.tv_Zustand12);
tv_Zustand13 = findViewById(R.id.tv_Zustand13);
tv_Zustand14 = findViewById(R.id.tv_Zustand14);
tv_Zustand15 = findViewById(R.id.tv_Zustand15);
tv_Zustand16 = findViewById(R.id.tv_Zustand16);
tv_Zustand17 = findViewById(R.id.tv_Zustand17);
tv_Zustand18 = findViewById(R.id.tv_Zustand18);
}
// Runnable method
final Runnable myRunnable = new Runnable() {
public void run() {
if (MqttClient.tv_Zustand1.equals("zu")) {
tv_Zustand1.setText(getResources().getString(R.string.geschlossen));
tv_Zustand1.setTextColor(Color.RED);
} else {
tv_Zustand1.setText(getResources().getString(R.string.geoeffnet));
tv_Zustand1.setTextColor(Color.GREEN);
}
if (MqttClient.tv_Zustand2.equals("zu")) {
tv_Zustand2.setText(getResources().getString(R.string.geschlossen));
tv_Zustand2.setTextColor(Color.RED);
} else {
tv_Zustand2.setText(getResources().getString(R.string.geoeffnet));
tv_Zustand2.setTextColor(Color.GREEN);
}
if (MqttClient.tv_Zustand3.equals("zu")) {
tv_Zustand3.setText(getResources().getString(R.string.geschlossen));
tv_Zustand3.setTextColor(Color.RED);
} else {
tv_Zustand3.setText(getResources().getString(R.string.geoeffnet));
tv_Zustand3.setTextColor(Color.GREEN);
}
if (MqttClient.tv_Zustand4.equals("zu")) {
tv_Zustand4.setText(getResources().getString(R.string.geschlossen));
tv_Zustand4.setTextColor(Color.RED);
} else {
tv_Zustand4.setText(getResources().getString(R.string.geoeffnet));
tv_Zustand4.setTextColor(Color.GREEN);
}
if (MqttClient.tv_Zustand5.equals("zu")) {
tv_Zustand5.setText(getResources().getString(R.string.geschlossen));
tv_Zustand5.setTextColor(Color.RED);
} else {
tv_Zustand5.setText(getResources().getString(R.string.geoeffnet));
tv_Zustand5.setTextColor(Color.GREEN);
}
if (MqttClient.tv_Zustand6.equals("zu")) {
tv_Zustand6.setText(getResources().getString(R.string.geschlossen));
tv_Zustand6.setTextColor(Color.RED);
} else {
tv_Zustand6.setText(getResources().getString(R.string.geoeffnet));
tv_Zustand6.setTextColor(Color.GREEN);
}
if (MqttClient.tv_Zustand7.equals("zu")) {
tv_Zustand7.setText(getResources().getString(R.string.geschlossen));
tv_Zustand7.setTextColor(Color.RED);
} else {
tv_Zustand7.setText(getResources().getString(R.string.geoeffnet));
tv_Zustand7.setTextColor(Color.GREEN);
}
if (MqttClient.tv_Zustand9.equals("zu")) {
tv_Zustand9.setText(getResources().getString(R.string.geschlossen));
tv_Zustand9.setTextColor(Color.RED);
} else {
tv_Zustand9.setText(getResources().getString(R.string.geoeffnet));
tv_Zustand9.setTextColor(Color.GREEN);
}
if (MqttClient.tv_Zustand10.equals("zu")) {
tv_Zustand10.setText(getResources().getString(R.string.geschlossen));
tv_Zustand10.setTextColor(Color.RED);
} else {
tv_Zustand10.setText(getResources().getString(R.string.geoeffnet));
tv_Zustand10.setTextColor(Color.GREEN);
}
if (MqttClient.tv_Zustand11.equals("zu")) {
tv_Zustand11.setText(getResources().getString(R.string.geschlossen));
tv_Zustand11.setTextColor(Color.RED);
} else {
tv_Zustand11.setText(getResources().getString(R.string.geoeffnet));
tv_Zustand11.setTextColor(Color.GREEN);
}
if (MqttClient.tv_Zustand12.equals("zu")) {
tv_Zustand12.setText(getResources().getString(R.string.geschlossen));
tv_Zustand12.setTextColor(Color.RED);
} else {
tv_Zustand12.setText(getResources().getString(R.string.geoeffnet));
tv_Zustand12.setTextColor(Color.GREEN);
}
if (MqttClient.tv_Zustand13.equals("zu")) {
tv_Zustand13.setText(getResources().getString(R.string.geschlossen));
tv_Zustand13.setTextColor(Color.RED);
} else {
tv_Zustand13.setText(getResources().getString(R.string.geoeffnet));
tv_Zustand13.setTextColor(Color.GREEN);
}
if (MqttClient.tv_Zustand14.equals("zu")) {
tv_Zustand14.setText(getResources().getString(R.string.geschlossen));
tv_Zustand14.setTextColor(Color.RED);
} else {
tv_Zustand14.setText(getResources().getString(R.string.geoeffnet));
tv_Zustand14.setTextColor(Color.GREEN);
}
if (MqttClient.tv_Zustand15.equals("zu")) {
tv_Zustand15.setText(getResources().getString(R.string.geschlossen));
tv_Zustand15.setTextColor(Color.RED);
} else {
tv_Zustand15.setText(getResources().getString(R.string.geoeffnet));
tv_Zustand15.setTextColor(Color.GREEN);
}
if (MqttClient.tv_Zustand16.equals("zu")) {
tv_Zustand16.setText(getResources().getString(R.string.geschlossen));
tv_Zustand16.setTextColor(Color.RED);
} else {
tv_Zustand16.setText(getResources().getString(R.string.geoeffnet));
tv_Zustand16.setTextColor(Color.GREEN);
}
if (MqttClient.tv_Zustand17.equals("zu")) {
tv_Zustand17.setText(getResources().getString(R.string.geschlossen));
tv_Zustand17.setTextColor(Color.RED);
} else {
tv_Zustand17.setText(getResources().getString(R.string.geoeffnet));
tv_Zustand17.setTextColor(Color.GREEN);
}
if (MqttClient.tv_Zustand18.equals("zu")) {
tv_Zustand18.setText(getResources().getString(R.string.geschlossen));
tv_Zustand18.setTextColor(Color.RED);
} else {
tv_Zustand18.setText(getResources().getString(R.string.geoeffnet));
tv_Zustand18.setTextColor(Color.GREEN);
} }
};
@Override
protected void onPause() {
super.onPause();
pausedHaus = true;
myTimer.cancel();
}
@Override
protected void onResume() {
super.onResume();
pausedHaus = false;
TimerTask myTask = new TimerTask() {
public void run() {
myHandler.post(myRunnable); // updateUI method
}
};
myTimer.schedule(myTask,0,1000); // TimerTask, delay, period
}
@Override
protected void onStop() {
super.onStop();
pausedHaus = true;
myTimer.cancel();
}
}

View File

@@ -0,0 +1,86 @@
package com.haussteuerung;
import android.os.Bundle;
import android.util.Log;
import android.view.MenuItem;
import androidx.activity.EdgeToEdge;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.navigation.NavigationBarView;
public class activityLWP extends AppCompatActivity implements NavigationBarView.OnItemSelectedListener {
public static boolean pausedLWP = true;
BottomNavigationView bottomNavigationView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Ändern der Statusbar-Farbe
androidx.appcompat.app.ActionBar actionBar = getSupportActionBar();
assert actionBar != null;
actionBar.setBackgroundDrawable(AppCompatResources.getDrawable(getApplicationContext(), R.drawable.gradient_titlebar));
pausedLWP = false;
setContentView(R.layout.activity_lwp);
setTitle("Haussteuerung - Wärmepumpe");
bottomNavigationView = findViewById(R.id.bottomNavigationView);
bottomNavigationView.setOnItemSelectedListener(this);
bottomNavigationView.setSelectedItemId(R.id.heizkoerper);
bottomNavigationView.setItemIconTintList(null);
}
FragmentWW fragmentWW = new FragmentWW();
FragmentHeizung fragmentHeizung = new FragmentHeizung();
FragmentHeizkoerper fragmentHeizkoerper = new FragmentHeizkoerper();
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
int itemId = item.getItemId();
if (itemId == R.id.warmwasser) {
getSupportFragmentManager().beginTransaction().replace(R.id.flFragment, fragmentWW).commit();
return true;
} else if (itemId == R.id.heizung) {
getSupportFragmentManager().beginTransaction().replace(R.id.flFragment, fragmentHeizung).commit();
return true;
} else if (itemId == R.id.heizkoerper) {
getSupportFragmentManager().beginTransaction().replace(R.id.flFragment, fragmentHeizkoerper).commit();
return true;
}
return false;
}
@Override
protected void onPause() {
super.onPause();
pausedLWP = true;
Log.d("LWPActivityPause", "true");
}
@Override
protected void onResume() {
super.onResume();
pausedLWP = false;
Log.d("LWPActivityPause", "false");
}
@Override
protected void onStop() {
super.onStop();
pausedLWP = true;
Log.d("LWPActivityPause", "true");
}
}

View File

@@ -0,0 +1,265 @@
package com.haussteuerung;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
public class activityLicht extends AppCompatActivity implements View.OnClickListener {
public static boolean pausedLicht = true;
private CheckBox checkWM1, checkWM2, checkWM3, checkWM4;
public static String nameTom = "";
public static String nameFlo = "";
public static String nameStefan = "";
public static String nameGlocke = "";
public static boolean checkedTom;
public static boolean checkedFlo;
public static boolean checkedStefan;
public static boolean checkedGlocke;
Gson gson = new Gson();
String msg;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
androidx.appcompat.app.ActionBar actionBar = getSupportActionBar();
assert actionBar != null;
actionBar.setBackgroundDrawable(AppCompatResources.getDrawable(getApplicationContext(), R.color.black));
pausedLicht = false;
setContentView(R.layout.activity_licht);
setTitle("Haussteuerung - Licht");
Button buttonLicht1 = findViewById(R.id.buttonLicht1);
Button buttonLicht2 = findViewById(R.id.buttonLicht2);
Button buttonLicht3 = findViewById(R.id.buttonLicht3);
Button buttonLicht4 = findViewById(R.id.buttonLicht4);
Button buttonLicht5 = findViewById(R.id.buttonLicht5);
Button buttonLicht6 = findViewById(R.id.buttonLicht6);
Button buttonLicht7 = findViewById(R.id.buttonLicht7);
Button buttonLicht8 = findViewById(R.id.buttonLicht8);
Button buttonLicht9 = findViewById(R.id.buttonLicht9);
Button buttonLicht10 = findViewById(R.id.buttonLicht10);
Button buttonLicht11 = findViewById(R.id.buttonLicht11);
Button buttonLicht12 = findViewById(R.id.buttonLicht12);
Button buttonLicht13 = findViewById(R.id.buttonLicht13);
Button buttonLicht14 = findViewById(R.id.buttonLicht14);
Button buttonLicht15 = findViewById(R.id.buttonLicht15);
Button buttonLicht16 = findViewById(R.id.buttonLicht16);
Button buttonLicht17 = findViewById(R.id.buttonLicht17);
Button buttonLicht18 = findViewById(R.id.buttonLicht18);
Button buttonLicht19 = findViewById(R.id.buttonLicht19);
Button buttonLicht20 = findViewById(R.id.buttonLicht20);
checkWM1 = findViewById(R.id.checkWM1);
checkWM2 = findViewById(R.id.checkWM2);
checkWM3 = findViewById(R.id.checkWM3);
checkWM4 = findViewById(R.id.checkWM4);
checkWM1.setChecked(checkedTom);
checkWM1.setOnClickListener(view -> {
if (checkWM1.isChecked()) {
// msg = gson.toJson(new Checkboxen(MainActivity.ID, "WMTom", true));
MqttClient.publish("cmnd/Haussteuerung/Waschmaschine/Tom", "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"WMTom\"" + ",\"Checkbox\":\"true\"}");
} else {
// msg = gson.toJson(new Checkboxen(MainActivity.ID, "WMTom", false));
MqttClient.publish("cmnd/Haussteuerung/Waschmaschine/Tom", "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"WMTom\"" + ",\"Checkbox\":\"false\"}");
}
// MqttClient.publish("cmnd/Haussteuerung/Waschmaschine/Tom", msg);
});
checkWM2.setChecked(checkedFlo);
checkWM2.setOnClickListener(view -> {
if (checkWM2.isChecked()) {
// msg = gson.toJson(new Checkboxen(MainActivity.ID, "WMFlo", true));
MqttClient.publish("cmnd/Haussteuerung/Waschmaschine/Flo", "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"WMFlo\"" + ",\"Checkbox\":\"true\"}");
} else {
// msg = gson.toJson(new Checkboxen(MainActivity.ID, "WMFlo", false));
MqttClient.publish("cmnd/Haussteuerung/Waschmaschine/Flo", "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"WMFlo\"" + ",\"Checkbox\":\"false\"}");
}
// MqttClient.publish("cmnd/Haussteuerung/Waschmaschine/Flo", msg);
});
checkWM3.setChecked(checkedStefan);
checkWM3.setOnClickListener(view -> {
if (checkWM3.isChecked()) {
// msg = gson.toJson(new Checkboxen(MainActivity.ID, "WMStefan", true));
MqttClient.publish("cmnd/Haussteuerung/Waschmaschine/Stefan", "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"WMStefan\"" + ",\"Checkbox\":\"true\"}");
} else {
// msg = gson.toJson(new Checkboxen(MainActivity.ID, "WMStefan", false));
MqttClient.publish("cmnd/Haussteuerung/Waschmaschine/Stefan", "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"WMStefan\"" + ",\"Checkbox\":\"false\"}");
}
// MqttClient.publish("cmnd/Haussteuerung/Waschmaschine/Stefan", msg);
});
checkWM4.setChecked(checkedGlocke);
checkWM4.setOnClickListener(view -> {
if (checkWM4.isChecked()) {
// msg = gson.toJson(new Checkboxen(MainActivity.ID, "Glocke", true));
MqttClient.publish("cmnd/Haussteuerung/Glocke", "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"Glocke\"" + ",\"Checkbox\":\"true\"}");
} else {
// msg = gson.toJson(new Checkboxen(MainActivity.ID, "Glocke", false));
MqttClient.publish("cmnd/Haussteuerung/Glocke", "{\"DeviceID\":\"" + MainActivity.ID + "\",\"Name\":\"Glocke\"" + ",\"Checkbox\":\"false\"}");
}
// MqttClient.publish("cmnd/Haussteuerung/Glocke", msg);
});
buttonLicht1.setOnClickListener(this);
buttonLicht2.setOnClickListener(this);
buttonLicht3.setOnClickListener(this);
buttonLicht4.setOnClickListener(this);
buttonLicht5.setOnClickListener(this);
buttonLicht6.setOnClickListener(this);
buttonLicht7.setOnClickListener(this);
buttonLicht8.setOnClickListener(this);
buttonLicht9.setOnClickListener(this);
buttonLicht10.setOnClickListener(this);
buttonLicht11.setOnClickListener(this);
buttonLicht12.setOnClickListener(this);
buttonLicht13.setOnClickListener(this);
buttonLicht14.setOnClickListener(this);
buttonLicht15.setOnClickListener(this);
buttonLicht16.setOnClickListener(this);
buttonLicht17.setOnClickListener(this);
buttonLicht18.setOnClickListener(this);
buttonLicht19.setOnClickListener(this);
buttonLicht20.setOnClickListener(this);
}
@SuppressLint("NonConstantResourceId")
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.buttonLicht1:
msg = gson.toJson(new Licht(MainActivity.ID, "Licht Tom Zimmer", "Lamp01"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
break;
case R.id.buttonLicht2:
msg = gson.toJson(new Licht(MainActivity.ID, "Licht Wohnzimmer", "Lamp02"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
break;
case R.id.buttonLicht3:
msg = gson.toJson(new Licht(MainActivity.ID, "Stehlampe WZ", "Lamp03"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
break;
case R.id.buttonLicht4:
msg = gson.toJson(new Licht(MainActivity.ID, "Licht Esszimmer", "Lamp04"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
break;
case R.id.buttonLicht5:
msg = gson.toJson(new Licht(MainActivity.ID, "Licht Küche", "Lamp05"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
break;
case R.id.buttonLicht6:
msg = gson.toJson(new Licht(MainActivity.ID, "Licht Gang", "Lamp06"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
break;
case R.id.buttonLicht7:
msg = gson.toJson(new Licht(MainActivity.ID, "Licht Stiegenhaus", "Lamp07"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
break;
case R.id.buttonLicht8:
msg = gson.toJson(new Licht(MainActivity.ID, "Licht Obergeschoss", "Lamp08"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
break;
case R.id.buttonLicht9:
msg = gson.toJson(new Licht(MainActivity.ID, "Licht Schlafzimmer", "Lamp09"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
break;
case R.id.buttonLicht10:
msg = gson.toJson(new Licht(MainActivity.ID, "Gartentor", "Lamp10"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
break;
case R.id.buttonLicht11:
msg = gson.toJson(new Licht(MainActivity.ID, "Eingangstuer", "Lamp11"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
break;
case R.id.buttonLicht12:
msg = gson.toJson(new Licht(MainActivity.ID, "Garagentor", "Lamp12"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
break;
case R.id.buttonLicht13:
msg = gson.toJson(new Licht(MainActivity.ID, "Nachtkastl Tom", "Lamp13"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
break;
case R.id.buttonLicht14:
msg = gson.toJson(new Licht(MainActivity.ID, "Licht Obergeschoss", "Lamp14"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
break;
case R.id.buttonLicht15:
msg = gson.toJson(new Licht(MainActivity.ID, "Licht Obergeschoss", "Lamp15"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
break;
case R.id.buttonLicht16:
msg = gson.toJson(new Licht(MainActivity.ID, "vuDuoSZ", "Lamp16"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
break;
case R.id.buttonLicht17:
msg = gson.toJson(new Licht(MainActivity.ID, "Zirkulationspumpe", "Lamp17"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
break;
case R.id.buttonLicht18:
msg = gson.toJson(new Licht(MainActivity.ID, "PCFlo", "Lamp18"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
break;
case R.id.buttonLicht19:
Intent iSky = new Intent(activityLicht.this, activitySky.class);
startActivity(iSky);
break;
case R.id.buttonLicht20:
msg = gson.toJson(new Licht(MainActivity.ID, "Licht Flo", "Lamp20"));
MqttClient.publish("cmnd/Haussteuerung/Licht", msg);
break;
}
}
@Override
protected void onPause() {
super.onPause();
pausedLicht = true;
Log.d("LichtActivityPause", "true");
}
@Override
protected void onResume() {
super.onResume();
pausedLicht = false;
Log.d("LichtActivityPause", "false");
}
@Override
protected void onStop() {
super.onStop();
pausedLicht = true;
Log.d("LichtActivityPause", "true");
}
}
class Checkboxen {
@SerializedName("DeviceID")
private final String deviceId;
@SerializedName("Name")
private final String name;
@SerializedName("Checkbox")
private final boolean checkbox;
public Checkboxen(String deviceId, String name, boolean checkbox) {
this.deviceId = deviceId;
this.name = name;
this.checkbox = checkbox;
}
}

View File

@@ -0,0 +1,72 @@
package com.haussteuerung;
import android.os.Bundle;
import android.os.Handler;
import android.widget.TextView;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import java.util.Timer;
import java.util.TimerTask;
public class activityLog extends AppCompatActivity {
public static boolean pausedLog = true;
private TextView textLog;
final Handler myHandler = new Handler();
final Timer myTimer = new Timer();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
androidx.appcompat.app.ActionBar actionBar = getSupportActionBar();
assert actionBar != null;
actionBar.setBackgroundDrawable(AppCompatResources.getDrawable(getApplicationContext(), R.color.black));
pausedLog = false;
setContentView(R.layout.activity_log);
setTitle("Haussteuerung - Log");
textLog = findViewById(R.id.textLog);
}
// Runnable method
final Runnable myRunnable = new Runnable() {
public void run() {
textLog.setText(MqttClient.logContent);
}
};
@Override
protected void onPause() {
super.onPause();
pausedLog = true;
myTimer.cancel();
}
@Override
protected void onResume() {
super.onResume();
pausedLog = false;
TimerTask myTask = new TimerTask() {
public void run() {
myHandler.post(myRunnable); // updateUI method
}
};
myTimer.schedule(myTask,0,1000); // TimerTask, delay, period
}
@Override
protected void onStop() {
super.onStop();
pausedLog = true;
myTimer.cancel();
}
}

View File

@@ -0,0 +1,127 @@
package com.haussteuerung;
import android.app.TimePickerDialog;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.TimePicker;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import java.time.LocalTime;
import java.util.Locale;
public class activitySky extends AppCompatActivity {
private Button buttonSkyZeit;
private CheckBox checkSky;
public static String zeitSky = "", zeitSkyMqtt = "";
public static boolean isChecked = false, pausedSky = true;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
androidx.appcompat.app.ActionBar actionBar = getSupportActionBar();
assert actionBar != null;
actionBar.setBackgroundDrawable(AppCompatResources.getDrawable(getApplicationContext(), R.color.black));
pausedSky = false;
setContentView(R.layout.activity_sky);
setTitle("Haussteuerung - Sky");
checkSky = findViewById(R.id.checkSky);
buttonSkyZeit = findViewById(R.id.buttonSkyZeit);
Button buttonSkySend = findViewById(R.id.buttonSkySend);
buttonSkyZeit.setText(zeitSkyMqtt);
checkSky.setChecked(isChecked);
buttonSkyZeit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
timePickerDialog(buttonSkyZeit);
}
});
buttonSkySend.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Gson gson = new Gson();
String msg;
if (checkSky.isChecked()) {
msg = gson.toJson(new Sky(MainActivity.ID, buttonSkyZeit.getText().toString(), true));
MqttClient.publish("cmnd/Haussteuerung/Sky", msg);
} else if (!checkSky.isChecked()) {
msg = gson.toJson(new Sky(MainActivity.ID, buttonSkyZeit.getText().toString(), false));
MqttClient.publish("cmnd/Haussteuerung/Sky", msg);
}
finish();
}
});
Log.d("ActivitySky","Created");
} public void timePickerDialog(Button button) {
LocalTime localTime = LocalTime.parse(button.getText());
int hour = localTime.getHour();
int minute = localTime.getMinute();
TimePickerDialog.OnTimeSetListener onTimeSetListener = new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker timePicker, int selectedHour, int selectedMinute) {
button.setText(String.format(Locale.getDefault(), "%02d:%02d", selectedHour, selectedMinute));
}
};
TimePickerDialog timePickerDialog = new TimePickerDialog(this, onTimeSetListener, hour, minute, true);
timePickerDialog.show();
}
@Override
protected void onPause() {
super.onPause();
pausedSky = true;
// Log.d("TimerSkyActivity", "Canceled");
Log.d("ActivitySky","Paused");
}
@Override
protected void onResume() {
super.onResume();
pausedSky = false;
buttonSkyZeit.setText(zeitSkyMqtt);
checkSky.setChecked(isChecked);
Log.d("ActivitySky","Resumed");
}
@Override
protected void onStop() {
super.onStop();
pausedSky = true;
Log.d("ActivitySky","Stopped");
}
}
class Sky {
@SerializedName("DeviceID")
private final String deviceId;
@SerializedName("Datum")
private final String datum;
@SerializedName("CheckboxSky")
private final boolean checkboxSky;
public Sky(String deviceId, String datum, boolean checkboxSky) {
this.deviceId = deviceId;
this.datum = datum;
this.checkboxSky = checkboxSky;
}
}

View File

@@ -0,0 +1,24 @@
package com.haussteuerung;
import android.os.Bundle;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
public class noConnection extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EdgeToEdge.enable(this);
setContentView(R.layout.activity_no_connection);
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.activityChristmas), (v, insets) -> {
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
return insets;
});
}
}

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#AEEA00"
android:endColor="#64DD17"
android:angle="270" />
<corners android:radius="10dp"/>
</shape>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#E91E63"
android:endColor="#D50000"
android:angle="270" />
<corners android:radius="10dp"/>
</shape>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?><!--
Background for widgets to make the rounded corners based on the
appWidgetRadius attribute value
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="?attr/appWidgetRadius" />
<solid android:color="?android:attr/colorBackground" />
</shape>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?><!--
Background for views inside widgets to make the rounded corners based on the
appWidgetInnerRadius attribute value
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="?attr/appWidgetInnerRadius" />
<solid android:color="?android:attr/colorAccent" />
</shape>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/gradient_pressed"/>
<item android:state_enabled="true" android:drawable="@drawable/gradient"/>
</selector>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Disable background -->
<item android:state_enabled="false"
android:drawable="@drawable/grey_button_color"/>
<!-- Enabled background -->
<item android:state_pressed="true"
android:drawable="@drawable/gradient_pressed"/>
<item android:state_enabled="true"
android:drawable="@drawable/gradient"/>
</selector>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/gradient_pressed"/>
<item android:state_enabled="true">
<shape>
<gradient
android:startColor="@color/blue"
android:endColor="@color/blue"
android:angle="270" />
<corners android:radius="10dp"/>
</shape>
</item>
</selector>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/gradient_pressed"/>
<item android:state_enabled="true">
<shape>
<gradient
android:startColor="@color/red"
android:centerColor="@color/green"
android:endColor="@color/blue"
android:angle="270" />
<corners android:radius="10dp"/>
</shape>
</item>
</selector>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/gradient_pressed"/>
<item android:state_enabled="true">
<shape>
<gradient
android:startColor="@color/green"
android:endColor="@color/green"
android:angle="270" />
<corners android:radius="10dp"/>
</shape>
</item>
</selector>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/gradient_pressed"/>
<item android:state_enabled="true">
<shape>
<gradient
android:startColor="@color/lightblue"
android:endColor="@color/lightblue"
android:angle="270" />
<corners android:radius="10dp"/>
</shape>
</item>
</selector>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/gradient_pressed"/>
<item android:state_enabled="true">
<shape>
<gradient
android:startColor="@color/purple"
android:endColor="@color/purple"
android:angle="270" />
<corners android:radius="10dp"/>
</shape>
</item>
</selector>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/gradient_pressed"/>
<item android:state_enabled="true">
<shape>
<gradient
android:startColor="@color/red"
android:endColor="@color/red"
android:angle="270" />
<corners android:radius="10dp"/>
</shape>
</item>
</selector>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/gradient_pressed"/>
<item android:state_enabled="true">
<shape>
<gradient
android:startColor="@color/white"
android:endColor="@color/white"
android:angle="270" />
<corners android:radius="10dp"/>
</shape>
</item>
</selector>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/gradient_pressed"/>
<item android:state_enabled="true">
<shape>
<gradient
android:startColor="@color/yellow"
android:endColor="@color/yellow"
android:angle="270" />
<corners android:radius="10dp"/>
</shape>
</item>
</selector>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#36D1DC"
android:endColor="#5B86E5"
android:angle="270" />
<corners android:radius="10dp"/>
</shape>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#FF9800"
android:endColor="#F44336"
android:angle="270" />
<corners android:radius="10dp"/>
</shape>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#36D1DC"
android:endColor="#5B86E5"
android:angle="270" />
</shape>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#949494"
android:endColor="#949494"
android:angle="270" />
<corners android:radius="10dp"/>
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>

View File

@@ -0,0 +1,30 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#000000"/>
<corners android:bottomLeftRadius="10dp" android:bottomRightRadius="10dp"/>
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@@ -0,0 +1,134 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/activityChristmas"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
tools:context=".activityChristmas">
<NumberPicker
android:id="@+id/picker"
android:layout_width="0dp"
android:layout_height="350dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:theme="@style/NumberPickerChristmas"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonColor1"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:background="@drawable/christmas_red"
app:layout_constraintEnd_toStartOf="@+id/buttonColor2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/picker"
tools:ignore="SpeakableTextPresentCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonColor2"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:background="@drawable/christmas_yellow"
app:layout_constraintEnd_toStartOf="@+id/buttonColor3"
app:layout_constraintStart_toEndOf="@+id/buttonColor1"
app:layout_constraintTop_toBottomOf="@+id/picker"
tools:ignore="SpeakableTextPresentCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonColor3"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:background="@drawable/christmas_green"
app:layout_constraintEnd_toStartOf="@+id/buttonColor4"
app:layout_constraintStart_toEndOf="@+id/buttonColor2"
app:layout_constraintTop_toBottomOf="@+id/picker"
tools:ignore="SpeakableTextPresentCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonColor4"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/christmas_lightblue"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonColor3"
app:layout_constraintTop_toBottomOf="@+id/picker"
tools:ignore="SpeakableTextPresentCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonColor5"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:background="@drawable/christmas_blue"
app:layout_constraintEnd_toStartOf="@+id/buttonColor6"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonColor1"
tools:ignore="SpeakableTextPresentCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonColor6"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:background="@drawable/christmas_purple"
app:layout_constraintEnd_toStartOf="@+id/buttonColor7"
app:layout_constraintStart_toEndOf="@+id/buttonColor5"
app:layout_constraintTop_toBottomOf="@+id/buttonColor2"
tools:ignore="SpeakableTextPresentCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonColor7"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:background="@drawable/christmas_white"
app:layout_constraintEnd_toStartOf="@+id/buttonColor8"
app:layout_constraintStart_toEndOf="@+id/buttonColor6"
app:layout_constraintTop_toBottomOf="@+id/buttonColor3"
tools:ignore="SpeakableTextPresentCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonColor8"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/christmas_changing"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonColor7"
app:layout_constraintTop_toBottomOf="@+id/buttonColor4" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonPower"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_marginStart="50dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="50dp"
android:text="@string/ein_aus"
android:background="@drawable/button_text_color"
android:textColor="@color/white"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonColor5" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,233 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/activity_doris"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
tools:context=".activityDoris">
<androidx.cardview.widget.CardView
android:id="@+id/cardviewDorisOben"
android:layout_width="match_parent"
android:layout_height="210dp"
android:layout_marginStart="10dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="10dp"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<CheckBox
android:id="@+id/checkBlutdruck"
android:layout_width="0dp"
android:layout_height="90dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:text="@string/blutdruck"
android:textColor="@color/black"
android:textSize="23sp"
app:layout_constraintEnd_toStartOf="@+id/zeitBlutdruck"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/zeitBlutdruck"
android:layout_width="0dp"
android:layout_height="90dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_ww"
android:enabled="false"
android:textColor="@color/white"
android:textSize="30sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/checkBlutdruck"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="DuplicateSpeakableTextCheck,SpeakableTextPresentCheck" />
<TextView
android:id="@+id/tvSYS"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_marginTop="35dp"
android:enabled="false"
android:gravity="center"
android:text="@string/sys"
android:textColor="@color/black"
android:textSize="28sp"
app:layout_constraintEnd_toStartOf="@+id/textSYS"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/checkBlutdruck" />
<EditText
android:id="@+id/textSYS"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="25dp"
android:autofillHints="120"
android:backgroundTint="@color/dark_grey"
android:ems="10"
android:enabled="false"
android:hint="@string/_120"
android:inputType="phone"
android:textColor="@color/black"
android:textColorHint="@color/dark_grey"
android:textSize="30sp"
android:visibility="visible"
app:layout_constraintEnd_toStartOf="@+id/tvDIA"
app:layout_constraintStart_toEndOf="@+id/tvSYS"
app:layout_constraintTop_toBottomOf="@+id/checkBlutdruck"
tools:ignore="TextContrastCheck,DuplicateSpeakableTextCheck" />
<TextView
android:id="@+id/tvDIA"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_marginTop="35dp"
android:enabled="false"
android:gravity="center"
android:text="@string/dia"
android:textColor="@color/black"
android:textSize="28sp"
app:layout_constraintEnd_toStartOf="@+id/textDIA"
app:layout_constraintStart_toEndOf="@+id/textSYS"
app:layout_constraintTop_toBottomOf="@+id/checkBlutdruck" />
<EditText
android:id="@+id/textDIA"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="25dp"
android:layout_marginEnd="20dp"
android:autofillHints="80"
android:backgroundTint="@color/dark_grey"
android:ems="10"
android:enabled="false"
android:hint="@string/_80"
android:inputType="phone"
android:textColor="@color/black"
android:textColorHint="@color/dark_grey"
android:textSize="30sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/tvDIA"
app:layout_constraintTop_toBottomOf="@+id/zeitBlutdruck"
tools:ignore="TextContrastCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/cardviewDorisUnten"
android:layout_width="match_parent"
android:layout_height="220dp"
android:layout_marginStart="10dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="10dp"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cardviewDorisOben"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/zeitFiebertemp"
android:layout_width="0dp"
android:layout_height="90dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_ww"
android:enabled="false"
android:textColor="@color/white"
android:textSize="30sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/checkFiebertemp"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="SpeakableTextPresentCheck" />
<TextView
android:id="@+id/tvFiebertemp"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_marginStart="10dp"
android:layout_marginTop="30dp"
android:enabled="false"
android:gravity="center"
android:text="@string/fiebertemp"
android:textColor="@color/black"
android:textSize="25sp"
app:layout_constraintEnd_toStartOf="@+id/textFiebertemp"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/checkFiebertemp" />
<EditText
android:id="@+id/textFiebertemp"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="20dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="20dp"
android:autofillHints="140"
android:backgroundTint="@color/dark_grey"
android:ems="10"
android:enabled="false"
android:hint="@string/_35"
android:inputType="phone"
android:textColor="@color/black"
android:textColorHint="@color/dark_grey"
android:textSize="30sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/tvFiebertemp"
app:layout_constraintTop_toBottomOf="@+id/checkFiebertemp"
tools:ignore="TextContrastCheck" />
<CheckBox
android:id="@+id/checkFiebertemp"
android:layout_width="0dp"
android:layout_height="90dp"
android:layout_marginStart="10dp"
android:layout_marginTop="15dp"
android:text="@string/fiebertemp"
android:textColor="@color/black"
android:textSize="23sp"
app:layout_constraintEnd_toStartOf="@+id/zeitFiebertemp"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonSend"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="20dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_text_color"
android:text="@string/absenden"
android:textColor="@color/white"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cardviewDorisUnten"
tools:ignore="TextContrastCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,315 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/activity_doris_licht"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
tools:context=".activityDorisLicht"
tools:layout_editor_absoluteX="-159dp"
tools:layout_editor_absoluteY="-11dp">
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonRollo7"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/button_text_color"
android:tag="sonoff172"
android:text="@string/fenster_links_auf"
android:textColor="#FFFFFF"
android:textSize="13sp"
app:layout_constraintEnd_toStartOf="@+id/buttonRollo8"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonRollo4"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonRollo8"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:background="@drawable/button_text_color"
android:tag="sonoff172"
android:text="@string/fenster_links_50"
android:textColor="#FFFFFF"
android:textSize="13sp"
app:layout_constraintEnd_toStartOf="@+id/buttonRollo9"
app:layout_constraintStart_toEndOf="@+id/buttonRollo7"
app:layout_constraintTop_toBottomOf="@+id/buttonRollo5"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonRollo9"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/button_text_color"
android:tag="sonoff172"
android:text="@string/fenster_links_zu"
android:textColor="#FFFFFF"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonRollo8"
app:layout_constraintTop_toBottomOf="@+id/buttonRollo6"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonRollo4"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/button_text_color"
android:tag="sonoff171"
android:text="@string/terrasse_rollo_auf"
android:textColor="#FFFFFF"
android:textSize="13sp"
app:layout_constraintEnd_toStartOf="@+id/buttonRollo5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonRollo1"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonRollo5"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:background="@drawable/button_text_color"
android:tag="sonoff171"
android:text="@string/terrasse_rollo_50"
android:textColor="#FFFFFF"
android:textSize="13sp"
app:layout_constraintEnd_toStartOf="@+id/buttonRollo6"
app:layout_constraintStart_toEndOf="@+id/buttonRollo4"
app:layout_constraintTop_toBottomOf="@+id/buttonRollo2"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonRollo6"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/button_text_color"
android:tag="sonoff171"
android:text="@string/terrasse_rollo_zu"
android:textColor="#FFFFFF"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonRollo5"
app:layout_constraintTop_toBottomOf="@+id/buttonRollo3"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonDeckenlampe"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="10dp"
android:background="@drawable/button_text_color"
android:tag="sonoff178"
android:text="@string/deckenlampe"
android:textColor="#FFFFFF"
android:textSize="13sp"
app:layout_constraintEnd_toStartOf="@+id/buttonStehlampe"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonStehlampe"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_text_color"
android:tag="sonoff170"
android:text="@string/stehlampe"
android:textColor="#FFFFFF"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonDeckenlampe"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonDeckenlampeBad"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/button_text_color"
android:text="@string/bad_deckenlampe"
android:textColor="#FFFFFF"
android:textSize="13sp"
app:layout_constraintEnd_toStartOf="@+id/buttonWandlampeBad"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonDeckenlampe"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonWandlampeBad"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_text_color"
android:text="@string/bad_wandlampe"
android:textColor="#FFFFFF"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonDeckenlampeBad"
app:layout_constraintTop_toBottomOf="@+id/buttonStehlampe"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonRollo1"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/button_text_color"
android:tag="Rollo1"
android:text="@string/alle_rollo_auf"
android:textColor="#FFFFFF"
android:textSize="13sp"
app:layout_constraintEnd_toStartOf="@+id/buttonRollo2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonDeckenlampeBad"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonRollo3"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/button_text_color"
android:tag="Rollo1"
android:text="@string/alle_rollo_zu"
android:textColor="#FFFFFF"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonRollo2"
app:layout_constraintTop_toBottomOf="@+id/buttonWandlampeBad"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonRollo2"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:background="@drawable/button_text_color"
android:tag="Rollo1"
android:text="@string/alle_rollo_50"
android:textColor="#FFFFFF"
android:textSize="13sp"
app:layout_constraintEnd_toStartOf="@+id/buttonRollo3"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toEndOf="@+id/buttonRollo1"
app:layout_constraintTop_toBottomOf="@+id/buttonDeckenlampeBad"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonRollo10"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/button_text_color"
android:tag="sonoff173"
android:text="@string/fenster_rechts_auf"
android:textColor="#FFFFFF"
android:textSize="13sp"
app:layout_constraintEnd_toStartOf="@+id/buttonRollo11"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonRollo7" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonRollo12"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/button_text_color"
android:tag="sonoff173"
android:text="@string/fenster_rechts_zu"
android:textColor="#FFFFFF"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonRollo11"
app:layout_constraintTop_toBottomOf="@+id/buttonRollo9"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonRollo11"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:background="@drawable/button_text_color"
android:tag="sonoff173"
android:text="@string/fenster_rechts_50"
android:textColor="#FFFFFF"
android:textSize="13sp"
app:layout_constraintEnd_toStartOf="@+id/buttonRollo12"
app:layout_constraintStart_toEndOf="@+id/buttonRollo10"
app:layout_constraintTop_toBottomOf="@+id/buttonRollo8" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonRollo13"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/button_text_color"
android:tag="sonoff174"
android:text="@string/bad_rollo_auf"
android:textColor="#FFFFFF"
android:textSize="13sp"
app:layout_constraintEnd_toStartOf="@+id/buttonRollo14"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonRollo10" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonRollo15"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/button_text_color"
android:tag="sonoff174"
android:text="@string/bad_rollo_zu"
android:textColor="#FFFFFF"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonRollo14"
app:layout_constraintTop_toBottomOf="@+id/buttonRollo12" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonRollo14"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:background="@drawable/button_text_color"
android:tag="sonoff174"
android:text="@string/bad_rollo_50"
android:textColor="#FFFFFF"
android:textSize="13sp"
app:layout_constraintEnd_toStartOf="@+id/buttonRollo15"
app:layout_constraintStart_toEndOf="@+id/buttonRollo13"
app:layout_constraintTop_toBottomOf="@+id/buttonRollo10" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/fileDownload"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
tools:context=".FileDownload">
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/button_Install"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_marginStart="80dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="80dp"
android:background="@drawable/alarm_true"
android:text="@string/install"
android:textColor="#FFFFFF"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/txt_changelog"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:layout_marginBottom="290dp"
android:textColor="#FFFFFF"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txt_status" />
<TextView
android:id="@+id/txt_status"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_marginStart="20dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="20dp"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/button_Install" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/activityGlocke"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
tools:context=".activityGlocke">
<com.ortiz.touchview.TouchImageView
android:id="@+id/fotoGlocke"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="20dp"
app:layout_constraintBottom_toTopOf="@+id/buttonKamera"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonGlockeDoors"
android:layout_width="0dp"
android:layout_height="75dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="20dp"
android:background="@drawable/button_text_color"
android:text="@string/t_ren_ffnen"
android:textColor="#FFFFFF"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/buttonKamera"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonKamera"
android:layout_width="0dp"
android:layout_height="75dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="20dp"
android:background="@drawable/button_text_color"
android:text="@string/kamera"
android:textColor="#FFFFFF"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonGlockeDoors"
tools:ignore="TextContrastCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,421 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/activityHaus"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
tools:context=".activityHaus">
<TextView
android:id="@+id/tv_Et"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:text="@string/eingangstuer"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_Gt"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:text="@string/garagetuer"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_Et" />
<TextView
android:id="@+id/tv_Kt"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:text="@string/kellertuer"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_Gt" />
<TextView
android:id="@+id/tv_TTDoris"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:text="@string/terrassentuer_doris"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_Kt" />
<TextView
android:id="@+id/tv_FLDoris"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="20dp"
android:layout_marginTop="40dp"
android:text="@string/fenster_links_doris"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_TTDoris" />
<TextView
android:id="@+id/tv_FRDoris"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:text="@string/fenster_rechts_doris"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_FLDoris" />
<TextView
android:id="@+id/tv_FBDoris"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:text="@string/fenster_bad_doris"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_FRDoris" />
<TextView
android:id="@+id/tv_FWz"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:text="@string/fenster_wohnzimmer"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_FBDoris" />
<TextView
android:id="@+id/tv_FEz"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:text="@string/fenster_esszimmer"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_FWz" />
<TextView
android:id="@+id/tv_FEK"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:text="@string/fenster_essplatz_kueche"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_FEz" />
<TextView
android:id="@+id/tv_FKueche"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:text="@string/fenster_kueche"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_FEK" />
<TextView
android:id="@+id/tv_FVz"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:text="@string/fenster_garderobe"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_FKueche" />
<TextView
android:id="@+id/tv_FWC"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:text="@string/fenster_wc"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_FVz" />
<TextView
android:id="@+id/tv_FDb"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:text="@string/fenster_dachboden"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_FWC" />
<TextView
android:id="@+id/tv_FFlo"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:text="@string/fenster_flo"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_FDb" />
<TextView
android:id="@+id/tv_FStefan"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:text="@string/fenster_stefan"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_FFlo" />
<TextView
android:id="@+id/tv_FBad"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:text="@string/fenster_bad"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_FStefan" />
<TextView
android:id="@+id/tv_Zustand1"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:text="@string/geschlossen"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_Zustand2"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:text="@string/geschlossen"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_Zustand1" />
<TextView
android:id="@+id/tv_Zustand3"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:text="@string/geschlossen"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_Zustand2" />
<TextView
android:id="@+id/tv_Zustand4"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:text="@string/geschlossen"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_Zustand3" />
<TextView
android:id="@+id/tv_Zustand5"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="40dp"
android:layout_marginEnd="20dp"
android:text="@string/geschlossen"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_Zustand4" />
<TextView
android:id="@+id/tv_Zustand6"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:text="@string/geschlossen"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_Zustand5" />
<TextView
android:id="@+id/tv_Zustand7"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:text="@string/geschlossen"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_Zustand6" />
<TextView
android:id="@+id/tv_Zustand9"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:text="@string/geschlossen"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_Zustand7" />
<TextView
android:id="@+id/tv_Zustand10"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:text="@string/geschlossen"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_Zustand9" />
<TextView
android:id="@+id/tv_Zustand11"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:text="@string/geschlossen"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_Zustand10" />
<TextView
android:id="@+id/tv_Zustand12"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:text="@string/geschlossen"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_Zustand11" />
<TextView
android:id="@+id/tv_Zustand13"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:text="@string/geschlossen"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_Zustand12" />
<TextView
android:id="@+id/tv_Zustand14"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:text="@string/geschlossen"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_Zustand13" />
<TextView
android:id="@+id/tv_Zustand15"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:text="@string/geschlossen"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_Zustand14" />
<TextView
android:id="@+id/tv_Zustand16"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:text="@string/geschlossen"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_Zustand15" />
<TextView
android:id="@+id/tv_Zustand17"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:text="@string/geschlossen"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_Zustand16" />
<TextView
android:id="@+id/tv_Zustand18"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:text="@string/geschlossen"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_Zustand17" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,408 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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"
android:backgroundTint="#FFFFFF">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/activityLicht"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#000000"
tools:context=".activityLicht">
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLicht1"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="20dp"
android:background="@drawable/button_text_color"
android:tag="Lamp1"
android:text="@string/tom"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@+id/buttonLicht2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLicht2"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_text_color"
android:tag="Lamp2"
android:text="@string/wohnzimmer"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonLicht1"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLicht3"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:background="@drawable/button_text_color"
android:tag="sonoff181"
android:text="@string/stehlampe_wz"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@+id/buttonLicht4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonLicht1"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLicht4"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_text_color"
android:tag="Lamp3"
android:text="@string/esszimmer"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonLicht3"
app:layout_constraintTop_toBottomOf="@+id/buttonLicht2"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLicht5"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:background="@drawable/button_text_color"
android:tag="Lamp4"
android:text="@string/k_che"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@+id/buttonLicht6"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonLicht3"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLicht6"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_text_color"
android:tag="Lamp5"
android:text="@string/gang"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonLicht5"
app:layout_constraintTop_toBottomOf="@+id/buttonLicht4"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLicht7"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:background="@drawable/button_text_color"
android:tag="Lamp6"
android:text="@string/stiegenhaus"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@+id/buttonLicht8"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonLicht5"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLicht8"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_text_color"
android:tag="Lamp7"
android:text="@string/obergeschoss"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonLicht7"
app:layout_constraintTop_toBottomOf="@+id/buttonLicht6"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLicht9"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:background="@drawable/button_text_color"
android:tag="Lamp8"
android:text="@string/schlafzimmer"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@+id/buttonLicht10"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonLicht7"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLicht10"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_text_color"
android:tag="Lamp9"
android:text="@string/gartentor"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonLicht9"
app:layout_constraintTop_toBottomOf="@+id/buttonLicht8"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLicht11"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:background="@drawable/button_text_color"
android:tag="Lamp10"
android:text="@string/haust_r"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@+id/buttonLicht12"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonLicht9" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLicht12"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_text_color"
android:tag="Lamp11"
android:text="@string/garage"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonLicht11"
app:layout_constraintTop_toBottomOf="@+id/buttonLicht10" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLicht13"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:background="@drawable/button_text_color"
android:tag="Lamp12"
android:text="@string/nachtkastl_tom"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@+id/buttonLicht14"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonLicht11" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLicht14"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_text_color"
android:tag="Lamp13"
android:text="@string/vuduowz_on"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonLicht13"
app:layout_constraintTop_toBottomOf="@+id/buttonLicht12" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLicht15"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:background="@drawable/button_text_color"
android:tag="Lamp14"
android:text="@string/glocke"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@+id/buttonLicht16"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonLicht13" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLicht16"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_text_color"
android:tag="Lamp15"
android:text="@string/vuduosz_on"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonLicht15"
app:layout_constraintTop_toBottomOf="@+id/buttonLicht14"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLicht17"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:background="@drawable/button_text_color"
android:text="@string/zirkulationspumpe"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@+id/buttonLicht18"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonLicht15" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLicht18"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_text_color"
android:text="@string/pc_flo"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonLicht17"
app:layout_constraintTop_toBottomOf="@+id/buttonLicht16" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLicht19"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:background="@drawable/button_text_color"
android:text="@string/skyq"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@+id/buttonLicht20"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonLicht17" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLicht20"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_text_color"
android:tag="sonoff241"
android:text="@string/licht_flo"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonLicht19"
app:layout_constraintTop_toBottomOf="@+id/buttonLicht18"
tools:ignore="TextContrastCheck" />
<CheckBox
android:id="@+id/checkWM1"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:text="@string/wm_tom"
android:textColor="#FFFFFF"
android:textSize="18sp"
app:layout_constraintEnd_toStartOf="@+id/checkWM4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonLicht19" />
<CheckBox
android:id="@+id/checkWM2"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="100dp"
android:text="@string/wm_flo"
android:textColor="#FFFFFF"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/checkWM1" />
<CheckBox
android:id="@+id/checkWM3"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="150dp"
android:text="@string/wm_stefan"
android:textColor="#FFFFFF"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/checkWM2" />
<CheckBox
android:id="@+id/checkWM4"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:text="@string/glocke"
android:textColor="#FFFFFF"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/checkWM1"
app:layout_constraintTop_toBottomOf="@+id/buttonLicht20" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activityLog"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
android:fillViewport="true"
android:scrollbars="vertical">
<TextView
android:id="@+id/textLog"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:scrollbars="vertical"
android:textColor="#FFFFFF"
android:textSize="12sp" />
</ScrollView>

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/activityLWP"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activityLWP">
<FrameLayout
android:id="@+id/flFragment"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/bottomNavigationView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottomNavigationView"
style="@style/Widget.MaterialComponents.BottomNavigationView.Colored"
android:layout_width="match_parent"
android:layout_height="80dp"
app:itemIconSize="35dp"
app:itemTextColor="@color/black"
app:itemTextAppearanceActive="@style/BottomNavigationView.Active"
app:itemTextAppearanceInactive="@style/BottomNavigationView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:itemPaddingBottom="15dp"
app:menu="@menu/bottom_nav_menu_lwp" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,175 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/activityMain"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
tools:context=".MainActivity"
>
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonHaus"
android:layout_width="0dp"
android:layout_height="90dp"
android:layout_marginBottom="10dp"
android:background="@drawable/button_text_color"
android:text="@string/haus"
android:textColor="#FFFFFF"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/buttonGlocke"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonGlocke"
android:layout_width="0dp"
android:layout_height="90dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/button_text_color"
android:text="@string/l_uten"
android:textColor="#FFFFFF"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/buttonLicht"
app:layout_constraintStart_toEndOf="@+id/buttonHaus"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLicht"
android:layout_width="0dp"
android:layout_height="90dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/button_text_color"
android:text="@string/licht"
android:textColor="#FFFFFF"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/buttonLog"
app:layout_constraintStart_toEndOf="@+id/buttonGlocke"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLog"
android:layout_width="0dp"
android:layout_height="90dp"
android:layout_marginBottom="10dp"
android:background="@drawable/button_text_color"
android:text="@string/log"
android:textColor="#FFFFFF"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonLicht" />
<ImageView
android:id="@+id/imageViewHaus"
android:layout_width="0dp"
android:layout_height="243dp"
android:layout_marginStart="20dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="20dp"
android:background="@drawable/haus_neu"
android:contentDescription="@string/todo"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ImageContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonDorisLicht"
android:layout_width="0dp"
android:layout_height="75dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_text_color"
android:text="@string/doris_licht"
android:textColor="#FFFFFF"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonAlarm"
app:layout_constraintTop_toBottomOf="@+id/buttonDoris" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonLWP"
android:layout_width="0dp"
android:layout_height="75dp"
android:layout_marginStart="20dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_text_color"
android:text="@string/heizung"
android:textColor="#FFFFFF"
app:layout_constraintEnd_toStartOf="@+id/buttonDoris"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageViewHaus" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonDoris"
android:layout_width="0dp"
android:layout_height="75dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_text_color"
android:text="@string/doris"
android:textColor="#FFFFFF"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/buttonLWP"
app:layout_constraintTop_toBottomOf="@+id/imageViewHaus" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonAlarm"
android:layout_width="0dp"
android:layout_height="75dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_text_color"
android:text="@string/alarm"
android:textColor="#FFFFFF"
app:layout_constraintEnd_toStartOf="@+id/buttonDorisLicht"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonLWP" />
<TextView
android:id="@+id/textView_Mqtt"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:text="@string/mqtt"
android:textColor="#D50000"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="@+id/imageViewHaus"
app:layout_constraintTop_toTopOf="@+id/imageViewHaus" />
<TextView
android:id="@+id/textview_WM1"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_marginStart="25dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:textColor="#FFFFFF"
android:textSize="14sp"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttonAlarm"
tools:visibility="visible" />
<TextView
android:id="@+id/textview_WM2"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_marginStart="25dp"
android:layout_marginEnd="20dp"
android:textColor="#FFFFFF"
android:textSize="14sp"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textview_WM1"
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/activityChristmas"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".noConnection">
<ImageView
android:id="@+id/imageView"
android:layout_width="0dp"
android:layout_height="266dp"
android:layout_marginStart="72dp"
android:layout_marginTop="40dp"
android:layout_marginEnd="73dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/warning" />
<TextView
android:id="@+id/textView"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_marginStart="80dp"
android:layout_marginTop="36dp"
android:layout_marginEnd="80dp"
android:text="Keine Verbindung zum MQTT-Broker!"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView" />
<TextView
android:id="@+id/textView5"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_marginStart="70dp"
android:layout_marginTop="13dp"
android:layout_marginEnd="70dp"
android:text="Bitte Systemadministrator kontaktieren!"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView" />
<Button
android:id="@+id/buttonNoConn"
android:layout_width="0dp"
android:layout_height="75dp"
android:layout_marginStart="119dp"
android:layout_marginTop="25dp"
android:layout_marginEnd="120dp"
android:text="Problem melden"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView5" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/activitySky"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
tools:context=".activitySky">
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonSkySend"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="16dp"
android:background="@drawable/button_text_color"
android:text="@string/werte_ndern"
android:textColor="#FFFFFF"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="TextContrastCheck" />
<CheckBox
android:id="@+id/checkSky"
android:layout_width="0dp"
android:layout_height="200dp"
android:layout_marginStart="40dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="20dp"
android:text="@string/sky_q_abschalttimer"
android:textColor="#FFFFFF"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonSkyZeit"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="161dp"
android:layout_marginTop="44dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_text_color"
android:textColor="#FFFFFF"
android:textSize="25sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/checkSky"
tools:ignore="SpeakableTextPresentCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,921 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
android:background="#000000"
tools:context=".FragmentHeizkoerper">
<!-- android:layout_height="575dp" -->
<ScrollView
android:id="@+id/scrollView"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:layout_marginBottom="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- Cardview #1 Grossraum -->
<androidx.cardview.widget.CardView
android:id="@+id/card_view_Grossraum"
app:cardBackgroundColor="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="10dp"
app:cardCornerRadius="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_HK_Grossraum"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="@string/grossraum"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_temp_Grossraum"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="35dp"
android:gravity="center"
android:paddingBottom="5dp"
android:text="@string/temp_tv"
android:textAlignment="center"
android:textColor="@color/button_pressed"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_HK_Grossraum"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_HK_Grossraum"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginTop="35dp"
android:layout_marginEnd="10dp"
android:gravity="center|end"
android:paddingStart="0dp"
android:paddingTop="5dp"
android:paddingEnd="12dp"
android:text="@string/man"
android:textColor="@color/black"
android:textSize="16sp"
android:theme="@style/Switch.TrackTint"
app:layout_constraintEnd_toStartOf="@+id/btn_HK_Grossraum"
app:layout_constraintStart_toEndOf="@id/tv_temp_Grossraum"
app:layout_constraintTop_toTopOf="parent"
app:showText="false"
tools:ignore="DuplicateSpeakableTextCheck,TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_HK_Grossraum"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="5dp"
android:background="@drawable/button_text_color"
android:tag="Lamp1"
android:text="@string/temp_tv"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/switch_HK_Grossraum"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="TextContrastCheck,DuplicateSpeakableTextCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<!-- Cardview #2 Doris -->
<androidx.cardview.widget.CardView
android:id="@+id/card_view_Doris"
app:cardBackgroundColor="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
app:cardCornerRadius="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/card_view_Grossraum" >
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_HK_Doris"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="@string/doris"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_temp_Doris"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="35dp"
android:gravity="center"
android:paddingBottom="5dp"
android:text="@string/temp_tv"
android:textAlignment="center"
android:textColor="@color/button_pressed"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_HK_Doris"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_HK_Doris"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginTop="35dp"
android:layout_marginEnd="10dp"
android:gravity="center|end"
android:paddingStart="0dp"
android:paddingTop="5dp"
android:paddingEnd="12dp"
android:text="@string/man"
android:textColor="@color/black"
android:textSize="16sp"
android:theme="@style/Switch.TrackTint"
app:layout_constraintEnd_toStartOf="@+id/btn_HK_Doris"
app:layout_constraintStart_toEndOf="@id/tv_temp_Doris"
app:layout_constraintTop_toTopOf="parent"
app:showText="false"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_HK_Doris"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginStart="0dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="5dp"
android:background="@drawable/button_text_color"
android:tag="Lamp1"
android:text="@string/temp_tv"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/switch_HK_Doris"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="TextContrastCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<!-- Cardview #3 Doris Bad -->
<androidx.cardview.widget.CardView
android:id="@+id/card_view_Doris_Bad"
app:cardBackgroundColor="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
app:cardCornerRadius="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/card_view_Doris" >
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_HK_Doris_Bad"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="@string/doris_bad"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_temp_Doris_Bad"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="35dp"
android:gravity="center"
android:paddingBottom="5dp"
android:text="@string/temp_tv"
android:textAlignment="center"
android:textColor="@color/button_pressed"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_HK_Doris_Bad"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_HK_Doris_Bad"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginTop="35dp"
android:layout_marginEnd="10dp"
android:gravity="center|end"
android:paddingStart="0dp"
android:paddingTop="5dp"
android:paddingEnd="12dp"
android:text="@string/man"
android:textColor="@color/black"
android:textSize="16sp"
android:theme="@style/Switch.TrackTint"
app:layout_constraintEnd_toStartOf="@+id/btn_HK_Doris_Bad"
app:layout_constraintStart_toEndOf="@id/tv_temp_Doris_Bad"
app:layout_constraintTop_toTopOf="parent"
app:showText="false"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_HK_Doris_Bad"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginStart="0dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="5dp"
android:background="@drawable/button_text_color"
android:tag="Lamp1"
android:text="@string/temp_tv"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/switch_HK_Doris_Bad"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="TextContrastCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<!-- Cardview #4 Arbeitszimmer -->
<androidx.cardview.widget.CardView
android:id="@+id/card_view_Arbeitszimmer"
app:cardBackgroundColor="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
app:cardCornerRadius="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/card_view_Doris_Bad" >
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_HK_Arbeitszimmer"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="@string/arbeitszimmer"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_temp_Arbeitszimmer"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="35dp"
android:gravity="center"
android:paddingBottom="5dp"
android:text="@string/temp_tv"
android:textAlignment="center"
android:textColor="@color/button_pressed"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_HK_Arbeitszimmer"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_HK_Arbeitszimmer"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginTop="35dp"
android:layout_marginEnd="10dp"
android:gravity="center|end"
android:paddingStart="0dp"
android:paddingTop="5dp"
android:paddingEnd="12dp"
android:text="@string/man"
android:textColor="@color/black"
android:textSize="16sp"
android:theme="@style/Switch.TrackTint"
app:layout_constraintEnd_toStartOf="@+id/btn_HK_Arbeitszimmer"
app:layout_constraintStart_toEndOf="@id/tv_temp_Arbeitszimmer"
app:layout_constraintTop_toTopOf="parent"
app:showText="false"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_HK_Arbeitszimmer"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginStart="0dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="5dp"
android:background="@drawable/button_text_color"
android:tag="Lamp1"
android:text="@string/temp_tv"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/switch_HK_Arbeitszimmer"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="TextContrastCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<!-- Cardview #5 Vorraum -->
<androidx.cardview.widget.CardView
android:id="@+id/card_view_Vorraum"
app:cardBackgroundColor="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
app:cardCornerRadius="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/card_view_Arbeitszimmer" >
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_HK_Vorraum"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="@string/vorraum"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_temp_Vorraum"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="35dp"
android:gravity="center"
android:paddingBottom="5dp"
android:text="@string/temp_tv"
android:textAlignment="center"
android:textColor="@color/button_pressed"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_HK_Vorraum"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_HK_Vorraum"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginTop="35dp"
android:layout_marginEnd="10dp"
android:gravity="center|end"
android:paddingStart="0dp"
android:paddingTop="5dp"
android:paddingEnd="12dp"
android:text="@string/man"
android:textColor="@color/black"
android:textSize="16sp"
android:theme="@style/Switch.TrackTint"
app:layout_constraintEnd_toStartOf="@+id/btn_HK_Vorraum"
app:layout_constraintStart_toEndOf="@id/tv_temp_Vorraum"
app:layout_constraintTop_toTopOf="parent"
app:showText="false"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_HK_Vorraum"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginStart="0dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="5dp"
android:background="@drawable/button_text_color"
android:tag="Lamp1"
android:text="@string/temp_tv"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/switch_HK_Vorraum"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="TextContrastCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<!-- Cardview #6 WC EG -->
<androidx.cardview.widget.CardView
android:id="@+id/card_view_WCEG"
app:cardBackgroundColor="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
app:cardCornerRadius="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/card_view_Vorraum" >
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_HK_WCEG"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="@string/wc_eg"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_temp_WCEG"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="35dp"
android:gravity="center"
android:paddingBottom="5dp"
android:text="@string/temp_tv"
android:textAlignment="center"
android:textColor="@color/button_pressed"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_HK_WCEG"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_HK_WCEG"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginTop="35dp"
android:layout_marginEnd="10dp"
android:gravity="center|end"
android:paddingStart="0dp"
android:paddingTop="5dp"
android:paddingEnd="12dp"
android:text="@string/man"
android:textColor="@color/black"
android:textSize="16sp"
android:theme="@style/Switch.TrackTint"
app:layout_constraintEnd_toStartOf="@+id/btn_HK_WCEG"
app:layout_constraintStart_toEndOf="@id/tv_temp_WCEG"
app:layout_constraintTop_toTopOf="parent"
app:showText="false"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_HK_WCEG"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginStart="0dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="5dp"
android:background="@drawable/button_text_color"
android:tag="Lamp1"
android:text="@string/temp_tv"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/switch_HK_WCEG"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="TextContrastCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<!-- Cardview #7 Bad -->
<androidx.cardview.widget.CardView
android:id="@+id/card_view_Bad"
app:cardBackgroundColor="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
app:cardCornerRadius="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/card_view_WCEG" >
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_HK_Bad"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="@string/bad"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_temp_Bad"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="35dp"
android:gravity="center"
android:paddingBottom="5dp"
android:text="@string/temp_tv"
android:textAlignment="center"
android:textColor="@color/button_pressed"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_HK_Bad" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_HK_Bad"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginTop="35dp"
android:layout_marginEnd="10dp"
android:gravity="center|end"
android:paddingTop="5dp"
android:paddingStart="0dp"
android:paddingEnd="12dp"
android:text="@string/man"
android:theme="@style/Switch.TrackTint"
android:textColor="@color/black"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@+id/btn_HK_Bad"
app:layout_constraintStart_toEndOf="@id/tv_temp_Bad"
app:layout_constraintTop_toTopOf="parent"
app:showText="false" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_HK_Bad"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginStart="0dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="5dp"
android:background="@drawable/button_text_color"
android:tag="Lamp1"
android:text="@string/temp_tv"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/switch_HK_Bad"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="TextContrastCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<!-- Cardview #8 Florian -->
<androidx.cardview.widget.CardView
android:id="@+id/card_view_Florian"
app:cardBackgroundColor="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
app:cardCornerRadius="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/card_view_Bad" >
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_HK_Florian"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="@string/florian"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_temp_Florian"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="35dp"
android:gravity="center"
android:paddingBottom="5dp"
android:text="@string/temp_tv"
android:textAlignment="center"
android:textColor="@color/button_pressed"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_HK_Florian" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_HK_Florian"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginTop="35dp"
android:layout_marginEnd="10dp"
android:gravity="center|end"
android:text="@string/man"
android:paddingTop="5dp"
android:paddingStart="0dp"
android:paddingEnd="12dp"
android:theme="@style/Switch.TrackTint"
android:textColor="@color/black"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@+id/btn_HK_Florian"
app:layout_constraintStart_toEndOf="@id/tv_temp_Florian"
app:layout_constraintTop_toTopOf="parent"
app:showText="false" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_HK_Florian"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginStart="0dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="5dp"
android:background="@drawable/button_text_color"
android:tag="Lamp1"
android:text="@string/temp_tv"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/switch_HK_Florian"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="TextContrastCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<!-- Cardview #9 Stefan -->
<androidx.cardview.widget.CardView
android:id="@+id/card_view_Stefan"
app:cardBackgroundColor="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
app:cardCornerRadius="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/card_view_Florian" >
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_HK_Stefan"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="@string/stefan"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_temp_Stefan"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="35dp"
android:gravity="center"
android:paddingBottom="5dp"
android:text="@string/temp_tv"
android:textAlignment="center"
android:textColor="@color/button_pressed"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_HK_Stefan" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_HK_Stefan"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginTop="35dp"
android:layout_marginEnd="10dp"
android:gravity="center|end"
android:paddingTop="5dp"
android:paddingStart="0dp"
android:paddingEnd="12dp"
android:text="@string/man"
android:theme="@style/Switch.TrackTint"
android:textColor="@color/black"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@+id/btn_HK_Stefan"
app:layout_constraintStart_toEndOf="@id/tv_temp_Stefan"
app:layout_constraintTop_toTopOf="parent"
app:showText="false" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_HK_Stefan"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginStart="0dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="5dp"
android:background="@drawable/button_text_color"
android:tag="Lamp1"
android:text="@string/temp_tv"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/switch_HK_Stefan"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="TextContrastCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<!-- Cardview #10 Dachboden -->
<androidx.cardview.widget.CardView
android:id="@+id/card_view_Dachboden"
app:cardBackgroundColor="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
app:cardCornerRadius="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/card_view_Stefan" >
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_HK_Dachboden"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="@string/dachboden"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_temp_Dachboden"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="35dp"
android:gravity="center"
android:paddingBottom="5dp"
android:text="@string/temp_tv"
android:textAlignment="center"
android:textColor="@color/button_pressed"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_HK_Dachboden" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_HK_Dachboden"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginTop="35dp"
android:layout_marginEnd="10dp"
android:gravity="center|end"
android:paddingTop="5dp"
android:paddingStart="0dp"
android:paddingEnd="12dp"
android:text="@string/man"
android:theme="@style/Switch.TrackTint"
android:textColor="@color/black"
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@+id/btn_HK_Dachboden"
app:layout_constraintStart_toEndOf="@id/tv_temp_Dachboden"
app:layout_constraintTop_toTopOf="parent"
app:showText="false" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_HK_Dachboden"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginStart="0dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="5dp"
android:background="@drawable/button_text_color"
android:tag="Lamp1"
android:text="@string/temp_tv"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/switch_HK_Dachboden"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="TextContrastCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,283 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
android:background="#000000"
tools:context=".FragmentHeizung">
<androidx.cardview.widget.CardView
android:id="@+id/card_view_heizung"
android:layout_width="match_parent"
android:layout_height="470dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="10dp"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- Line 1 -->
<CheckBox
android:id="@+id/check_hzZeit1"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:textColor="#000000"
android:textSize="25sp"
app:layout_constraintEnd_toStartOf="@+id/switch_silentModeHz1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="DuplicateSpeakableTextCheck" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_silentModeHz1"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:enabled="true"
android:theme="@style/Switch.TrackTint"
app:layout_constraintEnd_toStartOf="@+id/btn_hzZeit1"
app:layout_constraintStart_toEndOf="@+id/check_hzZeit1"
app:layout_constraintTop_toTopOf="parent"
app:switchMinWidth="60dp" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_hzZeit1"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:background="@drawable/button_ww"
android:enabled="false"
android:textColor="#FFFFFF"
android:textSize="20sp"
android:visibility="visible"
app:layout_constraintEnd_toStartOf="@+id/btn_hzZeit2"
app:layout_constraintStart_toEndOf="@+id/switch_silentModeHz1"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="DuplicateSpeakableTextCheck,SpeakableTextPresentCheck" />
<!-- Line 2 -->
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_hzZeit2"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:background="@drawable/button_ww"
android:enabled="false"
android:textColor="#FFFFFF"
android:textSize="20sp"
android:visibility="visible"
app:layout_constraintEnd_toStartOf="@+id/btn_hzVL1"
app:layout_constraintStart_toEndOf="@+id/btn_hzZeit1"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="DuplicateSpeakableTextCheck,SpeakableTextPresentCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_hzVL1"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:background="@drawable/button_ww"
android:enabled="false"
android:tag="Lamp1"
android:text="@string/temp_tv"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/btn_hzZeit2"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="TextContrastCheck,DuplicateSpeakableTextCheck" />
<CheckBox
android:id="@+id/check_hzZeit2"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:textColor="#000000"
android:textSize="25sp"
app:layout_constraintEnd_toStartOf="@+id/switch_silentModeHz2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/check_hzZeit1" />
<!-- Line 3 -->
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_silentModeHz2"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:enabled="true"
android:theme="@style/Switch.TrackTint"
app:layout_constraintEnd_toStartOf="@+id/btn_hzZeit3"
app:layout_constraintStart_toEndOf="@+id/check_hzZeit2"
app:layout_constraintTop_toBottomOf="@+id/check_hzZeit1"
app:switchMinWidth="60dp" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_hzZeit3"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:background="@drawable/button_ww"
android:enabled="false"
android:textColor="#FFFFFF"
android:textSize="20sp"
android:visibility="visible"
app:layout_constraintEnd_toStartOf="@+id/btn_hzZeit4"
app:layout_constraintStart_toEndOf="@+id/switch_silentModeHz2"
app:layout_constraintTop_toBottomOf="@+id/btn_hzZeit1"
tools:ignore="DuplicateSpeakableTextCheck,SpeakableTextPresentCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_hzZeit4"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:background="@drawable/button_ww"
android:enabled="false"
android:textColor="#FFFFFF"
android:textSize="20sp"
android:visibility="visible"
app:layout_constraintEnd_toStartOf="@+id/btn_hzVL2"
app:layout_constraintStart_toEndOf="@+id/btn_hzZeit3"
app:layout_constraintTop_toBottomOf="@+id/btn_hzZeit2"
tools:ignore="DuplicateSpeakableTextCheck,SpeakableTextPresentCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_hzVL2"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:background="@drawable/button_ww"
android:enabled="false"
android:tag="Lamp1"
android:text="@string/temp_tv"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/btn_hzZeit4"
app:layout_constraintTop_toBottomOf="@+id/btn_hzVL1"
tools:ignore="TextContrastCheck,DuplicateSpeakableTextCheck" />
<CheckBox
android:id="@+id/check_hzZeit3"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:textColor="#000000"
android:textSize="25sp"
app:layout_constraintEnd_toStartOf="@+id/switch_silentModeHz3"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/check_hzZeit2" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_silentModeHz3"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:enabled="true"
android:theme="@style/Switch.TrackTint"
app:layout_constraintEnd_toStartOf="@+id/btn_hzZeit5"
app:layout_constraintStart_toEndOf="@+id/check_hzZeit3"
app:layout_constraintTop_toBottomOf="@+id/switch_silentModeHz2"
app:switchMinWidth="60dp" />
<!-- Line 4 -->
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_hzZeit5"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:background="@drawable/button_ww"
android:enabled="false"
android:textColor="#FFFFFF"
android:textSize="20sp"
android:visibility="visible"
app:layout_constraintEnd_toStartOf="@+id/btn_hzZeit6"
app:layout_constraintStart_toEndOf="@+id/switch_silentModeHz3"
app:layout_constraintTop_toBottomOf="@+id/btn_hzZeit3"
tools:ignore="DuplicateSpeakableTextCheck,SpeakableTextPresentCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_hzZeit6"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:background="@drawable/button_ww"
android:enabled="false"
android:textColor="#FFFFFF"
android:textSize="20sp"
android:visibility="visible"
app:layout_constraintEnd_toStartOf="@+id/btn_hzVL3"
app:layout_constraintStart_toEndOf="@+id/btn_hzZeit5"
app:layout_constraintTop_toBottomOf="@+id/btn_hzZeit4"
tools:ignore="DuplicateSpeakableTextCheck,SpeakableTextPresentCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_hzVL3"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:background="@drawable/button_ww"
android:enabled="false"
android:tag="Lamp1"
android:text="@string/temp_tv"
android:textAllCaps="false"
android:textColor="#FFFFFF"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/btn_hzZeit6"
app:layout_constraintTop_toBottomOf="@+id/btn_hzVL2"
tools:ignore="TextContrastCheck,DuplicateSpeakableTextCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<!-- Line 5 -->
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_HzSend"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_text_color"
android:text="@string/werte_ndern"
android:textColor="#FFFFFF"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/card_view_heizung"
tools:ignore="TextContrastCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,368 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
android:background="#000000"
tools:context=".FragmentWW">
<androidx.cardview.widget.CardView
android:id="@+id/card_view_warmwasser_oben"
android:layout_width="match_parent"
android:layout_height="470dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="10dp"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- Line 1 -->
<CheckBox
android:id="@+id/check_wwZeit1"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:textColor="#000000"
android:textSize="25sp"
app:layout_constraintEnd_toStartOf="@+id/switch_silentModeWw1"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="DuplicateSpeakableTextCheck" />
<!-- Line 2 -->
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_wwZeit1"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="5dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/button_ww"
android:enabled="false"
android:textColor="#FFFFFF"
android:textSize="24sp"
android:visibility="visible"
app:layout_constraintEnd_toStartOf="@+id/btn_wwZeit2"
app:layout_constraintStart_toEndOf="@+id/switch_silentModeWw1"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="DuplicateSpeakableTextCheck,SpeakableTextPresentCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_wwZeit2"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/button_ww"
android:enabled="false"
android:textColor="#FFFFFF"
android:textSize="24sp"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/btn_wwZeit1"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="DuplicateSpeakableTextCheck,SpeakableTextPresentCheck" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_silentModeWw1"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:enabled="false"
android:theme="@style/Switch.TrackTint"
app:layout_constraintEnd_toStartOf="@+id/btn_wwZeit1"
app:layout_constraintStart_toEndOf="@+id/check_wwZeit1"
app:layout_constraintTop_toTopOf="parent"
app:switchMinWidth="70dp" />
<CheckBox
android:id="@+id/check_wwZeit2"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="10dp"
android:layout_marginTop="13dp"
android:textColor="#000000"
android:textSize="25sp"
app:layout_constraintEnd_toStartOf="@+id/switch_silentModeWw2"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/check_wwZeit1" />
<!-- Line 3 -->
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_wwZeit3"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="5dp"
android:layout_marginTop="13dp"
android:layout_marginEnd="10dp"
android:background="@drawable/button_ww"
android:enabled="false"
android:textColor="#FFFFFF"
android:textSize="24sp"
android:visibility="visible"
app:layout_constraintEnd_toStartOf="@+id/btn_wwZeit4"
app:layout_constraintStart_toEndOf="@+id/switch_silentModeWw2"
app:layout_constraintTop_toBottomOf="@+id/btn_wwZeit1"
tools:ignore="DuplicateSpeakableTextCheck,SpeakableTextPresentCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_wwZeit4"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="13dp"
android:layout_marginEnd="10dp"
android:background="@drawable/button_ww"
android:enabled="false"
android:textColor="#FFFFFF"
android:textSize="24sp"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/btn_wwZeit3"
app:layout_constraintTop_toBottomOf="@+id/btn_wwZeit2"
tools:ignore="DuplicateSpeakableTextCheck,SpeakableTextPresentCheck" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_silentModeWw2"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="13dp"
android:enabled="false"
android:theme="@style/Switch.TrackTint"
app:layout_constraintEnd_toStartOf="@+id/btn_wwZeit3"
app:layout_constraintStart_toEndOf="@+id/check_wwZeit2"
app:layout_constraintTop_toBottomOf="@id/btn_wwZeit2"
app:switchMinWidth="70dp" />
<CheckBox
android:id="@+id/check_wwZeit3"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="10dp"
android:layout_marginTop="13dp"
android:checked="false"
android:textColor="#000000"
android:textSize="25sp"
app:layout_constraintEnd_toStartOf="@+id/switch_silentModeWw3"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/check_wwZeit2" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_wwZeit5"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="5dp"
android:layout_marginTop="13dp"
android:layout_marginEnd="10dp"
android:background="@drawable/button_ww"
android:enabled="false"
android:textColor="#FFFFFF"
android:textSize="24sp"
android:visibility="visible"
app:layout_constraintEnd_toStartOf="@+id/btn_wwZeit6"
app:layout_constraintStart_toEndOf="@+id/switch_silentModeWw3"
app:layout_constraintTop_toBottomOf="@+id/btn_wwZeit3"
tools:ignore="DuplicateSpeakableTextCheck,SpeakableTextPresentCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_wwZeit6"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="13dp"
android:layout_marginEnd="10dp"
android:background="@drawable/button_ww"
android:enabled="false"
android:textColor="#FFFFFF"
android:textSize="24sp"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/btn_wwZeit5"
app:layout_constraintTop_toBottomOf="@+id/btn_wwZeit4"
tools:ignore="DuplicateSpeakableTextCheck,SpeakableTextPresentCheck" />
<!-- Line 4 -->
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_silentModeWw3"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginTop="13dp"
android:enabled="false"
android:theme="@style/Switch.TrackTint"
app:layout_constraintEnd_toStartOf="@+id/btn_wwZeit5"
app:layout_constraintStart_toEndOf="@+id/check_wwZeit3"
app:layout_constraintTop_toBottomOf="@+id/switch_silentModeWw2"
app:switchMinWidth="70dp" />
<TextView
android:id="@+id/tv_wwMin"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="10dp"
android:gravity="center"
android:text="@string/min"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="24sp"
app:layout_constraintEnd_toStartOf="@+id/tv_wwMinVal"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/check_wwZeit3" />
<TextView
android:id="@+id/tv_wwMinVal"
android:layout_width="0dp"
android:layout_height="70dp"
android:gravity="center"
android:textColor="#000000"
android:textSize="28sp"
app:layout_constraintEnd_toStartOf="@+id/seekBar_wwMin"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toEndOf="@+id/tv_wwMin"
app:layout_constraintTop_toBottomOf="@id/check_wwZeit3" />
<SeekBar
android:id="@+id/seekBar_wwMin"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginEnd="10dp"
android:indeterminate="false"
android:max="44"
android:min="35"
android:progressTint="@color/light_blue_900"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_weight="4"
app:layout_constraintStart_toEndOf="@+id/tv_wwMinVal"
app:layout_constraintTop_toBottomOf="@id/check_wwZeit3" />
<!-- Line 5 -->
<TextView
android:id="@+id/tv_wwMax"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="@string/max"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="24sp"
app:layout_constraintEnd_toStartOf="@+id/tv_wwMaxVal"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_wwMin" />
<TextView
android:id="@+id/tv_wwMaxVal"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:textColor="#000000"
android:textSize="28sp"
app:layout_constraintEnd_toStartOf="@+id/seekBar_wwMax"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toEndOf="@+id/tv_wwMax"
app:layout_constraintTop_toBottomOf="@+id/tv_wwMinVal" />
<SeekBar
android:id="@+id/seekBar_wwMax"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="10dp"
android:max="50"
android:min="40"
android:progressTint="@color/light_blue_900"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_weight="4"
app:layout_constraintStart_toEndOf="@+id/tv_wwMaxVal"
app:layout_constraintTop_toBottomOf="@+id/seekBar_wwMin" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_marginStart="13dp"
android:layout_marginEnd="10dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/seekBar_wwMax">
<TextView
android:id="@+id/tv_boilerUnten"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:textSize="16sp"
android:text="@string/boiler_nunten"
android:textColor="#000000" />
<TextView
android:id="@+id/tv_boilerUntenVal"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="3"
android:gravity="center_vertical"
android:textSize="20sp"
android:text="@string/_38"
android:textColor="#000000" />
<TextView
android:id="@+id/tv_boilerOben"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:textSize="16sp"
android:text="@string/boiler_noben"
android:textColor="#000000" />
<TextView
android:id="@+id/tv_boilerObenVal"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:textSize="20sp"
android:text="@string/_44"
android:textColor="#000000" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<!-- Line 6 -->
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_HzSend"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:background="@drawable/button_text_color"
android:text="@string/werte_ndern"
android:textColor="#FFFFFF"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/card_view_warmwasser_oben"
tools:ignore="TextContrastCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/popup_background"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="60dp"
android:background="@drawable/popup_background"
android:orientation="horizontal">
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginStart="5dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:layout_weight="1"
android:max="10"
android:progressTint="#64DD17" />
<TextView
android:id="@+id/tv_adtimer"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_marginTop="10dp"
android:layout_weight="5"
android:textColor="#FFFFFF"
android:gravity="center"
android:textSize="20sp" />
</LinearLayout>
<TextView
android:id="@+id/tv_adcontent"
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_marginTop="10dp"
android:textColor="#FFFFFF"
android:textSize="20sp" />
</LinearLayout>

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/popup_background"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginStart="5dp"
android:layout_marginTop="20dp"
android:textColor="#FFFFFF"
android:text="@string/alarm_wirklich_einschalten"
android:textSize="20sp" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/popup_background"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonAlarmNein"
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:background="@drawable/button_text_color"
android:text="@string/nein"
android:textColor="#FFFFFF"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonAlarmJa"
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:background="@drawable/button_text_color"
android:text="@string/ja_einschalten"
android:textColor="#FFFFFF"
tools:ignore="TextContrastCheck" />
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/popup_background"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_marginStart="5dp"
android:layout_marginTop="20dp"
android:textColor="#FFFFFF"
android:text="@string/haus_alertdialog"
android:textSize="20sp" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/popup_background"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonAlarmJa"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:background="@drawable/button_text_color"
android:text="@string/garage"
android:textColor="#FFFFFF"
tools:ignore="TextContrastCheck" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/buttonAlarmNein"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:background="@drawable/button_text_color"
android:text="@string/schiebetor"
android:textColor="#FFFFFF"
tools:ignore="TextContrastCheck" />
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="5" />
<NumberPicker
android:id="@+id/picker"
android:layout_width="wrap_content"
android:layout_height="200dp"
android:layout_weight="1"
android:theme="@style/NumberPickerText" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="200dp"
android:gravity="center_vertical"
android:text="@string/degrees_celcius"
android:layout_weight="1"
android:textSize="25sp" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="3" />
</LinearLayout>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/popup_background"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_marginStart="5dp"
android:layout_marginTop="20dp"
android:text="@string/version"
android:textColor="#FFFFFF"
android:textSize="24sp" />
</LinearLayout>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/warmwasser"
android:title="@string/warmwasser"
android:icon="@drawable/warmwasser_black"/>
<item
android:id="@+id/heizkoerper"
android:title="@string/heizkoerper"
android:icon="@drawable/heizung_black"/>
<item
android:id="@+id/heizung"
android:title="@string/heizung"
android:icon="@drawable/lwp"/>
</menu>

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Some files were not shown because too many files have changed in this diff Show More