diff --git a/app/build.gradle b/app/build.gradle
index 4c653ce..356be01 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -47,6 +47,8 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1"
+
+ implementation "androidx.work:work-runtime-ktx:2.0.1"
}
repositories {
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 81c11f3..0d7e2d2 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -14,25 +14,24 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
- android:theme="@style/AppTheme0"
tools:ignore="GoogleAppIndexingWarning">
+ android:theme="@style/AppTheme0.Launcher" />
diff --git a/app/src/main/java/com/denizd/substitutionplan/CardAdapter.java b/app/src/main/java/com/denizd/substitutionplan/CardAdapter.java
deleted file mode 100644
index d31983d..0000000
--- a/app/src/main/java/com/denizd/substitutionplan/CardAdapter.java
+++ /dev/null
@@ -1,220 +0,0 @@
-package com.denizd.substitutionplan;
-
-import android.content.SharedPreferences;
-import android.preference.PreferenceManager;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import androidx.annotation.NonNull;
-import androidx.core.content.ContextCompat;
-import androidx.recyclerview.widget.RecyclerView;
-
-public class CardAdapter extends RecyclerView.Adapter {
- private List mSubst;
- private static int colour;
- private static String colorCheck;
-
- public static class CardViewHolder extends RecyclerView.ViewHolder {
- public ImageView mImageView;
- public TextView mGroup, mDate, mTime, mCourse, mRoom, mAdditional;
-
- public CardViewHolder(@NonNull View itemView) {
- super(itemView);
- mImageView = itemView.findViewById(R.id.iconView);
- mGroup = itemView.findViewById(R.id.group);
- mDate = itemView.findViewById(R.id.date);
- mTime = itemView.findViewById(R.id.time);
- mCourse = itemView.findViewById(R.id.course);
- mRoom = itemView.findViewById(R.id.room);
- mAdditional = itemView.findViewById(R.id.additional);
- }
- }
-
- public CardAdapter(ArrayList subst) {
- mSubst = subst;
- }
-
- @NonNull
- @Override
- public CardViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
- View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.course_card, parent, false);
- CardViewHolder cvh = new CardViewHolder(v);
- return cvh;
- }
-
- public Subst getSubstAt(int i) {
- return mSubst.get(i);
- }
-
- @Override
- public void onBindViewHolder(@NonNull CardViewHolder holder, int position) {
- Subst currentItem = mSubst.get(position);
- final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(holder.mImageView.getContext());
-
-
- holder.mImageView.setImageResource(currentItem.getIcon());
- holder.mGroup.setText(currentItem.getGroup());
- holder.mDate.setText(currentItem.getDate());
- holder.mTime.setText(currentItem.getTime());
- holder.mCourse.setText(currentItem.getCourse());
- holder.mRoom.setText(currentItem.getRoom());
- holder.mAdditional.setText(currentItem.getAdditional());
-
- colour = 0;
- try {
- colorCheck = holder.mCourse.getText().toString().toLowerCase().substring(0, 3);
- switch (colorCheck) {
- case "deu": case "dep": case "daz": case "fda": {
- colour = prefs.getInt("colGerman", 0);
- break;
- }
- case "mat": case "map": {
- colour = prefs.getInt("colMaths", 0);
- break;
- }
- case "eng": case "enp": case "ena": {
- colour = prefs.getInt("colEnglish", 0);
- break;
- }
- case "spo": case "spp": case "spth": {
- colour = prefs.getInt("colPhysEd", 0);
- break;
- }
- case "pol": case "pop": {
- colour = prefs.getInt("colPolitics", 0);
- break;
- }
- case "dar": case "dap": {
- colour = prefs.getInt("colTheatre", 0);
- break;
- }
- case "phy": case "php": {
- colour = prefs.getInt("colPhysics", 0);
- break;
- }
- case "bio": case "bip": {
- colour = prefs.getInt("colBiology", 0);
- break;
- }
- case "che": case "chp": {
- colour = prefs.getInt("colChemistry", 0);
- break;
- }
- case "phi": case "psp": {
- colour = prefs.getInt("colPhilosophy", 0);
- break;
- }
- case "laa": case "laf": case "lat": {
- colour = prefs.getInt("colLatin", 0);
- break;
- }
- case "spa": case "spf": {
- colour = prefs.getInt("colSpanish", 0);
- break;
- }
- case "fra": case "frf": case "frz": {
- colour = prefs.getInt("colFrench", 0);
- break;
- }
- case "inf": {
- colour = prefs.getInt("colCompsci", 0);
- break;
- }
- case "ges": {
- colour = prefs.getInt("colHistory", 0);
- break;
- }
- case "rel": {
- colour = prefs.getInt("colReligion", 0);
- break;
- }
- case "geg": case "wuk": {
- colour = prefs.getInt("colGeography", 0);
- break;
- }
- case "kun": {
- colour = prefs.getInt("colArts", 0);
- break;
- }
- case "mus": {
- colour = prefs.getInt("colMusic", 0);
- break;
- }
- case "tue": {
- colour = prefs.getInt("colTurkish", 0);
- break;
- }
- case "chi": {
- colour = prefs.getInt("colChinese", 0);
- break;
- }
- case "gll": {
- colour = prefs.getInt("colGLL", 0);
- break;
- }
- case "wat": {
- colour = prefs.getInt("colWAT", 0);
- break;
- }
- case "för": {
- colour = prefs.getInt("colForder", 0);
- break;
- }
- case "met": {
- colour = prefs.getInt("colWP", 0);
- break;
- }
- default: {
- colour = 0;
- break;
- }
- }
- } catch (StringIndexOutOfBoundsException e) {
- try {
- String colorCheck2 = holder.mCourse.getText().toString().toLowerCase().substring(0, 2);
- switch (colorCheck2) {
- case "nw": {
- colour = prefs.getInt("colBiology", 0);
- break;
- }
- case "wp": {
- colour = prefs.getInt("colWP", 0);
- break;
- }
- default: {
- colour = 0;
- break;
- }
- }
- } catch (StringIndexOutOfBoundsException e1) {
- colour = 0;
- }
- } finally {
- if (colour == 0) {
- if (prefs.getInt("themeInt", 0) == 1) {
- colour = R.color.textLight;
- } else {
- colour = R.color.textDark;
- }
- }
- holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), colour));
- holder.mCourse.setTextColor(ContextCompat.getColor(holder.mCourse.getContext(), colour));
- }
- }
-
- @Override
- public int getItemCount() {
- return mSubst.size();
- }
-
- public void setSubst(List subst) {
- mSubst = subst;
- notifyDataSetChanged();
- }
-}
diff --git a/app/src/main/java/com/denizd/substitutionplan/CardAdapter.kt b/app/src/main/java/com/denizd/substitutionplan/CardAdapter.kt
new file mode 100644
index 0000000..391405b
--- /dev/null
+++ b/app/src/main/java/com/denizd/substitutionplan/CardAdapter.kt
@@ -0,0 +1,110 @@
+package com.denizd.substitutionplan
+
+import android.preference.PreferenceManager
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.ImageView
+import android.widget.TextView
+import androidx.core.content.ContextCompat
+import androidx.recyclerview.widget.RecyclerView
+
+class CardAdapter (var mSubst: List) : RecyclerView.Adapter() {
+
+ var colour = 0
+ var colorCheck = ""
+
+ class CardViewHolder (view: View) : RecyclerView.ViewHolder(view) {
+ var mImageView: ImageView = itemView.findViewById(R.id.iconView)
+ var mGroup: TextView = itemView.findViewById(R.id.group)
+ var mDate: TextView = itemView.findViewById(R.id.date)
+ var mTime: TextView = itemView.findViewById(R.id.time)
+ var mCourse: TextView = itemView.findViewById(R.id.course)
+ var mRoom: TextView = itemView.findViewById(R.id.room)
+ var mAdditional: TextView = itemView.findViewById(R.id.additional)
+ }
+
+ fun CardAdapter(subst: ArrayList) {
+ mSubst = subst
+ }
+
+ override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CardViewHolder {
+ val v = LayoutInflater.from(parent.context).inflate(R.layout.course_card, parent, false)
+ return CardViewHolder(v)
+ }
+
+ public fun getSubstAt(i: Int): Subst {
+ return mSubst[i]
+ }
+
+ override fun onBindViewHolder(holder: CardViewHolder, position: Int) {
+ val currentItem = mSubst[position]
+ val prefs = PreferenceManager.getDefaultSharedPreferences(holder.mImageView.context)
+
+ holder.mImageView.setImageResource(currentItem.icon)
+ holder.mGroup.text = currentItem.group
+ holder.mDate.text = currentItem.date
+ holder.mTime.text = currentItem.time
+ holder.mCourse.text = currentItem.course
+ holder.mRoom.text = currentItem.room
+ holder.mAdditional.text = currentItem.additional
+
+ try {
+ colorCheck = holder.mCourse.text.toString().toLowerCase().substring(0, 3)
+ colour = when (colorCheck) {
+ "deu", "dep", "daz", "fda" -> prefs.getInt("colGerman", 0)
+ "mat", "map" -> prefs.getInt("colMaths", 0)
+ "eng", "enp", "ena" -> prefs.getInt("colEnglish", 0)
+ "spo", "spp", "spth" -> prefs.getInt("colPhysEd", 0)
+ "pol", "pop" -> prefs.getInt("colPolitics", 0)
+ "dar", "dap" -> prefs.getInt("colTheatre", 0)
+ "phy", "php" -> prefs.getInt("colPhysics", 0)
+ "bio", "bip" -> prefs.getInt("colBiology", 0)
+ "che", "chp" -> prefs.getInt("colChemistry", 0)
+ "phi", "psp" -> prefs.getInt("colPhilosophy", 0)
+ "laa", "laf", "lat" -> prefs.getInt("colLatin", 0)
+ "spa", "spf" -> prefs.getInt("colSpanish", 0)
+ "fra", "frf", "frz" -> prefs.getInt("colFrench", 0)
+ "inf" -> prefs.getInt("colCompsci", 0)
+ "ges" -> prefs.getInt("colHistory", 0)
+ "rel" -> prefs.getInt("colReligion", 0)
+ "geg" -> prefs.getInt("colGeography", 0)
+ "kun" -> prefs.getInt("colArts", 0)
+ "mus" -> prefs.getInt("colMusic", 0)
+ "tue" -> prefs.getInt("colTurkish", 0)
+ "chi" -> prefs.getInt("colChinese", 0)
+ "gll" -> prefs.getInt("colGLL", 0)
+ "wat" -> prefs.getInt("colWAT", 0)
+ "för" -> prefs.getInt("colForder", 0)
+ "met" -> prefs.getInt("colWP", 0)
+ else -> 0
+ }
+ } catch (e: StringIndexOutOfBoundsException) {
+ try {
+ colorCheck = holder.mCourse.text.toString().toLowerCase().substring(0, 2)
+ colour = when (colorCheck) {
+ "nw" -> prefs.getInt("colBiology", 0)
+ "wp" -> prefs.getInt("colWP", 0)
+ else -> 0
+ }
+ } catch (e2: StringIndexOutOfBoundsException) {
+ colour = 0
+ }
+ } finally {
+ if (colour == 0) {
+ colour = R.color.textcolor
+ }
+ }
+
+ holder.mImageView.drawable.setTint(ContextCompat.getColor(holder.mImageView.context, colour))
+ holder.mCourse.setTextColor(ContextCompat.getColor(holder.mCourse.context, colour))
+ }
+
+ override fun getItemCount(): Int = mSubst.size
+
+ public fun setSubst(subst: List) {
+ mSubst = subst
+ notifyDataSetChanged()
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/denizd/substitutionplan/DataGetter.java b/app/src/main/java/com/denizd/substitutionplan/DataGetter.java
deleted file mode 100644
index cc16567..0000000
--- a/app/src/main/java/com/denizd/substitutionplan/DataGetter.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package com.denizd.substitutionplan;
-
-public class DataGetter {
-
- protected static int getIcon(String course) {
- if (course.toLowerCase().contains("deu") || course.toLowerCase().contains("dep") || course.toLowerCase().contains("daz")) {
- return R.drawable.ic_german;
- } else if (course.toLowerCase().contains("mat") || course.toLowerCase().contains("map")) {
- return R.drawable.ic_maths;
- } else if (course.toLowerCase().contains("eng") || course.toLowerCase().contains("enp") || course.toLowerCase().contains("ena")) {
- return R.drawable.ic_english;
- } else if (course.toLowerCase().contains("spo") || course.toLowerCase().contains("spp") || course.toLowerCase().contains("spth")) {
- return R.drawable.ic_pe;
- } else if (course.toLowerCase().contains("pol") || course.toLowerCase().contains("pop")) {
- return R.drawable.ic_politics;
- } else if (course.toLowerCase().contains("dar") || course.toLowerCase().contains("dap")) {
- return R.drawable.ic_drama;
- } else if (course.toLowerCase().contains("phy") || course.toLowerCase().contains("php")) {
- return R.drawable.ic_physics;
- } else if (course.toLowerCase().contains("bio") || course.toLowerCase().contains("bip") || course.toLowerCase().contains("nw")) {
- return R.drawable.ic_biology;
- } else if (course.toLowerCase().contains("che") || course.toLowerCase().contains("chp")) {
- return R.drawable.ic_chemistry;
- } else if (course.toLowerCase().contains("phi") || course.toLowerCase().contains("psp")) {
- return R.drawable.ic_philosophy;
- } else if (course.toLowerCase().contains("laa") || course.toLowerCase().contains("laf") || course.toLowerCase().contains("lat")) {
- return R.drawable.ic_latin;
- } else if (course.toLowerCase().contains("spa") || course.toLowerCase().contains("spf")) {
- return R.drawable.ic_spanish;
- } else if (course.toLowerCase().contains("fra") || course.toLowerCase().contains("frf") || course.toLowerCase().contains("frz")) {
- return R.drawable.ic_french;
- } else if (course.toLowerCase().contains("inf")) {
- return R.drawable.ic_compsci;
- } else if (course.toLowerCase().contains("ges")) {
- return R.drawable.ic_history;
- } else if (course.toLowerCase().contains("rel")) {
- return R.drawable.ic_religion;
- } else if (course.toLowerCase().contains("geg") || course.toLowerCase().contains("wuk")) {
- return R.drawable.ic_geography;
- } else if (course.toLowerCase().contains("kun")) {
- return R.drawable.ic_arts;
- } else if (course.toLowerCase().contains("mus")) {
- return R.drawable.ic_music;
- } else if (course.toLowerCase().contains("tue")) {
- return R.drawable.ic_turkish;
- } else if (course.toLowerCase().contains("chi")) {
- return R.drawable.ic_chinese;
- } else if (course.toLowerCase().contains("gll")) {
- return R.drawable.ic_gll;
- } else if (course.toLowerCase().contains("wat")) {
- return R.drawable.ic_wat;
- } else if (course.toLowerCase().contains("för")) {
- return R.drawable.ic_help;
- } else if (course.toLowerCase().contains("wp") || course.toLowerCase().contains("met")) {
- return R.drawable.ic_pencil;
- } else {
- return R.drawable.ic_empty;
- }
- }
-
- protected static String[] boy = {"Cedric Grislawski", "Dawid Kniola", "Jonas Köstergarten", "Jakob Moerschner", "Siamak Nemati", "Hendrik Plönnings",
- "Jan Rohmann", "Anton Rosenberger", "Christoph Senft", "Jan Mika Sieckendieck", "Alexander Sinaj",
- "Nico Tischer", "Nhat Vinh Tran", "Leon Becker", "Youssef Beltagi", "Erich Kerkesner", "Alex Lick",
- "Oskar Piskorz", "Theo Recktor", "Eray Vatansever", "Dennis Wojciechowski", "Übeydullah Alkan",
- "Yahya Almarashli", "Sinan Aydin", "Rick Büteröwe", "Levin Dropp", "Silvester Jermolajew", "Tolgay Kekilli",
- "Dennis Lange", "Aras Mahmoud", "Batuhan Özcan", "Michael Rek", "Khabat Sharif", "Anbinh Tran",
- "Bastian Westerboer", "Abdulwahab Alshebli", "Kelechi Gaius", "Armin Großmann", "Anes Halep",
- "Marco Jankowski", "Emirhan Kaplan", "Alexander Kofmann", "Tobi Derek Köhler", "Vasilije Nedeljkovic",
- "Batu Öcal", "Paul Rehbohm"};
- protected static String[] girl = {"Mayra Dronia", "Shalin Ramadan", "Nigina Amin", "Mariya Kheder", "Niegen Khosrawi", "Dayana Osipova",
- "Julia Petri", "Laura Pister", "Dana Alyoussef", "Ilkem Kahramanoglu", "Rozita Amiri", "Mirja Arneke",
- "Nastasja Banik", "Anni Kienke", "Benedite Mateta", "Leonie Pohl", "Cecillia Sawires", "Patrycja Smółka",
- "Elif Zencirkiran", "Nusyba Al Semadi", "Vivien Bruns", "Yasemin Dal", "Svenja Demuth", "Nina Groß",
- "Kim Lahmeyer", "Luca Minschke", "Kim Reschke", "Amélie Schnellecke", "Delal Secer", "Xenia Segijanski",
- "Melisa Tas", "Kim Völker", "Banu Yari", "Zeinab Ali", "Mariam Bannout", "Stefanie Fahl", "Yamaty Gaye",
- "Anna-Sophia Haeberle", "Finja Hastedt", "Viktoria Hammermeister", "Isabel Horn", "Laura Kern",
- "Melanie Kleinermann", "Målin Kollhoff", "Darja Maier", "Lisa Maier", "Naura Nadzifah", "Janina Roelfs",
- "Vanessa Scheifler", "Mara Thies", "Lieli Umar", "Leonie Welk", "Betraben Yacoub"};
-}
diff --git a/app/src/main/java/com/denizd/substitutionplan/DataGetter.kt b/app/src/main/java/com/denizd/substitutionplan/DataGetter.kt
new file mode 100644
index 0000000..ac86c73
--- /dev/null
+++ b/app/src/main/java/com/denizd/substitutionplan/DataGetter.kt
@@ -0,0 +1,63 @@
+package com.denizd.substitutionplan
+
+class DataGetter {
+
+ var boy = arrayOf("Cedric Grislawski", "Dawid Kniola", "Jonas Köstergarten", "Jakob Moerschner", "Siamak Nemati", "Hendrik Plönnings", "Jan Rohmann", "Anton Rosenberger", "Christoph Senft", "Jan Mika Sieckendieck", "Alexander Sinaj", "Nico Tischer", "Nhat Vinh Tran", "Leon Becker", "Youssef Beltagi", "Erich Kerkesner", "Alex Lick", "Oskar Piskorz", "Theo Recktor", "Eray Vatansever", "Dennis Wojciechowski", "Übeydullah Alkan", "Yahya Almarashli", "Sinan Aydin", "Rick Büteröwe", "Levin Dropp", "Silvester Jermolajew", "Tolgay Kekilli", "Dennis Lange", "Aras Mahmoud", "Batuhan Özcan", "Michael Rek", "Khabat Sharif", "Anbinh Tran", "Bastian Westerboer", "Abdulwahab Alshebli", "Kelechi Gaius", "Armin Großmann", "Anes Halep", "Marco Jankowski", "Emirhan Kaplan", "Alexander Kofmann", "Tobi Derek Köhler", "Vasilije Nedeljkovic", "Batu Öcal", "Paul Rehbohm")
+ var girl = arrayOf("Mayra Dronia", "Shalin Ramadan", "Nigina Amin", "Mariya Kheder", "Niegen Khosrawi", "Dayana Osipova", "Julia Petri", "Laura Pister", "Dana Alyoussef", "Ilkem Kahramanoglu", "Rozita Amiri", "Mirja Arneke", "Nastasja Banik", "Anni Kienke", "Benedite Mateta", "Leonie Pohl", "Cecillia Sawires", "Patrycja Smółka", "Elif Zencirkiran", "Nusyba Al Semadi", "Vivien Bruns", "Yasemin Dal", "Svenja Demuth", "Nina Groß", "Kim Lahmeyer", "Luca Minschke", "Kim Reschke", "Amélie Schnellecke", "Delal Secer", "Xenia Segijanski", "Melisa Tas", "Kim Völker", "Banu Yari", "Zeinab Ali", "Mariam Bannout", "Stefanie Fahl", "Yamaty Gaye", "Anna-Sophia Haeberle", "Finja Hastedt", "Viktoria Hammermeister", "Isabel Horn", "Laura Kern", "Melanie Kleinermann", "Målin Kollhoff", "Darja Maier", "Lisa Maier", "Naura Nadzifah", "Janina Roelfs", "Vanessa Scheifler", "Mara Thies", "Lieli Umar", "Leonie Welk", "Betraben Yacoub")
+
+ fun getIcon(course: String): Int {
+ return if (course.toLowerCase().contains("deu") || course.toLowerCase().contains("dep") || course.toLowerCase().contains("daz")) {
+ R.drawable.ic_german
+ } else if (course.toLowerCase().contains("mat") || course.toLowerCase().contains("map")) {
+ R.drawable.ic_maths
+ } else if (course.toLowerCase().contains("eng") || course.toLowerCase().contains("enp") || course.toLowerCase().contains("ena")) {
+ R.drawable.ic_english
+ } else if (course.toLowerCase().contains("spo") || course.toLowerCase().contains("spp") || course.toLowerCase().contains("spth")) {
+ R.drawable.ic_pe
+ } else if (course.toLowerCase().contains("pol") || course.toLowerCase().contains("pop")) {
+ R.drawable.ic_politics
+ } else if (course.toLowerCase().contains("dar") || course.toLowerCase().contains("dap")) {
+ R.drawable.ic_drama
+ } else if (course.toLowerCase().contains("phy") || course.toLowerCase().contains("php")) {
+ R.drawable.ic_physics
+ } else if (course.toLowerCase().contains("bio") || course.toLowerCase().contains("bip") || course.toLowerCase().contains("nw")) {
+ R.drawable.ic_biology
+ } else if (course.toLowerCase().contains("che") || course.toLowerCase().contains("chp")) {
+ R.drawable.ic_chemistry
+ } else if (course.toLowerCase().contains("phi") || course.toLowerCase().contains("psp")) {
+ R.drawable.ic_philosophy
+ } else if (course.toLowerCase().contains("laa") || course.toLowerCase().contains("laf") || course.toLowerCase().contains("lat")) {
+ R.drawable.ic_latin
+ } else if (course.toLowerCase().contains("spa") || course.toLowerCase().contains("spf")) {
+ R.drawable.ic_spanish
+ } else if (course.toLowerCase().contains("fra") || course.toLowerCase().contains("frf") || course.toLowerCase().contains("frz")) {
+ R.drawable.ic_french
+ } else if (course.toLowerCase().contains("inf")) {
+ R.drawable.ic_compsci
+ } else if (course.toLowerCase().contains("ges")) {
+ R.drawable.ic_history
+ } else if (course.toLowerCase().contains("rel")) {
+ R.drawable.ic_religion
+ } else if (course.toLowerCase().contains("geg") || course.toLowerCase().contains("wuk")) {
+ R.drawable.ic_geography
+ } else if (course.toLowerCase().contains("kun")) {
+ R.drawable.ic_arts
+ } else if (course.toLowerCase().contains("mus")) {
+ R.drawable.ic_music
+ } else if (course.toLowerCase().contains("tue")) {
+ R.drawable.ic_turkish
+ } else if (course.toLowerCase().contains("chi")) {
+ R.drawable.ic_chinese
+ } else if (course.toLowerCase().contains("gll")) {
+ R.drawable.ic_gll
+ } else if (course.toLowerCase().contains("wat")) {
+ R.drawable.ic_wat
+ } else if (course.toLowerCase().contains("för")) {
+ R.drawable.ic_help
+ } else if (course.toLowerCase().contains("wp") || course.toLowerCase().contains("met")) {
+ R.drawable.ic_pencil
+ } else {
+ R.drawable.ic_empty
+ }
+ }
+}
diff --git a/app/src/main/java/com/denizd/substitutionplan/FirstTime.java b/app/src/main/java/com/denizd/substitutionplan/FirstTime.java
index c6f2ece..9acd2fa 100644
--- a/app/src/main/java/com/denizd/substitutionplan/FirstTime.java
+++ b/app/src/main/java/com/denizd/substitutionplan/FirstTime.java
@@ -50,15 +50,15 @@ public class FirstTime extends AppCompatActivity {
window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
- window.setStatusBarColor(ContextCompat.getColor(this, R.color.white));
- window.setNavigationBarColor(ContextCompat.getColor(this, R.color.white));
+ window.setStatusBarColor(ContextCompat.getColor(this, R.color.background));
+ window.setNavigationBarColor(ContextCompat.getColor(this, R.color.background));
} else {
- window.setStatusBarColor(ContextCompat.getColor(this, R.color.black));
- window.setNavigationBarColor(ContextCompat.getColor(this, R.color.black));
+ window.setStatusBarColor(ContextCompat.getColor(this, R.color.background));
+ window.setNavigationBarColor(ContextCompat.getColor(this, R.color.background));
}
window.setBackgroundDrawable(getDrawable(R.drawable.white));
Bitmap bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
- ActivityManager.TaskDescription taskDesc = new ActivityManager.TaskDescription(getString(R.string.app_name), bm, ContextCompat.getColor(this, R.color.white));
+ ActivityManager.TaskDescription taskDesc = new ActivityManager.TaskDescription(getString(R.string.app_name), bm, ContextCompat.getColor(this, R.color.background));
setTaskDescription(taskDesc);
final Context context = this;
diff --git a/app/src/main/java/com/denizd/substitutionplan/FragmentPersonal.java b/app/src/main/java/com/denizd/substitutionplan/FragmentPersonal.java
index 71b3425..308dbaf 100644
--- a/app/src/main/java/com/denizd/substitutionplan/FragmentPersonal.java
+++ b/app/src/main/java/com/denizd/substitutionplan/FragmentPersonal.java
@@ -263,7 +263,8 @@ public class FragmentPersonal extends Fragment {
additionalS[i] = cols.get(5).text();
progressBar.incrementProgressBy(1);
- int drawable = DataGetter.getIcon(courseS[i]);
+ DataGetter dg = new DataGetter();
+ int drawable = dg.getIcon(courseS[i]);
Subst subst = new Subst(drawable, groupS[i], dateS[i], timeS[i], courseS[i], roomS[i], additionalS[i], priority);
substViewModel.insert(subst);
priority--;
@@ -280,9 +281,7 @@ public class FragmentPersonal extends Fragment {
easyPrefs.putListString("informationalList", informationalList);
- } catch (IOException e1) {
- npe = true;
- } catch (NullPointerException e1) {
+ } catch (IOException | NullPointerException e1) {
npe = true;
}
diff --git a/app/src/main/java/com/denizd/substitutionplan/FragmentPlan.java b/app/src/main/java/com/denizd/substitutionplan/FragmentPlan.java
index 4d7e9b9..d83e1d5 100644
--- a/app/src/main/java/com/denizd/substitutionplan/FragmentPlan.java
+++ b/app/src/main/java/com/denizd/substitutionplan/FragmentPlan.java
@@ -69,7 +69,7 @@ public class FragmentPlan extends Fragment {
recyclerView.setLayoutManager(layoutManager);
} else if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
layoutManager = gridLayoutManager;
- recyclerView.setLayoutManager(layoutManager);
+ recyclerView.setLayoutManager(layoutManager); // TODO grid layout but change an integer value instead
}
}
@@ -206,7 +206,8 @@ public class FragmentPlan extends Fragment {
additionalS[i] = cols.get(5).text();
progressBar.incrementProgressBy(1);
- int drawable = DataGetter.getIcon(courseS[i]);
+ DataGetter dg = new DataGetter();
+ int drawable = dg.getIcon(courseS[i]);
Subst subst = new Subst(drawable, groupS[i], dateS[i], timeS[i], courseS[i], roomS[i], additionalS[i], priority);
substViewModel.insert(subst);
priority--;
diff --git a/app/src/main/java/com/denizd/substitutionplan/FragmentSettings.java b/app/src/main/java/com/denizd/substitutionplan/FragmentSettings.java
index 5f79e91..cd85c29 100644
--- a/app/src/main/java/com/denizd/substitutionplan/FragmentSettings.java
+++ b/app/src/main/java/com/denizd/substitutionplan/FragmentSettings.java
@@ -67,7 +67,7 @@ public class FragmentSettings extends Fragment implements View.OnClickListener {
final SharedPreferences.Editor edit = prefs.edit();
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
- builder.setToolbarColor(getResources().getColor(R.color.white));
+ builder.setToolbarColor(getResources().getColor(R.color.background));
final CustomTabsIntent customTabsIntent = builder.build();
final TextInputEditText txtName = getView().findViewById(R.id.txtName);
@@ -713,43 +713,45 @@ public class FragmentSettings extends Fragment implements View.OnClickListener {
datingBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- try {
- double boyP = 0, girlP = 0, perc = 0;
- if (boyT.getText().toString().isEmpty() || boy.isChecked()) {
- boyT.setText(DataGetter.boy[gen.nextInt(DataGetter.boy.length)]);
- }
- if (girlT.getText().toString().isEmpty() || girl.isChecked()) {
- girlT.setText(DataGetter.girl[gen.nextInt(DataGetter.girl.length)]);
- }
- for (int i = 0; i < boyT.getText().length(); i++) {
- boyP++;
- }
- for (int i = 0; i < girlT.getText().length(); i++) {
- girlP++;
- }
- if (girlP < boyP) {
- perc = (girlP / boyP) * 100;
- }
- if (girlP > boyP) {
- perc = (boyP / girlP) * 100;
- }
- char multiplyTempBoy = boyT.getText().charAt(boyT.getText().length() - 1);
- char multiplyTempGirl = girlT.getText().charAt(girlT.getText().length() - 1);
- double multiply = Character.getNumericValue(multiplyTempBoy) + Character.getNumericValue(multiplyTempGirl);
- multiply = multiply / 1.2;
- if (perc == 0) {
- perc += 30;
- }
- DecimalFormat df = new DecimalFormat("#.##");
- if (perc * (multiply / 40) > 100) {
- percentage.setText("100.00%");
- } else {
- percentage.setText(df.format(perc * (multiply / 40)) + "%");
- }
- } catch (NullPointerException e) {
- Toast.makeText(getActivity(), getString(R.string.error),
+// try {
+// double boyP = 0, girlP = 0, perc = 0;
+// if (boyT.getText().toString().isEmpty() || boy.isChecked()) {
+// boyT.setText(DataGetter.boy[gen.nextInt(DataGetter.boy.length)]);
+// }
+// if (girlT.getText().toString().isEmpty() || girl.isChecked()) {
+// girlT.setText(DataGetter.girl[gen.nextInt(DataGetter.girl.length)]);
+// }
+// for (int i = 0; i < boyT.getText().length(); i++) {
+// boyP++;
+// }
+// for (int i = 0; i < girlT.getText().length(); i++) {
+// girlP++;
+// }
+// if (girlP < boyP) {
+// perc = (girlP / boyP) * 100;
+// }
+// if (girlP > boyP) {
+// perc = (boyP / girlP) * 100;
+// }
+// char multiplyTempBoy = boyT.getText().charAt(boyT.getText().length() - 1);
+// char multiplyTempGirl = girlT.getText().charAt(girlT.getText().length() - 1);
+// double multiply = Character.getNumericValue(multiplyTempBoy) + Character.getNumericValue(multiplyTempGirl);
+// multiply = multiply / 1.2;
+// if (perc == 0) {
+// perc += 30;
+// }
+// DecimalFormat df = new DecimalFormat("#.##");
+// if (perc * (multiply / 40) > 100) {
+// percentage.setText("100.00%");
+// } else {
+// percentage.setText(df.format(perc * (multiply / 40)) + "%");
+// }
+// } catch (NullPointerException e) {
+// Toast.makeText(getActivity(), getString(R.string.error),
+// Toast.LENGTH_SHORT).show();
+// }
+ Toast.makeText(getActivity(), "Deprecated",
Toast.LENGTH_SHORT).show();
- }
}
});
alertDialogDev.setView(dialogView);
diff --git a/app/src/main/java/com/denizd/substitutionplan/Main.kt b/app/src/main/java/com/denizd/substitutionplan/Main.kt
index a6b04dd..c78251e 100644
--- a/app/src/main/java/com/denizd/substitutionplan/Main.kt
+++ b/app/src/main/java/com/denizd/substitutionplan/Main.kt
@@ -23,6 +23,7 @@ import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.widget.Toolbar
import androidx.appcompat.app.AppCompatActivity
+import androidx.appcompat.app.AppCompatDelegate
import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.content.ContextCompat
import androidx.core.widget.NestedScrollView
@@ -65,91 +66,36 @@ class Main : AppCompatActivity(R.layout.activity_main) {
val appbarlayout = findViewById(R.id.appbarlayout)
val toolbarTxt = findViewById(R.id.toolbarTxt)
val bottomSheetRoot = findViewById(R.id.bottom_sheet)
- val bottomSheet = findViewById(R.id.bottom_sheet_linear)
- val bottomSheetHeader = findViewById(R.id.bottom_sheet_header)
- val bottomSheetText = findViewById(R.id.bottom_sheet_text)
- val bottomNavDivider = findViewById(R.id.bottom_nav_divider)
bottomSheetBehaviour = BottomSheetBehavior.from(bottomSheetRoot)
val bottomNav = findViewById(R.id.bottom_nav)
val fragmentContainer = findViewById(R.id.fragment_container)
val bottomSheetCloser = findViewById(R.id.bottom_sheet_closer)
val chip = findViewById(R.id.chip)
val contextView = findViewById(R.id.coordination)
- val iconinfo = findViewById(R.id.info_icon)
val window = this.window as Window
- val darkwhite = ContextCompat.getColor(this, R.color.darkwhite)
- val black = ContextCompat.getColor(this, R.color.black)
- val accent = ContextCompat.getColor(this, R.color.accent)
- val tintlistLight = ContextCompat.getColorStateList(this, R.color.tintlist_light)
- val tintlistDark = ContextCompat.getColorStateList(this, R.color.tintlist_dark)
- val chipstatelistLight = resources.getColorStateList(R.color.chip_state_list)
- val chipstatelistDark = resources.getColorStateList(R.color.chip_state_list_dark)
- val textLight = ContextCompat.getColor(this, R.color.textLight)
- val textDark = ContextCompat.getColor(this, R.color.textDark)
- val lightgrey = ContextCompat.getColor(this, R.color.lightgrey)
- val lessdark = ContextCompat.getColor(context, R.color.lessdark)
- val background = ContextCompat.getColor(this, R.color.background)
- val accentPastel = ContextCompat.getColor(this, R.color.accentPastel)
- val dark = ContextCompat.getColor(this, R.color.dark)
- val darkdivider = ContextCompat.getColor(this, R.color.darkdivider)
-
- setSupportActionBar(toolbar)
- supportActionBar?.setDisplayShowTitleEnabled(false)
- window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
-
bottomSheetExpanded = bottomSheetBehaviour.state == BottomSheetBehavior.STATE_EXPANDED
- if (prefs.getInt("themeInt", 0) == 0) {
- setTheme(R.style.AppTheme0)
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
- window.statusBarColor = darkwhite
- window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
- toolbar.setBackgroundColor(darkwhite)
- window.navigationBarColor = darkwhite
- } else {
- window.statusBarColor = black
- window.navigationBarColor = black
+ setTheme(R.style.AppTheme0)
+
+ when (prefs.getInt("themeInt", 0)) {
+ 0 -> {
+ AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
+ window.navigationBarColor = ContextCompat.getColor(this, R.color.background)
+ }
+ }
+ else -> {
+ AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
+ window.navigationBarColor = ContextCompat.getColor(this, R.color.background)
}
- toolbarTxt.setTextColor(accent)
- bottomNav.setBackgroundColor(darkwhite)
- bottomNav.itemIconTintList = tintlistLight
- bottomNav.itemTextColor = tintlistLight
- chip.chipBackgroundColor = chipstatelistLight
- chip.setTextColor(textDark)
- bottomSheet.setBackgroundColor(darkwhite)
- bottomSheetHeader.setTextColor(textDark)
- bottomSheetText.setTextColor(textDark)
- bottomNavDivider.setBackgroundColor(lightgrey)
- iconinfo.setColorFilter(lessdark, android.graphics.PorterDuff.Mode.SRC_IN)
-
- val bm = BitmapFactory.decodeResource(resources, R.mipmap.ic_launcher)
- val taskDesc = ActivityManager.TaskDescription(getString(R.string.app_name), bm, ContextCompat.getColor(this, R.color.darkwhite))
- setTaskDescription(taskDesc)
-
- } else if (prefs.getInt("themeInt", 0) == 1) {
- setTheme(R.style.AppTheme0Dark)
- window.statusBarColor = background
- window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_VISIBLE
- toolbar.setBackgroundColor(dark)
- toolbarTxt.setTextColor(accentPastel)
- bottomNav.setBackgroundColor(dark)
- bottomNav.itemIconTintList = tintlistDark
- bottomNav.itemTextColor = tintlistDark
- window.navigationBarColor = background
- chip.chipBackgroundColor = chipstatelistDark
- chip.setTextColor(textLight)
- bottomSheet.setBackgroundColor(dark)
- bottomSheetHeader.setTextColor(textLight)
- bottomSheetText.setTextColor(textLight)
- bottomNavDivider.setBackgroundColor(darkdivider)
- iconinfo.setColorFilter(lightgrey, android.graphics.PorterDuff.Mode.SRC_IN)
-
- val bm = BitmapFactory.decodeResource(resources, R.mipmap.ic_launcher)
- val taskDesc = ActivityManager.TaskDescription(getString(R.string.app_name), bm, resources.getColor(R.color.background))
- setTaskDescription(taskDesc)
}
+ val bm = BitmapFactory.decodeResource(resources, R.mipmap.ic_launcher)
+ val taskDesc = ActivityManager.TaskDescription(getString(R.string.app_name), bm, ContextCompat.getColor(this, R.color.background))
+ setTaskDescription(taskDesc)
+
if (!prefs.getBoolean("showinfotab", true)) {
bottomNav.menu.removeItem(R.id.openinfopanel)
}
@@ -309,6 +255,7 @@ class Main : AppCompatActivity(R.layout.activity_main) {
}
bottomNav.setOnNavigationItemSelectedListener { item: MenuItem ->
+ var fragmentLoading = true
lateinit var fragment: Fragment
when (item.itemId) {
R.id.plan -> {
@@ -329,15 +276,20 @@ class Main : AppCompatActivity(R.layout.activity_main) {
} else if (bottomSheetBehaviour.state == BottomSheetBehavior.STATE_EXPANDED) {
bottomSheetBehaviour.state = BottomSheetBehavior.STATE_COLLAPSED
}
+ fragmentLoading = false
}
R.id.settings -> {
fragment = SettingsFragment()
toolbarTxt.text = getString(R.string.settings)
}
}
- bottomSheetBehaviour.state = BottomSheetBehavior.STATE_COLLAPSED
- appbarlayout.setExpanded(true)
- loadFragment(fragment)
+ if (fragmentLoading) {
+ bottomSheetBehaviour.state = BottomSheetBehavior.STATE_COLLAPSED
+ appbarlayout.setExpanded(true)
+ loadFragment(fragment)
+ } else {
+ false
+ }
}
bottomNav.setOnNavigationItemReselectedListener { item: MenuItem ->
diff --git a/app/src/main/java/com/denizd/substitutionplan/MainActivity.java b/app/src/main/java/com/denizd/substitutionplan/MainActivity.java
index f963dba..fdff7b6 100644
--- a/app/src/main/java/com/denizd/substitutionplan/MainActivity.java
+++ b/app/src/main/java/com/denizd/substitutionplan/MainActivity.java
@@ -205,57 +205,57 @@ public class MainActivity extends AppCompatActivity {
ImageView iconinfo = findViewById(R.id.info_icon);
// theme change
- if (prefs.getInt("themeInt", 0) == 0) {
- setTheme(R.style.AppTheme0);
-
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
- window.setStatusBarColor(ContextCompat.getColor(this, R.color.darkwhite));
- window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
- toolbar.setBackgroundColor(ContextCompat.getColor(this, R.color.darkwhite));
- window.setNavigationBarColor(ContextCompat.getColor(this, R.color.darkwhite));
- } else {
- window.setStatusBarColor(ContextCompat.getColor(this, R.color.black));
- window.setNavigationBarColor(ContextCompat.getColor(this, R.color.black));
- }
-
- toolbarTxt.setTextColor(ContextCompat.getColor(this, R.color.accent));
- bottomNav.setBackgroundColor(ContextCompat.getColor(this, R.color.darkwhite));
- bottomNav.setItemIconTintList(ContextCompat.getColorStateList(this, R.color.tintlist_light));
- bottomNav.setItemTextColor(ContextCompat.getColorStateList(this, R.color.tintlist_light));
- chip.setChipBackgroundColor(getResources().getColorStateList(R.color.chip_state_list));
- chip.setTextColor(ContextCompat.getColor(this, R.color.textDark));
- bottomSheet.setBackgroundColor(ContextCompat.getColor(this, R.color.darkwhite));
- bottomSheetHeader.setTextColor(ContextCompat.getColor(this, R.color.textDark));
- bottomSheetText.setTextColor(ContextCompat.getColor(this, R.color.textDark));
- bottomNavDivider.setBackgroundColor(ContextCompat.getColor(this, R.color.lightgrey));
- iconinfo.setColorFilter(ContextCompat.getColor(context, R.color.lessdark), android.graphics.PorterDuff.Mode.SRC_IN);
-
- Bitmap bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
- ActivityManager.TaskDescription taskDesc = new ActivityManager.TaskDescription(getString(R.string.app_name), bm, ContextCompat.getColor(this, R.color.darkwhite));
- setTaskDescription(taskDesc);
- }
- if (prefs.getInt("themeInt", 0) == 1) {
- setTheme(R.style.AppTheme0Dark);
- window.setStatusBarColor(ContextCompat.getColor(this, R.color.background));
- window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
- toolbar.setBackgroundColor(ContextCompat.getColor(this, R.color.dark));
- toolbarTxt.setTextColor(ContextCompat.getColor(this, R.color.accentPastel));
- bottomNav.setBackgroundColor(ContextCompat.getColor(this, R.color.dark));
- bottomNav.setItemIconTintList(ContextCompat.getColorStateList(this, R.color.tintlist_dark));
- bottomNav.setItemTextColor(ContextCompat.getColorStateList(this, R.color.tintlist_dark));
- window.setNavigationBarColor(getResources().getColor(R.color.background));
- chip.setChipBackgroundColor(getResources().getColorStateList(R.color.chip_state_list_dark));
- chip.setTextColor(ContextCompat.getColor(this, R.color.textLight));
- bottomSheet.setBackgroundColor(ContextCompat.getColor(this, R.color.dark));
- bottomSheetHeader.setTextColor(ContextCompat.getColor(this, R.color.textLight));
- bottomSheetText.setTextColor(ContextCompat.getColor(this, R.color.textLight));
- bottomNavDivider.setBackgroundColor(ContextCompat.getColor(this, R.color.darkdivider));
- iconinfo.setColorFilter(ContextCompat.getColor(context, R.color.lightgrey), android.graphics.PorterDuff.Mode.SRC_IN);
-
- Bitmap bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
- ActivityManager.TaskDescription taskDesc = new ActivityManager.TaskDescription(getString(R.string.app_name), bm, getResources().getColor(R.color.background));
- setTaskDescription(taskDesc);
- }
+// if (prefs.getInt("themeInt", 0) == 0) {
+// setTheme(R.style.AppTheme0);
+//
+// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+// window.setStatusBarColor(ContextCompat.getColor(this, R.color.darkwhite));
+// window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
+// toolbar.setBackgroundColor(ContextCompat.getColor(this, R.color.darkwhite));
+// window.setNavigationBarColor(ContextCompat.getColor(this, R.color.darkwhite));
+// } else {
+// window.setStatusBarColor(ContextCompat.getColor(this, R.color.black));
+// window.setNavigationBarColor(ContextCompat.getColor(this, R.color.black));
+// }
+//
+// toolbarTxt.setTextColor(ContextCompat.getColor(this, R.color.accent));
+// bottomNav.setBackgroundColor(ContextCompat.getColor(this, R.color.darkwhite));
+// bottomNav.setItemIconTintList(ContextCompat.getColorStateList(this, R.color.tintlist_light));
+// bottomNav.setItemTextColor(ContextCompat.getColorStateList(this, R.color.tintlist_light));
+// chip.setChipBackgroundColor(getResources().getColorStateList(R.color.chip_state_list));
+// chip.setTextColor(ContextCompat.getColor(this, R.color.textDark));
+// bottomSheet.setBackgroundColor(ContextCompat.getColor(this, R.color.darkwhite));
+// bottomSheetHeader.setTextColor(ContextCompat.getColor(this, R.color.textDark));
+// bottomSheetText.setTextColor(ContextCompat.getColor(this, R.color.textDark));
+// bottomNavDivider.setBackgroundColor(ContextCompat.getColor(this, R.color.lightgrey));
+// iconinfo.setColorFilter(ContextCompat.getColor(context, R.color.lessdark), android.graphics.PorterDuff.Mode.SRC_IN);
+//
+// Bitmap bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
+// ActivityManager.TaskDescription taskDesc = new ActivityManager.TaskDescription(getString(R.string.app_name), bm, ContextCompat.getColor(this, R.color.darkwhite));
+// setTaskDescription(taskDesc);
+// }
+// if (prefs.getInt("themeInt", 0) == 1) {
+// setTheme(R.style.AppTheme0Dark);
+// window.setStatusBarColor(ContextCompat.getColor(this, R.color.background));
+// window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
+// toolbar.setBackgroundColor(ContextCompat.getColor(this, R.color.dark));
+// toolbarTxt.setTextColor(ContextCompat.getColor(this, R.color.accentPastel));
+// bottomNav.setBackgroundColor(ContextCompat.getColor(this, R.color.dark));
+// bottomNav.setItemIconTintList(ContextCompat.getColorStateList(this, R.color.tintlist_dark));
+// bottomNav.setItemTextColor(ContextCompat.getColorStateList(this, R.color.tintlist_dark));
+// window.setNavigationBarColor(getResources().getColor(R.color.background));
+// chip.setChipBackgroundColor(getResources().getColorStateList(R.color.chip_state_list_dark));
+// chip.setTextColor(ContextCompat.getColor(this, R.color.textLight));
+// bottomSheet.setBackgroundColor(ContextCompat.getColor(this, R.color.dark));
+// bottomSheetHeader.setTextColor(ContextCompat.getColor(this, R.color.textLight));
+// bottomSheetText.setTextColor(ContextCompat.getColor(this, R.color.textLight));
+// bottomNavDivider.setBackgroundColor(ContextCompat.getColor(this, R.color.darkdivider));
+// iconinfo.setColorFilter(ContextCompat.getColor(context, R.color.lightgrey), android.graphics.PorterDuff.Mode.SRC_IN);
+//
+// Bitmap bm = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
+// ActivityManager.TaskDescription taskDesc = new ActivityManager.TaskDescription(getString(R.string.app_name), bm, getResources().getColor(R.color.background));
+// setTaskDescription(taskDesc);
+// }
if (prefs.getBoolean("greeting", false)) {
if (!prefs.getString("username", "").isEmpty()) {
diff --git a/app/src/main/java/com/denizd/substitutionplan/NotificationService.kt b/app/src/main/java/com/denizd/substitutionplan/NotificationService.kt
new file mode 100644
index 0000000..163d1ff
--- /dev/null
+++ b/app/src/main/java/com/denizd/substitutionplan/NotificationService.kt
@@ -0,0 +1,4 @@
+package com.denizd.substitutionplan
+
+class NotificationService {
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/denizd/substitutionplan/ScheduledJobService.java b/app/src/main/java/com/denizd/substitutionplan/ScheduledJobService.java
index b9e1270..0095186 100644
--- a/app/src/main/java/com/denizd/substitutionplan/ScheduledJobService.java
+++ b/app/src/main/java/com/denizd/substitutionplan/ScheduledJobService.java
@@ -217,7 +217,8 @@ public class ScheduledJobService extends JobService {
roomS[i] = cols.get(4).text();
additionalS[i] = cols.get(5).text();
- int drawable = DataGetter.getIcon(courseS[i]);
+ DataGetter dg = new DataGetter();
+ int drawable = dg.getIcon(courseS[i]);
Subst subst = new Subst(drawable, groupS[i], dateS[i], timeS[i], courseS[i], roomS[i], additionalS[i], priority);
priority--;
substViewModel.insert(subst);
diff --git a/app/src/main/java/com/denizd/substitutionplan/SettingsFragment.kt b/app/src/main/java/com/denizd/substitutionplan/SettingsFragment.kt
index bfdbb60..43a11bf 100644
--- a/app/src/main/java/com/denizd/substitutionplan/SettingsFragment.kt
+++ b/app/src/main/java/com/denizd/substitutionplan/SettingsFragment.kt
@@ -12,11 +12,14 @@ import android.text.Editable
import android.text.TextWatcher
import android.view.LayoutInflater
import android.view.View
+import android.view.Window
import android.widget.*
import androidx.appcompat.app.AlertDialog
+import androidx.appcompat.app.AppCompatDelegate
import androidx.browser.customtabs.CustomTabsIntent
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
+import com.google.android.material.bottomnavigation.BottomNavigationView
import com.google.android.material.button.MaterialButton
import com.google.android.material.textfield.TextInputEditText
import com.jaredrummler.android.device.DeviceName
@@ -35,18 +38,21 @@ class SettingsFragment : Fragment(R.layout.content_settings), View.OnClickListen
private val builder = CustomTabsIntent.Builder()
private val customTabsIntent = builder.build() as CustomTabsIntent
private var cs: Int = 7
+ var window: Window? = null
override fun onAttach(context: Context) {
super.onAttach(context)
mContext = context
prefs = PreferenceManager.getDefaultSharedPreferences(mContext)
edit = prefs.edit()
+
+ window = activity?.window
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
- builder.setToolbarColor(resources.getColor(R.color.white))
+// builder.setToolbarColor(resources.getColor(R.color.white))
val txtName = view.findViewById(R.id.txtName)
val txtClasses = view.findViewById(R.id.txtClasses)
@@ -147,7 +153,26 @@ class SettingsFragment : Fragment(R.layout.content_settings), View.OnClickListen
}
R.id.switchDark -> {
val switchDark = v.findViewById(R.id.switchDark)
- if (switchDark.isChecked) edit.putInt("themeInt", 1) else edit.putInt("themeInt", 0)
+ val bottomNav = v.rootView.findViewById(R.id.bottom_nav)
+ if (switchDark.isChecked) {
+ edit.putInt("themeInt", 1)
+ AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
+ window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_VISIBLE
+ window?.navigationBarColor = ContextCompat.getColor(mContext, R.color.background)
+
+ } else {
+ edit.putInt("themeInt", 0)
+ AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ window?.decorView?.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
+ window?.navigationBarColor = ContextCompat.getColor(mContext, R.color.background)
+ }
+ }
+ if (prefs.getBoolean("defaultPersonalised", false)) {
+ bottomNav.selectedItemId = R.id.personal
+ } else {
+ bottomNav.selectedItemId = R.id.plan
+ }
}
R.id.switchHideInfo -> {
val switchHideInfo = v.findViewById(R.id.switchHideInfo)
@@ -410,11 +435,12 @@ class SettingsFragment : Fragment(R.layout.content_settings), View.OnClickListen
datingBtn.setOnClickListener {
try {
+ val dg = DataGetter()
if (boyTxt.text.toString().isEmpty() || boyCb.isChecked) {
- boyTxt.setText(DataGetter.boy[gen.nextInt(DataGetter.boy.size)])
+ boyTxt.setText(dg.boy[gen.nextInt(dg.boy.size)])
}
if (girlTxt.text.toString().isEmpty() || girlCb.isChecked) {
- girlTxt.setText(DataGetter.girl[gen.nextInt(DataGetter.girl.size)])
+ girlTxt.setText(dg.girl[gen.nextInt(dg.girl.size)])
}
val boyP = boyTxt.text!!.length.toDouble()
diff --git a/app/src/main/res/color/bottom_nav_color.xml b/app/src/main/res/color/bottom_nav_color.xml
new file mode 100644
index 0000000..73475d9
--- /dev/null
+++ b/app/src/main/res/color/bottom_nav_color.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/app/src/main/res/color/bottom_nav_color_avhblue.xml b/app/src/main/res/color/bottom_nav_color_avhblue.xml
deleted file mode 100644
index f0a529b..0000000
--- a/app/src/main/res/color/bottom_nav_color_avhblue.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/color/chip_state_list.xml b/app/src/main/res/color/chip_state_list.xml
deleted file mode 100644
index 7f7f90c..0000000
--- a/app/src/main/res/color/chip_state_list.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/color/chip_state_list_dark.xml b/app/src/main/res/color/chip_state_list_dark.xml
deleted file mode 100644
index f428437..0000000
--- a/app/src/main/res/color/chip_state_list_dark.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/color/tintlist_dark.xml b/app/src/main/res/color/tintlist_dark.xml
deleted file mode 100644
index 9c8d58e..0000000
--- a/app/src/main/res/color/tintlist_dark.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/color/tintlist_light.xml b/app/src/main/res/color/tintlist_light.xml
deleted file mode 100644
index c386151..0000000
--- a/app/src/main/res/color/tintlist_light.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable-v21/launch_screen.xml b/app/src/main/res/drawable-v21/launch_screen.xml
index 2ceee59..29fdf25 100644
--- a/app/src/main/res/drawable-v21/launch_screen.xml
+++ b/app/src/main/res/drawable-v21/launch_screen.xml
@@ -2,7 +2,7 @@
-
+
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable-v23/launch_screen.xml b/app/src/main/res/drawable-v23/launch_screen.xml
index ef61062..f81d2f2 100644
--- a/app/src/main/res/drawable-v23/launch_screen.xml
+++ b/app/src/main/res/drawable-v23/launch_screen.xml
@@ -2,7 +2,7 @@
-
+
-
@@ -34,7 +34,7 @@
android:layout_marginTop="16dp"
android:text="@string/welcome"
android:textAlignment="center"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="30sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -48,7 +48,7 @@
android:layout_marginEnd="8dp"
android:text="@string/firstsomethings"
android:textAlignment="center"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -63,7 +63,7 @@
android:layout_marginEnd="8dp"
android:text="@string/tellmename"
android:textAlignment="center"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -78,7 +78,7 @@
android:layout_marginTop="8dp"
android:layout_marginEnd="56dp"
android:hint="@string/yourname"
- android:textColorHint="?attr/colorHint"
+ android:textColorHint="@color/hintcolor"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txttellmename"
@@ -99,7 +99,7 @@
android:singleLine="true"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.AppCompat"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="16sp"
android:theme="@style/EditTextTheme" />
@@ -114,7 +114,7 @@
android:layout_marginEnd="8dp"
android:text="@string/nextclass"
android:textAlignment="center"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -128,7 +128,7 @@
android:layout_marginStart="56dp"
android:layout_marginTop="8dp"
android:hint="@string/yourclass"
- android:textColorHint="?attr/colorHint"
+ android:textColorHint="@color/hintcolor"
app:layout_constraintEnd_toStartOf="@+id/chipHelpClasses"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
@@ -150,7 +150,7 @@
android:singleLine="true"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.AppCompat"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="16sp"
android:theme="@style/EditTextTheme" />
@@ -163,7 +163,7 @@
android:layout_marginEnd="8dp"
android:backgroundTint="@android:color/transparent"
android:src="@drawable/ic_qmark"
- android:tint="?attr/colorText"
+ android:tint="@color/textcolor"
app:layout_constraintBottom_toBottomOf="@+id/txtLayoutClass"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/txtLayoutClass" />
@@ -177,7 +177,7 @@
android:layout_marginEnd="32dp"
android:text="@string/seniorsetup"
android:textAlignment="center"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txtLayoutClass" />
@@ -190,7 +190,7 @@
android:layout_marginStart="56dp"
android:layout_marginTop="8dp"
android:hint="@string/yourcourses"
- android:textColorHint="?attr/colorHint"
+ android:textColorHint="@color/hintcolor"
app:layout_constraintEnd_toStartOf="@+id/chipHelpCourses"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
@@ -211,7 +211,7 @@
android:singleLine="true"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.AppCompat"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="16sp"
android:theme="@style/EditTextTheme"
android:importantForAutofill="no"/>
@@ -225,7 +225,7 @@
android:layout_marginEnd="8dp"
android:backgroundTint="@android:color/transparent"
android:src="@drawable/ic_qmark"
- android:tint="?attr/colorText"
+ android:tint="@color/textcolor"
app:layout_constraintBottom_toBottomOf="@+id/txtLayoutCourses"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/txtLayoutCourses" />
@@ -238,7 +238,7 @@
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:text="@string/moresettings"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txtLayoutCourses" />
@@ -252,7 +252,7 @@
android:layout_marginEnd="32dp"
android:text="@string/enabledarkmode"
android:textAlignment="viewStart"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
@@ -267,7 +267,7 @@
android:layout_marginEnd="32dp"
android:text="@string/wantnotif"
android:textAlignment="viewStart"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
@@ -282,7 +282,7 @@
android:layout_marginEnd="32dp"
android:text="@string/personalised"
android:textAlignment="viewStart"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
@@ -297,11 +297,11 @@
android:layout_marginTop="32dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="32dp"
- android:backgroundTint="?attr/colorAccent"
+ android:backgroundTint="@color/accent"
android:text="@string/letsgo"
- android:textColor="?attr/colorBackground"
+ android:textColor="@color/background"
app:icon="@drawable/ic_tick"
- app:iconTint="?attr/colorBackground"
+ app:iconTint="@color/background"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -315,7 +315,7 @@
android:id="@+id/linearInflation"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="?attr/colorBackground"
+ android:background="@color/background"
android:orientation="vertical"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 5d45f84..0580da7 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -6,7 +6,7 @@
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start"
- android:background="?attr/colorBackground">
+ android:background="@color/background">
@@ -38,7 +38,7 @@
android:layoutAnimation="@anim/layout_animation_fall_down"
android:text="@string/app_name"
android:textAlignment="center"
- android:textColor="?attr/colorAccent"
+ android:textColor="@color/accent"
android:textSize="22sp"
android:singleLine="true"
app:layout_constraintBottom_toBottomOf="parent"
@@ -51,7 +51,7 @@
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="0dp"
android:layout_height="2dp"
- android:progressTint="?attr/colorAccent"
+ android:progressTint="@color/accent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -66,7 +66,9 @@
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
- android:elevation="4dp"/>
+ android:elevation="4dp"
+ android:background="@color/lightbackground"
+ android:textColor="@color/textcolor"/>
@@ -93,11 +95,11 @@
app:elevation="0dp"
app:layout_anchor="@+id/bottom_sheet"
android:layout_gravity="bottom"
- app:menu="@menu/nav_items"/>
-
-
-
-
+ app:menu="@menu/nav_items"
+ android:background="@color/background"
+ app:itemIconTint="@color/bottom_nav_color"
+ app:itemTextColor="@color/bottom_nav_color"
+ app:itemRippleColor="@color/accent"/>
+ android:layout_gravity="top"
+ android:background="@color/lighthintcolor"/>
-
+ android:layout_height="wrap_content"
+ android:background="@color/background">
+ android:src="@drawable/ic_information"
+ android:tint="@color/textcolor"/>
+ android:textSize="16sp"
+ android:textColor="@color/textcolor"/>
@@ -54,7 +57,8 @@
android:layout_margin="16dp"
android:gravity="top|start"
android:text="@string/noinfo"
- android:textSize="12sp"/>
+ android:textSize="12sp"
+ android:textColor="@color/textcolor"/>
diff --git a/app/src/main/res/layout/colour_picker.xml b/app/src/main/res/layout/colour_picker.xml
index f724f1d..61b50e2 100644
--- a/app/src/main/res/layout/colour_picker.xml
+++ b/app/src/main/res/layout/colour_picker.xml
@@ -113,7 +113,7 @@
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/neoncolours"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:layout_marginStart="8dp"/>
+ android:textColor="@color/textcolor"
+ app:strokeColor="@color/textcolor"
+ app:strokeWidth="2dp"/>
\ No newline at end of file
diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml
index c6f767d..4067a10 100644
--- a/app/src/main/res/layout/content_main.xml
+++ b/app/src/main/res/layout/content_main.xml
@@ -7,7 +7,7 @@
tools:context=".MainActivity"
tools:showIn="@layout/app_bar_main"
android:id="@+id/content"
- android:background="?attr/colorBackground"
+ android:background="@color/background"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
+ android:background="@color/background">
@@ -67,7 +67,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/disablegreeting"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="@+id/txtPersonalise"
app:layout_constraintTop_toBottomOf="@+id/txtLayoutName" />
@@ -77,7 +77,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/justnice"
- android:textColor="?attr/colorHint"
+ android:textColor="@color/hintcolor"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="@+id/txtGreeting"
app:layout_constraintTop_toBottomOf="@+id/txtGreeting" />
@@ -99,7 +99,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/darkbg"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="@+id/txtGreeting"
app:layout_constraintTop_toBottomOf="@+id/txtJustnice" />
@@ -108,8 +108,8 @@
android:id="@+id/txtRestart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="@string/restart"
- android:textColor="?attr/colorHint"
+ android:text="@string/darkmode2"
+ android:textColor="@color/hintcolor"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="@+id/txtDark"
app:layout_constraintTop_toBottomOf="@+id/txtDark" />
@@ -132,7 +132,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/showinfo"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="@+id/txtRestart"
app:layout_constraintTop_toBottomOf="@+id/txtRestart" />
@@ -142,7 +142,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/swipeindependent"
- android:textColor="?attr/colorHint"
+ android:textColor="@color/hintcolor"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="@+id/txtHideInfo"
app:layout_constraintTop_toBottomOf="@+id/txtHideInfo" />
@@ -165,7 +165,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/customisecolor1"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="@+id/txtHideInfo2"
app:layout_constraintTop_toBottomOf="@+id/txtHideInfo2" />
@@ -175,7 +175,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/customisecolor2"
- android:textColor="?attr/colorHint"
+ android:textColor="@color/hintcolor"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="@+id/txtCustomiseColours1"
app:layout_constraintTop_toBottomOf="@+id/txtCustomiseColours1" />
@@ -203,14 +203,14 @@
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:text="@string/filter"
- android:textColor="?attr/colorAccent"
+ android:textColor="@color/accent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txtCustomiseColours2" />
@@ -245,7 +245,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:src="@drawable/ic_qmark"
- android:tint="?attr/colorText"
+ android:tint="@color/textcolor"
android:backgroundTint="@android:color/transparent"
app:layout_constraintBottom_toBottomOf="@+id/txtLayoutClasses"
app:layout_constraintEnd_toEndOf="parent"
@@ -260,8 +260,8 @@
android:layout_marginEnd="8dp"
android:hint="@string/courses"
android:importantForAutofill="no"
- android:textColorHint="?attr/colorHint"
- app:boxStrokeColor="?attr/colorAccent"
+ android:textColorHint="@color/hintcolor"
+ app:boxStrokeColor="@color/accent"
app:boxStrokeWidth="1dp"
app:layout_constraintEnd_toStartOf="@+id/chipHelpCourses"
app:layout_constraintStart_toStartOf="@+id/txtLayoutClasses"
@@ -277,7 +277,7 @@
android:imeOptions="flagNoExtractUi"
android:inputType="textNoSuggestions"
android:singleLine="true"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="14sp" />
@@ -288,7 +288,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:src="@drawable/ic_qmark"
- android:tint="?attr/colorText"
+ android:tint="@color/textcolor"
android:backgroundTint="@android:color/transparent"
app:layout_constraintBottom_toBottomOf="@+id/txtLayoutCourses"
app:layout_constraintEnd_toEndOf="parent"
@@ -300,7 +300,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/notifications"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="@+id/txtFilter"
app:layout_constraintTop_toBottomOf="@+id/txtLayoutCourses" />
@@ -311,7 +311,7 @@
android:layout_height="wrap_content"
android:text="@string/notifiedabout"
android:textAlignment="textStart"
- android:textColor="?attr/colorHint"
+ android:textColor="@color/hintcolor"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="@+id/txtNotifications"
app:layout_constraintTop_toBottomOf="@+id/txtNotifications" />
@@ -334,7 +334,7 @@
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:text="@string/misc"
- android:textColor="?attr/colorAccent"
+ android:textColor="@color/accent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txtNotifiedAbout" />
@@ -344,7 +344,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/personalised"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="@+id/txtMisc"
app:layout_constraintTop_toBottomOf="@+id/txtMisc" />
@@ -354,7 +354,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/defplan"
- android:textColor="?attr/colorHint"
+ android:textColor="@color/hintcolor"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="@+id/txtPersonalised"
app:layout_constraintTop_toBottomOf="@+id/txtPersonalised" />
@@ -376,7 +376,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/openInfo"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="@+id/txtDefaultsTo"
app:layout_constraintTop_toBottomOf="@+id/txtDefaultsTo" />
@@ -386,7 +386,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/openInfoTwo"
- android:textColor="?attr/colorHint"
+ android:textColor="@color/hintcolor"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="@+id/txtOpenInfo"
app:layout_constraintTop_toBottomOf="@+id/txtOpenInfo" />
@@ -408,7 +408,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/autoRefresh"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="@+id/txtOpenInfoTwo"
app:layout_constraintTop_toBottomOf="@+id/txtOpenInfoTwo" />
@@ -418,7 +418,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/autoRefreshTwo"
- android:textColor="?attr/colorHint"
+ android:textColor="@color/hintcolor"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="@+id/txtAutoRefresh"
app:layout_constraintTop_toBottomOf="@+id/txtAutoRefresh" />
@@ -440,7 +440,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/visitweb"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="@+id/txtAutoRefreshTwo"
app:layout_constraintTop_toBottomOf="@+id/txtAutoRefreshTwo" />
@@ -450,7 +450,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/butwhy"
- android:textColor="?attr/colorHint"
+ android:textColor="@color/hintcolor"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="@+id/txtVisitWeb"
app:layout_constraintTop_toBottomOf="@+id/txtVisitWeb" />
@@ -477,7 +477,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/licences"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="@+id/txtWeb"
app:layout_constraintTop_toBottomOf="@+id/txtWeb" />
@@ -487,7 +487,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/whatittook"
- android:textColor="?attr/colorHint"
+ android:textColor="@color/hintcolor"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="@+id/txtLicences"
app:layout_constraintTop_toBottomOf="@+id/txtLicences" />
@@ -513,7 +513,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/tac"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="@+id/txtLicences"
app:layout_constraintTop_toBottomOf="@+id/txtWhatittook" />
@@ -523,7 +523,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tactwo"
- android:textColor="?attr/colorHint"
+ android:textColor="@color/hintcolor"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="@+id/txtTerms"
app:layout_constraintTop_toBottomOf="@+id/txtTerms" />
@@ -550,7 +550,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/privacy"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="@+id/txtTermsTwo"
app:layout_constraintTop_toBottomOf="@+id/txtTermsTwo" />
@@ -560,7 +560,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/privacytwo"
- android:textColor="?attr/colorHint"
+ android:textColor="@color/hintcolor"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="@+id/txtPrivacyP"
app:layout_constraintTop_toBottomOf="@+id/txtPrivacyP" />
@@ -587,7 +587,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/version"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="@+id/txtPrivacyPTwo"
app:layout_constraintTop_toBottomOf="@+id/txtPrivacyPTwo" />
@@ -597,7 +597,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
- android:textColor="?attr/colorHint"
+ android:textColor="@color/hintcolor"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="@+id/txtVersion"
app:layout_constraintTop_toBottomOf="@+id/txtVersion" />
@@ -626,7 +626,7 @@
android:layout_marginTop="64dp"
android:layout_marginEnd="8dp"
android:text="@string/devby"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
diff --git a/app/src/main/res/layout/course_card.xml b/app/src/main/res/layout/course_card.xml
index 72a8e43..0b0dc64 100644
--- a/app/src/main/res/layout/course_card.xml
+++ b/app/src/main/res/layout/course_card.xml
@@ -5,7 +5,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:backgroundTint="?attr/colorBackgroundCard"
+ android:backgroundTint="@color/lightbackground"
app:cardCornerRadius="8dp"
android:clickable="true"
android:focusable="true"
@@ -15,8 +15,6 @@
android:layout_marginBottom="3dp"
app:cardElevation="2dp">
-
-
@@ -31,7 +29,7 @@
app:layout_constraintEnd_toStartOf="@+id/date"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
- android:textColor="?attr/colorText"/>
+ android:textColor="@color/textcolor"/>
@@ -53,7 +51,7 @@
app:layout_constraintEnd_toEndOf="@+id/date"
app:layout_constraintStart_toStartOf="@+id/date"
app:layout_constraintTop_toBottomOf="@+id/date"
- android:textColor="?attr/colorText" />
+ android:textColor="@color/textcolor" />
@@ -76,7 +74,7 @@
app:layout_constraintEnd_toEndOf="@+id/time"
app:layout_constraintStart_toStartOf="@+id/time"
app:layout_constraintTop_toBottomOf="@+id/time"
- android:textColor="?attr/colorText" />
+ android:textColor="@color/textcolor" />
-
-
+ android:tint="@color/textcolor"/>
diff --git a/app/src/main/res/layout/dating_dialog.xml b/app/src/main/res/layout/dating_dialog.xml
index 9140a59..530c21f 100644
--- a/app/src/main/res/layout/dating_dialog.xml
+++ b/app/src/main/res/layout/dating_dialog.xml
@@ -34,7 +34,7 @@
android:id="@+id/dating_txt"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:text="@string/havefun"/>
@@ -60,7 +60,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textNoSuggestions"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:singleLine="true"/>
@@ -70,7 +70,7 @@
android:layout_width="0px"
android:layout_weight="3"
android:layout_height="wrap_content"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:text="Shuffle"/>
@@ -89,7 +89,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
- android:textColorHint="?attr/colorHint"
+ android:textColorHint="@color/hintcolor"
android:hint="@string/girl"
android:importantForAutofill="no">
@@ -98,7 +98,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textNoSuggestions"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:singleLine="true"/>
@@ -108,7 +108,7 @@
android:layout_width="0px"
android:layout_weight="3"
android:layout_height="wrap_content"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:text="Shuffle"/>
@@ -126,7 +126,7 @@
android:text="@string/calculate"
android:textColor="@color/datingPink"
app:strokeColor="@color/datingPink"
- app:strokeWidth="1dp"
+ app:strokeWidth="2dp"
android:layout_gravity="start|center_vertical"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"/>
@@ -136,7 +136,7 @@
android:layout_weight="5"
android:layout_height="wrap_content"
android:textSize="20sp"
- android:textColor="?attr/colorText"
+ android:textColor="@color/textcolor"
android:layout_marginStart="24dp"
android:layout_gravity="end|center_vertical"/>
diff --git a/app/src/main/res/layout/diagnostics_dialog.xml b/app/src/main/res/layout/diagnostics_dialog.xml
index 2326c83..6f894dd 100644
--- a/app/src/main/res/layout/diagnostics_dialog.xml
+++ b/app/src/main/res/layout/diagnostics_dialog.xml
@@ -14,7 +14,7 @@
android:layout_marginTop="16dp"
android:textSize="22sp"
android:layout_gravity="center_horizontal"
- android:textColor="?attr/colorText"/>
+ android:textColor="@color/textcolor"/>
+ android:textColor="@color/textcolor"/>
+ android:textColor="@color/textcolor"/>
+ app:strokeColor="@color/accent"
+ app:strokeWidth="2dp"/>
diff --git a/app/src/main/res/layout/empty_dialog.xml b/app/src/main/res/layout/empty_dialog.xml
index e7f339a..77bbeb2 100644
--- a/app/src/main/res/layout/empty_dialog.xml
+++ b/app/src/main/res/layout/empty_dialog.xml
@@ -12,7 +12,7 @@
android:layout_marginTop="16dp"
android:textSize="22sp"
android:layout_gravity="center_horizontal"
- android:textColor="?attr/colorText"/>
+ android:textColor="@color/textcolor"/>
+ android:background="@color/background">
+ android:tint="@color/textcolor"/>
\ No newline at end of file
diff --git a/app/src/main/res/layout/no_substitutions.xml b/app/src/main/res/layout/no_substitutions.xml
index 00ae835..2e1b8e0 100644
--- a/app/src/main/res/layout/no_substitutions.xml
+++ b/app/src/main/res/layout/no_substitutions.xml
@@ -1,6 +1,5 @@
+ android:background="@color/background">
diff --git a/app/src/main/res/layout/search.xml b/app/src/main/res/layout/search.xml
index bde534d..cf959aa 100644
--- a/app/src/main/res/layout/search.xml
+++ b/app/src/main/res/layout/search.xml
@@ -3,7 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
- android:background="?attr/colorBackground"
+ android:background="@color/background"
android:layoutAnimation="@anim/layout_animation_fall_down">
@@ -22,7 +22,7 @@
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
android:textColor="@color/accent"
- android:textColorHint="?attr/colorHint"
+ android:textColorHint="@color/hintcolor"
android:textSize="20sp"
android:theme="@style/EditTextTheme"
app:layout_constraintEnd_toEndOf="parent"
diff --git a/app/src/main/res/layout/secret_dialog.xml b/app/src/main/res/layout/secret_dialog.xml
index b8cc225..08682f4 100644
--- a/app/src/main/res/layout/secret_dialog.xml
+++ b/app/src/main/res/layout/secret_dialog.xml
@@ -12,7 +12,7 @@
android:layout_marginTop="16dp"
android:textSize="22sp"
android:layout_gravity="center_horizontal"
- android:textColor="?attr/colorText"/>
+ android:textColor="@color/textcolor"/>
-
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/layout/simple_dialog.xml b/app/src/main/res/layout/simple_dialog.xml
index 13a97a4..9c629ab 100644
--- a/app/src/main/res/layout/simple_dialog.xml
+++ b/app/src/main/res/layout/simple_dialog.xml
@@ -12,7 +12,7 @@
android:layout_marginTop="16dp"
android:textSize="22sp"
android:layout_gravity="center_horizontal"
- android:textColor="?attr/colorText"/>
+ android:textColor="@color/textcolor"/>
+ android:background="@color/accent"/>
\ No newline at end of file
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index 841e5db..55f0822 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -129,4 +129,5 @@
Unabhängig von Wischgeste
Zeige Info-Tab in Navigationsleisete
"Zuletzt aktualisiert: "
+ Aktiviert den Nachtmodus
\ No newline at end of file
diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml
new file mode 100644
index 0000000..94275ce
--- /dev/null
+++ b/app/src/main/res/values-night/colors.xml
@@ -0,0 +1,9 @@
+
+
+ #121212
+ #1E1E1E
+ #64b5f6
+ #e0e0e0
+ #9e9e9e
+ #313131
+
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 0a25870..c376f11 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -1,29 +1,37 @@
- #121212
- #f5f5f5
- #1E1E1E
- #FFFFFF
- #000000
+ #eeeeee
+ #f5f5f5
#448aff
- #64b5f6
- #121212
- #1E1E1E
- #bdbdbd
+ #212121
+ #757575
+ #bdbdbd
- #212121
- #e0e0e0
+
+
+
- #313131
+
+
+
+
+
+
+
- #eeeeee
- #f5f5f5
+
+
+
+
+
+
+
#d81b60
- #9e9e9e
- #757575
+
+
#42000000
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 558062a..a2b9ca0 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -151,4 +151,6 @@
"Last updated: "
+ Enables night mode
+
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 3684f15..5e35440 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -1,7 +1,7 @@
-
-
-
-