diff --git a/app/src/main/java/de/jg_cody/Teraplex/ui/Credits/CreditsFragment.java b/app/src/main/java/de/jg_cody/Teraplex/ui/Credits/CreditsFragment.java index 0167124..8a64e2e 100644 --- a/app/src/main/java/de/jg_cody/Teraplex/ui/Credits/CreditsFragment.java +++ b/app/src/main/java/de/jg_cody/Teraplex/ui/Credits/CreditsFragment.java @@ -4,12 +4,9 @@ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.TextView; import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; -import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProvider; import de.jg_cody.Teraplex.R; @@ -23,13 +20,7 @@ public class CreditsFragment extends Fragment { creditsViewModel = new ViewModelProvider(this).get(CreditsViewModel.class); View root = inflater.inflate(R.layout.fragment_credits, container, false); - final TextView textView = root.findViewById(R.id.text_toilette); - creditsViewModel.getText().observe(getViewLifecycleOwner(), new Observer() { - @Override - public void onChanged(@Nullable String s) { - textView.setText(s); - } - }); + return root; } } \ No newline at end of file diff --git a/app/src/main/java/de/jg_cody/Teraplex/ui/Credits/CreditsViewModel.java b/app/src/main/java/de/jg_cody/Teraplex/ui/Credits/CreditsViewModel.java index f037792..6fe2163 100644 --- a/app/src/main/java/de/jg_cody/Teraplex/ui/Credits/CreditsViewModel.java +++ b/app/src/main/java/de/jg_cody/Teraplex/ui/Credits/CreditsViewModel.java @@ -1,6 +1,5 @@ package de.jg_cody.Teraplex.ui.Credits; -import androidx.lifecycle.LiveData; import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.ViewModel; @@ -8,12 +7,5 @@ public class CreditsViewModel extends ViewModel { private MutableLiveData mText; - public CreditsViewModel() { - mText = new MutableLiveData<>(); - mText.setValue("CREDITS"); - } - public LiveData getText() { - return mText; - } } \ No newline at end of file diff --git a/app/src/main/java/de/jg_cody/Teraplex/ui/Einstellungen/EinstellungenFragment.java b/app/src/main/java/de/jg_cody/Teraplex/ui/Einstellungen/EinstellungenFragment.java index 2835c63..3a5adcd 100644 --- a/app/src/main/java/de/jg_cody/Teraplex/ui/Einstellungen/EinstellungenFragment.java +++ b/app/src/main/java/de/jg_cody/Teraplex/ui/Einstellungen/EinstellungenFragment.java @@ -9,13 +9,10 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; -import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; -import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProvider; import com.rarepebble.colorpicker.ColorPickerView; @@ -36,13 +33,6 @@ public class EinstellungenFragment extends Fragment { einstellungenViewModel = new ViewModelProvider(this).get(EinstellungenViewModel.class); View root = inflater.inflate(R.layout.fragment_einstellungen, container, false); - final TextView textView = root.findViewById(R.id.text_einstellungen); - einstellungenViewModel.getText().observe(getViewLifecycleOwner(), new Observer() { - @Override - public void onChanged(@Nullable String s) { - textView.setText(s); - } - }); button_colorpicker = (Button) root.findViewById(R.id.button_colorpicker); button_colorpicker.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/de/jg_cody/Teraplex/ui/Einstellungen/EinstellungenViewModel.java b/app/src/main/java/de/jg_cody/Teraplex/ui/Einstellungen/EinstellungenViewModel.java index d9b24ee..8f02641 100644 --- a/app/src/main/java/de/jg_cody/Teraplex/ui/Einstellungen/EinstellungenViewModel.java +++ b/app/src/main/java/de/jg_cody/Teraplex/ui/Einstellungen/EinstellungenViewModel.java @@ -1,6 +1,5 @@ package de.jg_cody.Teraplex.ui.Einstellungen; -import androidx.lifecycle.LiveData; import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.ViewModel; @@ -8,12 +7,5 @@ public class EinstellungenViewModel extends ViewModel { private MutableLiveData mText; - public EinstellungenViewModel() { - mText = new MutableLiveData<>(); - mText.setValue("EINSTELLUNGEN"); - } - public LiveData getText() { - return mText; - } } \ No newline at end of file diff --git a/app/src/main/java/de/jg_cody/Teraplex/ui/Konsole/KonsoleFragment.java b/app/src/main/java/de/jg_cody/Teraplex/ui/Konsole/KonsoleFragment.java index 4d0653f..5f46608 100644 --- a/app/src/main/java/de/jg_cody/Teraplex/ui/Konsole/KonsoleFragment.java +++ b/app/src/main/java/de/jg_cody/Teraplex/ui/Konsole/KonsoleFragment.java @@ -8,13 +8,10 @@ import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.EditText; -import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; -import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProvider; import de.jg_cody.Teraplex.R; @@ -40,13 +37,6 @@ public class KonsoleFragment extends Fragment { konsoleViewModel = new ViewModelProvider(this).get(KonsoleViewModel.class); View root = inflater.inflate(R.layout.fragment_konsole, container, false); - final TextView textView = root.findViewById(R.id.text_konsole); - konsoleViewModel.getText().observe(getViewLifecycleOwner(), new Observer() { - @Override - public void onChanged(@Nullable String s) { - textView.setText(s); - } - }); befehlInput = (EditText) root.findViewById(R.id.befehlInput); SendCommandButton = (Button) root.findViewById(R.id.SendCommandButton); SendCommandButton.setOnClickListener(new View.OnClickListener() { diff --git a/app/src/main/java/de/jg_cody/Teraplex/ui/Konsole/KonsoleViewModel.java b/app/src/main/java/de/jg_cody/Teraplex/ui/Konsole/KonsoleViewModel.java index b76ffb8..97126c1 100644 --- a/app/src/main/java/de/jg_cody/Teraplex/ui/Konsole/KonsoleViewModel.java +++ b/app/src/main/java/de/jg_cody/Teraplex/ui/Konsole/KonsoleViewModel.java @@ -1,19 +1,8 @@ package de.jg_cody.Teraplex.ui.Konsole; -import androidx.lifecycle.LiveData; -import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.ViewModel; public class KonsoleViewModel extends ViewModel { - private MutableLiveData mText; - public KonsoleViewModel() { - mText = new MutableLiveData<>(); - mText.setValue("KONSOLE"); - } - - public LiveData getText() { - return mText; - } } \ No newline at end of file diff --git a/app/src/main/java/de/jg_cody/Teraplex/ui/home/HomeViewModel.java b/app/src/main/java/de/jg_cody/Teraplex/ui/home/HomeViewModel.java index 25fd58d..95e6e66 100644 --- a/app/src/main/java/de/jg_cody/Teraplex/ui/home/HomeViewModel.java +++ b/app/src/main/java/de/jg_cody/Teraplex/ui/home/HomeViewModel.java @@ -10,7 +10,7 @@ public class HomeViewModel extends ViewModel { public HomeViewModel() { mText = new MutableLiveData<>(); - mText.setValue("Welcome to your HOMEAUTOMATION-APP"); + mText.setValue("R.string.Welcome_to_your_HOMEAUTOMATION_APP"); } diff --git a/app/src/main/java/de/jg_cody/Teraplex/ui/zeitsteuerung/ZeitsteuerungFragment.java b/app/src/main/java/de/jg_cody/Teraplex/ui/zeitsteuerung/ZeitsteuerungFragment.java index 97fad49..a5ef2db 100644 --- a/app/src/main/java/de/jg_cody/Teraplex/ui/zeitsteuerung/ZeitsteuerungFragment.java +++ b/app/src/main/java/de/jg_cody/Teraplex/ui/zeitsteuerung/ZeitsteuerungFragment.java @@ -4,13 +4,10 @@ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.TextView; import android.widget.TimePicker; import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; -import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProvider; import de.jg_cody.Teraplex.R; @@ -25,13 +22,6 @@ public class ZeitsteuerungFragment extends Fragment { zeitsteuerungViewModel = new ViewModelProvider(this).get(ZeitsteuerungViewModel.class); View root = inflater.inflate(R.layout.fragment_zeitsteuerung, container, false); - final TextView textView = root.findViewById(R.id.text_zeitsteuerung); - zeitsteuerungViewModel.getText().observe(getViewLifecycleOwner(), new Observer() { - @Override - public void onChanged(@Nullable String s) { - textView.setText(s); - } - }); TimePicker timePicker = (TimePicker) root.findViewById(R.id.timePicker); timePicker.setIs24HourView(true); return root; diff --git a/app/src/main/java/de/jg_cody/Teraplex/ui/zeitsteuerung/ZeitsteuerungViewModel.java b/app/src/main/java/de/jg_cody/Teraplex/ui/zeitsteuerung/ZeitsteuerungViewModel.java index 4561c0e..8eda28b 100644 --- a/app/src/main/java/de/jg_cody/Teraplex/ui/zeitsteuerung/ZeitsteuerungViewModel.java +++ b/app/src/main/java/de/jg_cody/Teraplex/ui/zeitsteuerung/ZeitsteuerungViewModel.java @@ -1,19 +1,8 @@ package de.jg_cody.Teraplex.ui.zeitsteuerung; -import androidx.lifecycle.LiveData; -import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.ViewModel; public class ZeitsteuerungViewModel extends ViewModel { - private MutableLiveData mText; - public ZeitsteuerungViewModel() { - mText = new MutableLiveData<>(); - mText.setValue("WOHNZIMMER"); - } - - public LiveData getText() { - return mText; - } } \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_credits.xml b/app/src/main/res/layout/fragment_credits.xml index 4c24f1a..f65e5b3 100644 --- a/app/src/main/res/layout/fragment_credits.xml +++ b/app/src/main/res/layout/fragment_credits.xml @@ -101,20 +101,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/supportedby" /> - - - - + app:layout_constraintVertical_bias="0.0" /> @@ -136,7 +122,7 @@ android:id="@+id/button_pickimage2" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="GRAFIK WÄHLEN" + android:text="@string/button_hintergrund_wählen" app:layout_constraintBottom_toTopOf="@+id/sprache" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.498" @@ -150,8 +136,8 @@ android:layout_marginStart="75dp" android:layout_marginLeft="75dp" android:layout_marginTop="10dp" - android:text="GREEN" - app:backgroundTint="#00FF73" + android:text="@string/grün" + app:backgroundTint="#00FF0A" app:layout_constraintEnd_toStartOf="@+id/button_reset3" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/button_reset4" /> @@ -163,9 +149,9 @@ android:layout_marginTop="10dp" android:layout_marginEnd="75dp" android:layout_marginRight="75dp" - android:text="DARK" - android:textColor="#FFFFFF" - app:backgroundTint="#001932" + android:text="@string/gelb" + android:textColor="#000000" + app:backgroundTint="#FFE500" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@+id/button_reset2" app:layout_constraintTop_toBottomOf="@+id/button_reset6" /> @@ -176,7 +162,7 @@ android:layout_height="wrap_content" android:layout_marginEnd="75dp" android:layout_marginRight="75dp" - android:text="RED" + android:text="@string/rot" app:backgroundTint="#FF0000" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@+id/button_reset4" @@ -188,8 +174,8 @@ android:layout_height="wrap_content" android:layout_marginStart="75dp" android:layout_marginLeft="75dp" - android:text="BLUE" - app:backgroundTint="#00A6FF" + android:text="@string/blau" + app:backgroundTint="#008EFF" app:layout_constraintEnd_toStartOf="@+id/button_reset6" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/nightmode" /> diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index db63a2f..534bb02 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -97,7 +97,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:hapticFeedbackEnabled="true" - android:text="Login" + android:text="@string/login" app:icon="@drawable/login_24px" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -108,7 +108,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:hapticFeedbackEnabled="true" - android:text="AN" + android:text="@string/an" app:icon="@drawable/signal_wifi_statusbar_4_bar_24px" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@+id/wlan_aus" @@ -119,7 +119,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:hapticFeedbackEnabled="true" - android:text="AN" + android:text="@string/an" app:icon="@drawable/kodi" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.483" @@ -131,7 +131,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:hapticFeedbackEnabled="true" - android:text="AUS" + android:text="@string/aus" app:icon="@drawable/signal_wifi_off_24px" app:layout_constraintEnd_toStartOf="@+id/wlan_an" app:layout_constraintStart_toStartOf="parent" @@ -142,7 +142,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:hapticFeedbackEnabled="true" - android:text="AUS" + android:text="@string/aus" app:icon="@drawable/kodi_aus_1_" app:layout_constraintEnd_toStartOf="@+id/wlan_an" app:layout_constraintHorizontal_bias="0.496" @@ -154,16 +154,16 @@ android:layout_width="376dp" android:layout_height="28dp" android:gravity="center_horizontal" - android:text="WLAN" + android:text="@string/wlan" android:textAlignment="center" android:textColor="#FFFFFF" android:textSize="20sp" app:layout_constraintBottom_toTopOf="@+id/textView7" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.542" + app:layout_constraintHorizontal_bias="0.485" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/loginButton" - app:layout_constraintVertical_bias="0.33" /> + app:layout_constraintVertical_bias="0.333" /> - -