Added a colour picker with absolute masses of bad code, version 1.2.6 (unreleased)

This commit is contained in:
Deniz Düzgören
2019-05-04 16:20:14 +02:00
parent d5b5803ba2
commit adc3f8957d
18 changed files with 1071 additions and 48 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">
+2 -2
View File
@@ -16,8 +16,8 @@ android {
applicationId "com.denizd.substitutionplan" applicationId "com.denizd.substitutionplan"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 28 targetSdkVersion 28
versionCode 10 versionCode 11
versionName "1.2.5" versionName "1.2.6"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
buildTypes { buildTypes {
@@ -1,5 +1,8 @@
package com.denizd.substitutionplan; package com.denizd.substitutionplan;
import android.content.SharedPreferences;
import android.graphics.PorterDuff;
import android.preference.PreferenceManager;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@@ -10,6 +13,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
public class CardAdapter extends RecyclerView.Adapter<CardAdapter.CardViewHolder> { public class CardAdapter extends RecyclerView.Adapter<CardAdapter.CardViewHolder> {
@@ -50,6 +54,7 @@ public class CardAdapter extends RecyclerView.Adapter<CardAdapter.CardViewHolder
@Override @Override
public void onBindViewHolder(@NonNull CardViewHolder holder, int position) { public void onBindViewHolder(@NonNull CardViewHolder holder, int position) {
Subst currentItem = mSubst.get(position); Subst currentItem = mSubst.get(position);
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(holder.mImageView.getContext());
holder.mImageView.setImageResource(currentItem.getIcon()); holder.mImageView.setImageResource(currentItem.getIcon());
@@ -59,6 +64,342 @@ public class CardAdapter extends RecyclerView.Adapter<CardAdapter.CardViewHolder
holder.mCourse.setText(currentItem.getCourse()); holder.mCourse.setText(currentItem.getCourse());
holder.mRoom.setText(currentItem.getRoom()); holder.mRoom.setText(currentItem.getRoom());
holder.mAdditional.setText(currentItem.getAdditional()); holder.mAdditional.setText(currentItem.getAdditional());
String colorChecker = holder.mCourse.getText().toString().toLowerCase();
if (colorChecker.contains("deu") || colorChecker.contains("dep") || colorChecker.contains("daz")) {
if (prefs.getInt("colGerman", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colGerman", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colGerman", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("mat") || colorChecker.contains("map")) {
if (prefs.getInt("colMaths", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colMaths", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colMaths", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("eng") || colorChecker.contains("enp") || colorChecker.contains("ena")) {
if (prefs.getInt("colEnglish", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colEnglish", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colEnglish", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("spo") || colorChecker.contains("spp") || colorChecker.contains("spth")) {
if (prefs.getInt("colPhysEd", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colPhysEd", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colPhysEd", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("pol") || colorChecker.contains("pop")) {
if (prefs.getInt("colPolitics", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colPolitics", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colPolitics", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("dar") || colorChecker.contains("dap")) {
if (prefs.getInt("colTheatre", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colTheatre", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colTheatre", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("phy") || colorChecker.contains("php")) {
if (prefs.getInt("colPhysics", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colPhysics", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colPhysics", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("bio") || colorChecker.contains("bip") || colorChecker.contains("nw")) {
if (prefs.getInt("colBiology", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colBiology", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colBiology", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("che") || colorChecker.contains("chp")) {
if (prefs.getInt("colChemistry", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colChemistry", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colChemistry", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("phi") || colorChecker.contains("psp")) {
if (prefs.getInt("colPhilosophy", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colPhilosophy", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colPhilosophy", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("laa") || colorChecker.contains("laf") || colorChecker.contains("lat")) {
if (prefs.getInt("colLatin", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colLatin", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colLatin", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("spa") || colorChecker.contains("spf")) {
if (prefs.getInt("colSpanish", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colSpanish", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colSpanish", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("fra") || colorChecker.contains("frf") || colorChecker.contains("frz")) {
if (prefs.getInt("colFrench", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colFrench", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colFrench", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("inf")) {
if (prefs.getInt("colCompSci", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colCompSci", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colCompSci", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("ges")) {
if (prefs.getInt("colHistory", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colHistory", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colHistory", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("rel")) {
if (prefs.getInt("colReligion", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colReligion", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colReligion", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("geg") || colorChecker.contains("wuk")) {
if (prefs.getInt("colGeography", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colGeography", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colGeography", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("kun")) {
if (prefs.getInt("colArts", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colArts", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colArts", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("mus")) {
if (prefs.getInt("colMusic", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colMusic", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colMusic", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("tue")) {
if (prefs.getInt("colTurkish", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colTurkish", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colTurkish", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("chi")) {
if (prefs.getInt("colChinese", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colChinese", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colChinese", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("gll")) {
if (prefs.getInt("colGLL", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colGLL", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colGLL", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("wat")) {
if (prefs.getInt("colWAT", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colWAT", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colWAT", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("för")) {
if (prefs.getInt("colForder", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colForder", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colForder", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else if (colorChecker.contains("wp") || colorChecker.contains("met")) {
if (prefs.getInt("colWP", 0) != 0) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colWP", 0)));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), prefs.getInt("colWP", 0)));
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} else {
if (prefs.getInt("themeInt", 0) == 1) {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lightgrey));
} else {
holder.mImageView.getDrawable().setTint(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
holder.mCourse.setTextColor(ContextCompat.getColor(holder.mImageView.getContext(), R.color.lessdark));
}
}
} }
@Override @Override
@@ -24,6 +24,7 @@ import android.view.animation.Animation;
import android.view.animation.AnimationUtils; import android.view.animation.AnimationUtils;
import android.view.animation.LayoutAnimationController; import android.view.animation.LayoutAnimationController;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.TextView;
import org.jsoup.Jsoup; import org.jsoup.Jsoup;
import org.jsoup.nodes.Document; import org.jsoup.nodes.Document;
@@ -98,6 +98,11 @@ public class FragmentPlan extends Fragment {
// recyclerView.setLayoutAnimation(animationOut); // recyclerView.setLayoutAnimation(animationOut);
// recyclerView.scheduleLayoutAnimation(); // recyclerView.scheduleLayoutAnimation();
mAdapter.setSubst(substs); mAdapter.setSubst(substs);
for (int i = 0; i < mAdapter.getItemCount(); i++) {
}
// recyclerView.setLayoutAnimation(animationIn); // recyclerView.setLayoutAnimation(animationIn);
recyclerView.scheduleLayoutAnimation(); recyclerView.scheduleLayoutAnimation();
bottomSheetText.setText(prefs.getString("informational", getString(R.string.noinfo))); bottomSheetText.setText(prefs.getString("informational", getString(R.string.noinfo)));
@@ -1,6 +1,7 @@
package com.denizd.substitutionplan; package com.denizd.substitutionplan;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Resources; import android.content.res.Resources;
@@ -14,6 +15,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.browser.customtabs.CustomTabsIntent; import androidx.browser.customtabs.CustomTabsIntent;
import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import android.text.Editable; import android.text.Editable;
@@ -27,20 +29,24 @@ import android.widget.CheckBox;
import android.widget.CompoundButton; import android.widget.CompoundButton;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.Switch; import android.widget.Switch;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import com.google.android.material.button.MaterialButton;
import com.jaredrummler.android.device.DeviceName; import com.jaredrummler.android.device.DeviceName;
import org.w3c.dom.Text;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.Random; import java.util.Random;
public class FragmentSettings extends Fragment { public class FragmentSettings extends Fragment implements View.OnClickListener {
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
private int cs = 7; private int cs = 7, i = 0;
private String manufacturer, name, model; private String manufacturer, name, model;
@Nullable @Nullable
@@ -71,6 +77,7 @@ public class FragmentSettings extends Fragment {
final EditText txtName = getView().findViewById(R.id.txtName); final EditText txtName = getView().findViewById(R.id.txtName);
final Switch greeting = getView().findViewById(R.id.switchDisableGreeting); final Switch greeting = getView().findViewById(R.id.switchDisableGreeting);
final Switch darkmode = getView().findViewById(R.id.switchDark); final Switch darkmode = getView().findViewById(R.id.switchDark);
final LinearLayout customiseColours = getView().findViewById(R.id.btnCustomiseColours);
final EditText txtClasses = getView().findViewById(R.id.txtClasses); final EditText txtClasses = getView().findViewById(R.id.txtClasses);
final EditText txtCourses = getView().findViewById(R.id.txtCourses); final EditText txtCourses = getView().findViewById(R.id.txtCourses);
@@ -186,6 +193,292 @@ public class FragmentSettings extends Fragment {
} }
}); });
final String[] coursesNoLang = {"German", "Maths", "English", "PhysEd", "Politics", "Theatre",
"Physics", "Biology", "Chemistry", "Philosophy", "Latin", "Spanish", "French", "CompSci",
"History", "Religion", "Geography", "Arts", "Music", "Turkish", "Chinese", "GLL", "WAT", "Forder", "WP"};
final String[] courses = {getString(R.string.courseDeu), getString(R.string.courseMat), getString(R.string.courseEng),
getString(R.string.courseSpo), getString(R.string.coursePol), getString(R.string.courseDar),
getString(R.string.coursePhy), getString(R.string.courseBio), getString(R.string.courseChe),
getString(R.string.coursePhi), getString(R.string.courseLat), getString(R.string.courseSpa),
getString(R.string.courseFra), getString(R.string.courseInf), getString(R.string.courseGes),
getString(R.string.courseRel), getString(R.string.courseGeg), getString(R.string.courseKun),
getString(R.string.courseMus), getString(R.string.courseTue), getString(R.string.courseChi),
getString(R.string.courseGll), getString(R.string.courseWat), getString(R.string.courseFor),
getString(R.string.courseWp)};
final int[] coursesIcons = {R.drawable.ic_german, R.drawable.ic_maths, R.drawable.ic_english,
R.drawable.ic_pe, R.drawable.ic_politics, R.drawable.ic_drama, R.drawable.ic_physics,
R.drawable.ic_biology, R.drawable.ic_chemistry, R.drawable.ic_philosophy, R.drawable.ic_latin,
R.drawable.ic_spanish, R.drawable.ic_french, R.drawable.ic_compsci, R.drawable.ic_history,
R.drawable.ic_religion, R.drawable.ic_geography, R.drawable.ic_arts, R.drawable.ic_music,
R.drawable.ic_turkish, R.drawable.ic_chinese, R.drawable.ic_gll, R.drawable.ic_wat,
R.drawable.ic_help, R.drawable.ic_pencil};
customiseColours.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final AlertDialog.Builder alertDialog;
if (prefs.getInt("themeInt", 0) == 1) {
alertDialog = new AlertDialog.Builder(getContext(), R.style.AlertDialogCustomDark);
} else {
alertDialog = new AlertDialog.Builder(getContext(), R.style.AlertDialogCustomLight);
}
alertDialog.setTitle(getString(R.string.customisecolor1));
View dialogView = LayoutInflater.from(getContext()).inflate(R.layout.empty_dialog, null);
LinearLayout emptyLayout = dialogView.findViewById(R.id.empty_linearlayout);
for (i = 0; i < coursesNoLang.length; i++) {
View item = LayoutInflater.from(getContext()).inflate(R.layout.list_item, null);
TextView itemText = item.findViewById(R.id.item_text);
ImageView itemImage = item.findViewById(R.id.item_image);
LinearLayout layout = item.findViewById(R.id.item_layout);
itemText.setText(courses[i]);
itemImage.setImageDrawable(getResources().getDrawable(coursesIcons[i]));
final String title = courses[i];
final String titleNoLang = coursesNoLang[i];
if (prefs.getInt("col" + titleNoLang, 0) != 0) {
itemText.setTextColor(ContextCompat.getColor(getContext(), prefs.getInt("col" + titleNoLang, 0)));
itemImage.getDrawable().setTint(ContextCompat.getColor(getContext(), prefs.getInt("col" + titleNoLang, 0)));
}
layout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final AlertDialog.Builder alertDialog;
if (prefs.getInt("themeInt", 0) == 1) {
alertDialog = new AlertDialog.Builder(getContext(), R.style.AlertDialogCustomDark);
} else {
alertDialog = new AlertDialog.Builder(getContext(), R.style.AlertDialogCustomLight);
}
alertDialog.setTitle(title);
View dialogView = LayoutInflater.from(getContext()).inflate(R.layout.empty_dialog, null);
LinearLayout emptyLayout = dialogView.findViewById(R.id.empty_linearlayout);
View picker = LayoutInflater.from(getContext()).inflate(R.layout.colour_picker, null);
emptyLayout.addView(picker);
alertDialog.setView(dialogView);
final AlertDialog dialog = alertDialog.create();
dialog.show();
MaterialButton red = picker.findViewById(R.id.colourRed);
MaterialButton pink = picker.findViewById(R.id.colourPink);
MaterialButton purple = picker.findViewById(R.id.colourPurple);
MaterialButton deeppurple = picker.findViewById(R.id.colourDeepPurple);
MaterialButton lavender = picker.findViewById(R.id.colourLavender);
MaterialButton indigo = picker.findViewById(R.id.colourIndigo);
MaterialButton blue = picker.findViewById(R.id.colourBlue);
MaterialButton lightblue = picker.findViewById(R.id.colourLightBlue);
MaterialButton teal = picker.findViewById(R.id.colourTeal);
MaterialButton green = picker.findViewById(R.id.colourGreen);
MaterialButton yellow = picker.findViewById(R.id.colourYellow);
MaterialButton orange = picker.findViewById(R.id.colourOrange);
MaterialButton neonred = picker.findViewById(R.id.colourNeonRed);
MaterialButton neonpink = picker.findViewById(R.id.colourNeonPink);
MaterialButton neonpurple = picker.findViewById(R.id.colourNeonPurple);
MaterialButton neondeeppurple = picker.findViewById(R.id.colourNeonDeepPurple);
MaterialButton neonblue = picker.findViewById(R.id.colourNeonBlue);
MaterialButton neongreen = picker.findViewById(R.id.colourNeonGreen);
MaterialButton neonyellow = picker.findViewById(R.id.colourNeonYellow);
MaterialButton neonorange = picker.findViewById(R.id.colourNeonOrange);
MaterialButton nocolour = picker.findViewById(R.id.colourNone);
red.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("col" + titleNoLang, R.color.red);
edit.apply();
dialog.dismiss();
}
});
pink.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("col" + titleNoLang, R.color.pink);
edit.apply();
dialog.dismiss();
}
});
purple.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("col" + titleNoLang, R.color.purple);
edit.apply();
dialog.dismiss();
}
});
deeppurple.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("col" + titleNoLang, R.color.deeppurple);
edit.apply();
dialog.dismiss();
}
});
lavender.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("col" + titleNoLang, R.color.lavender);
edit.apply();
dialog.dismiss();
}
});
indigo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("col" + titleNoLang, R.color.indigo);
edit.apply();
dialog.dismiss();
}
});
blue.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("col" + titleNoLang, R.color.blue);
edit.apply();
dialog.dismiss();
}
});
lightblue.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("col" + titleNoLang, R.color.lightblue);
edit.apply();
dialog.dismiss();
}
});
teal.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("col" + titleNoLang, R.color.teal);
edit.apply();
dialog.dismiss();
}
});
green.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("col" + titleNoLang, R.color.green);
edit.apply();
dialog.dismiss();
}
});
yellow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("col" + titleNoLang, R.color.yellow);
edit.apply();
dialog.dismiss();
}
});
orange.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("col" + titleNoLang, R.color.orange);
edit.apply();
dialog.dismiss();
}
});
neonred.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("col" + titleNoLang, R.color.neonred);
edit.apply();
dialog.dismiss();
}
});
neonpink.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("col" + titleNoLang, R.color.neonpink);
edit.apply();
dialog.dismiss();
}
});
neonpurple.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("col" + titleNoLang, R.color.neonpurple);
edit.apply();
dialog.dismiss();
}
});
neondeeppurple.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("col" + titleNoLang, R.color.neondeeppurple);
edit.apply();
dialog.dismiss();
}
});
neonblue.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("col" + titleNoLang, R.color.neonblue);
edit.apply();
dialog.dismiss();
}
});
neongreen.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("col" + titleNoLang, R.color.neongreen);
edit.apply();
dialog.dismiss();
}
});
neonyellow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("col" + titleNoLang, R.color.neonyellow);
edit.apply();
dialog.dismiss();
}
});
neonorange.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("col" + titleNoLang, R.color.neonorange);
edit.apply();
dialog.dismiss();
}
});
nocolour.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("col" + titleNoLang, 0);
edit.apply();
dialog.dismiss();
}
});
}
});
emptyLayout.addView(item);
}
View button = LayoutInflater.from(getContext()).inflate(R.layout.forever_alone_button, null);
MaterialButton buttonclearallcolours = button.findViewById(R.id.buttonclearallcolours);
emptyLayout.addView(button);
alertDialog.setView(dialogView);
final AlertDialog dialog = alertDialog.create();
buttonclearallcolours.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
for (String courses : coursesNoLang) {
edit.putInt("col" + courses, 0);
}
edit.apply();
Toast.makeText(getActivity(), getString(R.string.allcolourscleared),
Toast.LENGTH_LONG).show();
dialog.cancel();
}
});
// alertDialog.setPositiveButton(R.string.finish, null);
dialog.show();
}
});
// ------
txtClasses.setText(prefs.getString("classes", "")); txtClasses.setText(prefs.getString("classes", ""));
txtCourses.setText(prefs.getString("courses", "")); txtCourses.setText(prefs.getString("courses", ""));
@@ -637,7 +930,7 @@ public class FragmentSettings extends Fragment {
case "@NOTIFICATION": { case "@NOTIFICATION": {
edit.putString("time", ""); edit.putString("time", "");
edit.apply(); edit.apply();
Toast.makeText(getActivity(), "Dummy notification sent", Toast.makeText(getActivity(), "Notification time cleared",
Toast.LENGTH_LONG).show(); Toast.LENGTH_LONG).show();
break; break;
} }
@@ -667,4 +960,10 @@ public class FragmentSettings extends Fragment {
"\n\nDevice Model: " + model + "\n\nDevice Model: " + model +
"\n\nAndroid Version: " + Build.VERSION.RELEASE); "\n\nAndroid Version: " + Build.VERSION.RELEASE);
} }
@Override
public void onClick(View v) {
switch (v.getId()) {
}
}
} }
@@ -270,7 +270,7 @@ public class ScheduledJobService extends JobService {
if (!notifText.isEmpty()) { if (!notifText.isEmpty()) {
Notification notification = null; Notification notification = null;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
notification = new NotificationCompat.Builder(mContext) notification = new NotificationCompat.Builder(mContext) // TODO switch out the deprecated notification delivery method
// .setContentTitle(getString(R.string.subst)) // .setContentTitle(getString(R.string.subst))
// .setStyle(new NotificationCompat.BigTextStyle() // .setStyle(new NotificationCompat.BigTextStyle()
// .bigText(notifText)) // .bigText(notifText))
+2 -1
View File
@@ -13,7 +13,8 @@
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:scrollbars="vertical">
<LinearLayout <LinearLayout
android:id="@+id/bottom_sheet_linear" android:id="@+id/bottom_sheet_linear"
+173
View File
@@ -0,0 +1,173 @@
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingBottom="8dp">
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.button.MaterialButton
android:id="@+id/colourRed"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/red"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/colourPink"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/pink"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/colourPurple"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/purple"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/colourDeepPurple"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/deeppurple"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.button.MaterialButton
android:id="@+id/colourLavender"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/lavender"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/colourIndigo"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/indigo"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/colourBlue"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/blue"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/colourLightBlue"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/lightblue"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.button.MaterialButton
android:id="@+id/colourTeal"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/teal"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/colourGreen"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/green"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/colourYellow"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/yellow"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/colourOrange"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/orange"/>
</TableRow>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/neoncolours"
android:textColor="?attr/colorText"
android:layout_marginStart="8dp"/>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.button.MaterialButton
android:id="@+id/colourNeonRed"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/neonred"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/colourNeonPink"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/neonpink"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/colourNeonPurple"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/neonpurple"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/colourNeonDeepPurple"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/neondeeppurple"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.button.MaterialButton
android:id="@+id/colourNeonBlue"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/neonblue"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/colourNeonGreen"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/neongreen"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/colourNeonYellow"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/neonyellow"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/colourNeonOrange"
android:layout_margin="8dp"
android:layout_weight="1"
android:backgroundTint="@color/neonorange"/>
</TableRow>
<com.google.android.material.button.MaterialButton
android:id="@+id/colourNone"
android:layout_margin="8dp"
android:backgroundTint="?attr/colorText"
android:text="@string/clearcolour"
android:textColor="?attr/colorBackground"/>
</TableLayout>
+47 -4
View File
@@ -129,6 +129,43 @@
app:layout_constraintStart_toStartOf="@+id/txtDark" app:layout_constraintStart_toStartOf="@+id/txtDark"
app:layout_constraintTop_toTopOf="@+id/txtDark" /> app:layout_constraintTop_toTopOf="@+id/txtDark" />
<TextView
android:id="@+id/txtCustomiseColours1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/customisecolor1"
android:textColor="?attr/colorText"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="@+id/txtRestart"
app:layout_constraintTop_toBottomOf="@+id/txtRestart" />
<TextView
android:id="@+id/txtCustomiseColours2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/customisecolor2"
android:textColor="?attr/colorHint"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="@+id/txtCustomiseColours1"
app:layout_constraintTop_toBottomOf="@+id/txtCustomiseColours1" />
<LinearLayout
android:id="@+id/btnCustomiseColours"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="0dp"
android:layout_marginBottom="16dp"
android:clickable="true"
android:focusable="true"
style="@style/SelectableItemBackground"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@+id/txtFilter"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txtRestart" />
<TextView <TextView
android:id="@+id/txtFilter" android:id="@+id/txtFilter"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@@ -138,7 +175,7 @@
android:text="@string/filter" android:text="@string/filter"
android:textColor="?attr/colorAccent" android:textColor="?attr/colorAccent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/switchDark" /> app:layout_constraintTop_toBottomOf="@+id/txtCustomiseColours2" />
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/txtLayoutClasses" android:id="@+id/txtLayoutClasses"
@@ -404,6 +441,7 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:clickable="true" android:clickable="true"
android:focusable="true"
style="@style/SelectableItemBackground" style="@style/SelectableItemBackground"
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="@+id/txtWeb" app:layout_constraintBottom_toBottomOf="@+id/txtWeb"
@@ -440,6 +478,7 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:clickable="true" android:clickable="true"
android:focusable="true"
style="@style/SelectableItemBackground" style="@style/SelectableItemBackground"
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@+id/txtTerms" app:layout_constraintBottom_toTopOf="@+id/txtTerms"
@@ -473,9 +512,10 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="0dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:clickable="true" android:clickable="true"
android:focusable="true"
style="@style/SelectableItemBackground" style="@style/SelectableItemBackground"
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@+id/txtPrivacyP" app:layout_constraintBottom_toTopOf="@+id/txtPrivacyP"
@@ -509,9 +549,10 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="0dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:clickable="true" android:clickable="true"
android:focusable="true"
style="@style/SelectableItemBackground" style="@style/SelectableItemBackground"
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@+id/txtVersion" app:layout_constraintBottom_toTopOf="@+id/txtVersion"
@@ -545,9 +586,10 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="0dp"
android:layout_marginBottom="56dp" android:layout_marginBottom="56dp"
android:clickable="true" android:clickable="true"
android:focusable="true"
style="@style/SelectableItemBackground" style="@style/SelectableItemBackground"
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@+id/btnHiddenENP" app:layout_constraintBottom_toTopOf="@+id/btnHiddenENP"
@@ -575,6 +617,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:clickable="true" android:clickable="true"
android:focusable="false"
style="@style/SelectableItemBackground" style="@style/SelectableItemBackground"
android:backgroundTint="@android:color/transparent" android:backgroundTint="@android:color/transparent"
app:layout_constraintBottom_toBottomOf="@+id/txtMeee" app:layout_constraintBottom_toBottomOf="@+id/txtMeee"
+13 -7
View File
@@ -6,11 +6,16 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:backgroundTint="?attr/colorBackgroundCard" android:backgroundTint="?attr/colorBackgroundCard"
app:strokeColor="?attr/colorAccent" app:cardCornerRadius="4dp"
app:strokeWidth="0dp" android:clickable="true"
app:cardCornerRadius="0dp" android:focusable="true"
app:cardUseCompatPadding="true" android:layout_marginStart="4dp"
android:clickable="true"> android:layout_marginEnd="4dp"
android:layout_marginTop="1dp"
android:layout_marginBottom="1dp"
app:cardElevation="1dp">
<!--app:cardUseCompatPadding="true"-->
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -94,11 +99,12 @@
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:tint="?attr/colorText"
app:layout_constraintBottom_toTopOf="@+id/room" app:layout_constraintBottom_toTopOf="@+id/room"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/group" app:layout_constraintTop_toBottomOf="@+id/group"
tools:srcCompat="@tools:sample/avatars" /> android:tint="?attr/colorText"/>
<!--tools:srcCompat="@tools:sample/avatars"-->
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
+25
View File
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp">
<LinearLayout
android:id="@+id/empty_linearlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="0dp"
android:paddingEnd="0dp"
android:paddingBottom="0dp"
android:paddingTop="8dp"
android:orientation="vertical">
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.button.MaterialButton
android:id="@+id/buttonclearallcolours"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="?attr/colorText"
android:textColor="?attr/colorBackground"
android:text="@string/clearall"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"/>
</LinearLayout>
+24 -29
View File
@@ -1,37 +1,32 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <com.google.android.material.card.MaterialCardView android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" android:backgroundTint="?attr/colorBackgroundCard"
android:layout_width="match_parent" android:layout_height="wrap_content" app:cardCornerRadius="4dp"
android:paddingLeft="0dp" android:clickable="true"
android:paddingRight="0dp"> android:focusable="true"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_marginTop="1dp"
android:layout_marginBottom="1dp"
app:cardElevation="1dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.google.android.material.card.MaterialCardView <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:backgroundTint="?attr/colorBackgroundCard"
app:strokeColor="?attr/colorAccent"
app:strokeWidth="0dp"
app:cardCornerRadius="0dp"
app:cardUseCompatPadding="true"
android:clickable="true">
<LinearLayout <TextView
android:id="@+id/cardInfoText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:textColor="?attr/colorText"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"/>
<TextView </LinearLayout>
android:id="@+id/cardInfoText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?attr/colorText"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"/>
</LinearLayout> </com.google.android.material.card.MaterialCardView>
</com.google.android.material.card.MaterialCardView>
</LinearLayout>
+24
View File
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
style="@style/SelectableItemBackground"
android:id="@+id/item_layout">
<ImageView
android:id="@+id/item_image"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_margin="16dp"
android:tint="?attr/colorText"/>
<TextView
android:id="@+id/item_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/colorText"
android:layout_gravity="center_vertical"/>
</LinearLayout>
+32
View File
@@ -92,4 +92,36 @@
<string name="orbuy">Oder kauf dir ein gutes Smartphone</string> <string name="orbuy">Oder kauf dir ein gutes Smartphone</string>
<string name="chinaTitle">Informationen bezüglich deines Gerätes</string> <string name="chinaTitle">Informationen bezüglich deines Gerätes</string>
<string name="searchonline">Suche online</string> <string name="searchonline">Suche online</string>
<string name="customisecolor1">Benutzerdefinierte Farben</string>
<string name="customisecolor2">Farben für jedes Fach einstellen</string>
<string name="courseDeu">Deutsch (+ DAZ)</string>
<string name="courseMat">Mathematik</string>
<string name="courseEng">Englisch (+ ENA)</string>
<string name="courseSpo">Sport</string>
<string name="coursePol">Politik</string>
<string name="courseDar">Darstellendes Spiel</string>
<string name="coursePhy">Physik</string>
<string name="courseBio">Biologie &amp; Naturwissenschaften</string>
<string name="courseChe">Chemie</string>
<string name="coursePhi">Philosophie</string>
<string name="courseLat">Latein</string>
<string name="courseSpa">Spanisch</string>
<string name="courseFra">Französisch</string>
<string name="courseInf">Informatik</string>
<string name="courseGes">Geschichte</string>
<string name="courseRel">Religion</string>
<string name="courseGeg">Geographie &amp; WUK</string>
<string name="courseKun">Kunst</string>
<string name="courseMus">Musik</string>
<string name="courseTue">Türkisch</string>
<string name="courseChi">Chinesisch</string>
<string name="courseGll">GLL</string>
<string name="courseWat">WAT</string>
<string name="courseFor">Förderunterricht</string>
<string name="courseWp">WP &amp; Methodenstunde</string>
<string name="neoncolours">Neonfarben</string>
<string name="clearall">Alle löschen</string>
<string name="allcolourscleared">Farben für alle Kurse wurden gelöscht</string>
<string name="clearcolour">Farbe löschen</string>
<string name="finish">Fertigstellen</string>
</resources> </resources>
+23
View File
@@ -19,4 +19,27 @@
<color name="slighttransparency">#42000000</color> <color name="slighttransparency">#42000000</color>
<color name="red">#e53935</color>
<color name="pink">#E91E63</color>
<color name="purple">#9C27B0</color>
<color name="deeppurple">#673AB7</color>
<color name="lavender">#AB47BC</color>
<color name="indigo">#3F51B5</color>
<color name="blue">#1976D2</color>
<color name="lightblue">#2196F3</color>
<color name="teal">#009688</color>
<color name="green">#43A047</color>
<color name="yellow">#FDD835</color>
<color name="orange">#F4511E</color>
<color name="neonred">#ff1744</color>
<color name="neonpink">#F50057</color>
<color name="neonpurple">#D500F9</color>
<color name="neondeeppurple">#651FFF</color>
<color name="neonblue">#2979FF</color>
<color name="neongreen">#00E676</color>
<color name="neonyellow">#FFEA00</color>
<color name="neonorange">#FF3D00</color>
</resources> </resources>
+37
View File
@@ -105,6 +105,43 @@
<string name="searchonline">Search online</string> <string name="searchonline">Search online</string>
<string name="customisecolor1">Customise colours</string>
<string name="customisecolor2">Customise every subject individually</string>
<string name="courseDeu">German (+ as a second language)</string>
<string name="courseMat">Mathematics</string>
<string name="courseEng">English (+ for beginners)</string>
<string name="courseSpo">Physical Education</string>
<string name="coursePol">Politics</string>
<string name="courseDar">Theatre</string>
<string name="coursePhy">Physics</string>
<string name="courseBio">Biology &amp; Natural Sciences</string>
<string name="courseChe">Chemistry</string>
<string name="coursePhi">Philosophy</string>
<string name="courseLat">Latin</string>
<string name="courseSpa">Spanish</string>
<string name="courseFra">French</string>
<string name="courseInf">Computer Science</string>
<string name="courseGes">History</string>
<string name="courseRel">Religion</string>
<string name="courseGeg">Geography &amp; WUK</string>
<string name="courseKun">Arts</string>
<string name="courseMus">Music</string>
<string name="courseTue">Turkish</string>
<string name="courseChi">Chinese</string>
<string name="courseGll">GLL</string>
<string name="courseWat">WAT</string>
<string name="courseFor">Special Education</string>
<string name="courseWp">WP &amp; "Methodenstunde"</string>
<string name="neoncolours">Neon colours</string>
<string name="clearall">Clear all</string>
<string name="clearcolour">Clear colour</string>
<string name="allcolourscleared">Colours for all courses have been cleared</string>
<string name="finish">Finish</string>
<!--<string name="avhblue">AvH-Blue</string>--> <!--<string name="avhblue">AvH-Blue</string>-->
<!--<string name="rosered">AvH-Blue</string>--> <!--<string name="rosered">AvH-Blue</string>-->
<!--<string name="sunsetorange">AvH-Blue</string>--> <!--<string name="sunsetorange">AvH-Blue</string>-->