Settings fragment xml now divided by cards

This commit is contained in:
Deniz Düzgören
2019-05-23 18:08:04 +02:00
parent 8e3281db95
commit 7bbc6eee62
8 changed files with 830 additions and 801 deletions
@@ -33,9 +33,9 @@ import kotlin.collections.ArrayList
class DataFetcher(isplan: Boolean, ismenu: Boolean, isjobservice: Boolean, context: Context, application: Application, parentview: View?) : AsyncTask<Void, Void, Void>() { class DataFetcher(isplan: Boolean, ismenu: Boolean, isjobservice: Boolean, context: Context, application: Application, parentview: View?) : AsyncTask<Void, Void, Void>() {
var jobservice = isjobservice private var jobservice = isjobservice
var plan = isplan private var plan = isplan
var menu = ismenu private var menu = ismenu
/* booleans to improve performance when fetching data /* booleans to improve performance when fetching data
"plan" is required to fetch the substitution data "plan" is required to fetch the substitution data
@@ -44,35 +44,35 @@ class DataFetcher(isplan: Boolean, ismenu: Boolean, isjobservice: Boolean, conte
"jobservice" = true has no effect unless "plan" is also true "jobservice" = true has no effect unless "plan" is also true
*/ */
var mContext = context private var mContext = context
var mApplication = application private var mApplication = application
var mView = parentview private var mView = parentview
var priority = 200 private var priority = 200
var notifText = "" private var notifText = ""
var informational = "" private var informational = ""
var foodList = ArrayList<String>() private var foodList = ArrayList<String>()
lateinit var connection: URLConnection private lateinit var connection: URLConnection
lateinit var rows: Elements private lateinit var rows: Elements
lateinit var paragraphs: Elements private lateinit var paragraphs: Elements
lateinit var foodElements: Elements private lateinit var foodElements: Elements
lateinit var doc: Document private lateinit var doc: Document
lateinit var docFood: Document private lateinit var docFood: Document
var manager = mContext.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager private var manager = mContext.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
val channelId = "general" private val channelId = "general"
var channelName = mContext.getString(R.string.general) private var channelName = mContext.getString(R.string.general)
val importance = NotificationManager.IMPORTANCE_DEFAULT private val importance = NotificationManager.IMPORTANCE_DEFAULT
lateinit var channel: NotificationChannel private lateinit var channel: NotificationChannel
lateinit var notification: Notification private lateinit var notification: Notification
val prefs = PreferenceManager.getDefaultSharedPreferences(mContext) as SharedPreferences private val prefs = PreferenceManager.getDefaultSharedPreferences(mContext) as SharedPreferences
val edit = prefs.edit() as SharedPreferences.Editor private val edit = prefs.edit() as SharedPreferences.Editor
lateinit var pullToRefresh: SwipeRefreshLayout private lateinit var pullToRefresh: SwipeRefreshLayout
lateinit var progressBar: ProgressBar private lateinit var progressBar: ProgressBar
val easyPrefs = EasyPrefrences(mContext) private val easyPrefs = EasyPrefrences(mContext)
val substViewModel = SubstViewModel(mApplication) private val substViewModel = SubstViewModel(mApplication)
val oldDateFormat = "EEE, dd MMM yyyy HH:mm:ss zzz" private val oldDateFormat = "EEE, dd MMM yyyy HH:mm:ss zzz"
val newDateFormat = "yyyy-MM-dd, HH:mm:ss" private val newDateFormat = "yyyy-MM-dd, HH:mm:ss"
var sdf = SimpleDateFormat(oldDateFormat) private var sdf = SimpleDateFormat(oldDateFormat)
lateinit var d: Date private lateinit var d: Date
override fun doInBackground(vararg params: Void?): Void? { override fun doInBackground(vararg params: Void?): Void? {
@@ -608,176 +608,176 @@ public class FragmentSettings extends Fragment implements View.OnClickListener {
versionNumber.setText(BuildConfig.VERSION_NAME); versionNumber.setText(BuildConfig.VERSION_NAME);
// } // }
final LinearLayout hiddenBtn = getView().findViewById(R.id.btnHiddenENP); // final LinearLayout hiddenBtn = getView().findViewById(R.id.btnHiddenENP);
hiddenBtn.setOnClickListener(new View.OnClickListener() { // hiddenBtn.setOnClickListener(new View.OnClickListener() {
@Override // @Override
public void onClick(View view) { // public void onClick(View view) {
Toast.makeText(getActivity(), getString(R.string.bestclass), // Toast.makeText(getActivity(), getString(R.string.bestclass),
Toast.LENGTH_LONG).show(); // Toast.LENGTH_LONG).show();
}
});
hiddenBtn.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
DeviceName.with(getContext()).request(new DeviceName.Callback() {
@Override
public void onFinished(DeviceName.DeviceInfo info, Exception error) {
name = info.marketName; // "Galaxy S8+"
model = info.model; // "SM-G955W"
}
});
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);
}
View dialogView = LayoutInflater.from(getContext()).inflate(R.layout.edittext_dialog, null);
TextView title = dialogView.findViewById(R.id.textviewtitle);
title.setText(R.string.experimentalmenu);
TextView dialogText = dialogView.findViewById(R.id.dialogtext);
dialogText.setText(getString(R.string.fortest));
final EditText dialogEditText = dialogView.findViewById(R.id.dialog_edittext);
final Button dialogButton = dialogView.findViewById(R.id.dialog_button);
dialogButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
switch (dialogEditText.getText().toString()) {
case "@DIAGNOSTICS": {
AlertDialog.Builder alertDialogDev;
if (prefs.getInt("themeInt", 0) == 1) {
alertDialogDev = new AlertDialog.Builder(getContext(), R.style.AlertDialogCustomDark);
} else {
alertDialogDev = new AlertDialog.Builder(getContext(), R.style.AlertDialogCustomLight);
}
View dialogView = LayoutInflater.from(getContext()).inflate(R.layout.diagnostics_dialog, null);
TextView title = dialogView.findViewById(R.id.textviewtitle);
title.setText(R.string.diagnosticsmenu);
final TextView dialogText = dialogView.findViewById(R.id.dialogtext);
setDiagnosticsText(dialogText, prefs);
Button launch = dialogView.findViewById(R.id.btnResetLaunch);
Button notif = dialogView.findViewById(R.id.btnResetNotif);
launch.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("launchDev", 0);
edit.apply();
setDiagnosticsText(dialogText, prefs);
}
});
notif.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
edit.putInt("notificationTestNumberDev", 0);
edit.apply();
setDiagnosticsText(dialogText, prefs);
}
});
alertDialogDev.setView(dialogView);
alertDialogDev.show();
break;
}
case "2018-04-20":
try {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.youtube.com/watch?v=u8tdT5pAE34")); // SOS
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setPackage("com.google.android.youtube");
startActivity(intent);
Toast.makeText(getActivity(), getEmojiByUnicode(0x1F494),
Toast.LENGTH_LONG).show();
} catch (ActivityNotFoundException e) {
Toast.makeText(getActivity(), R.string.noyoutube, Toast.LENGTH_LONG).show();
}
break;
case "Q1 Matchmaker": {
final Random gen = new Random();
AlertDialog.Builder alertDialogDev;
if (prefs.getInt("themeInt", 0) == 1) {
alertDialogDev = new AlertDialog.Builder(getContext(), R.style.AlertDialogCustomDark);
} else {
alertDialogDev = new AlertDialog.Builder(getContext(), R.style.AlertDialogCustomLight);
}
View dialogView = LayoutInflater.from(getContext()).inflate(R.layout.dating_dialog, null);
TextView title = dialogView.findViewById(R.id.textviewtitle);
title.setText(R.string.dating);
Button datingBtn = dialogView.findViewById(R.id.dating_btn);
final TextInputEditText boyT = dialogView.findViewById(R.id.dating_txt1);
final TextInputEditText girlT = dialogView.findViewById(R.id.dating_txt2);
final CheckBox boy = dialogView.findViewById(R.id.cb1);
final CheckBox girl = dialogView.findViewById(R.id.cb2);
final TextView percentage = dialogView.findViewById(R.id.dating_txtp);
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(MiscData.boy[gen.nextInt(MiscData.boy.length)]);
// } // }
// if (girlT.getText().toString().isEmpty() || girl.isChecked()) { // });
// girlT.setText(MiscData.girl[gen.nextInt(MiscData.girl.length)]); // hiddenBtn.setOnLongClickListener(new View.OnLongClickListener() {
// @Override
// public boolean onLongClick(View v) {
// DeviceName.with(getContext()).request(new DeviceName.Callback() {
// @Override
// public void onFinished(DeviceName.DeviceInfo info, Exception error) {
// name = info.marketName; // "Galaxy S8+"
// model = info.model; // "SM-G955W"
// } // }
// for (int i = 0; i < boyT.getText().length(); i++) { // });
// boyP++; // AlertDialog.Builder alertDialog;
// } // if (prefs.getInt("themeInt", 0) == 1) {
// for (int i = 0; i < girlT.getText().length(); i++) { // alertDialog = new AlertDialog.Builder(getContext(), R.style.AlertDialogCustomDark);
// 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 { // } else {
// percentage.setText(df.format(perc * (multiply / 40)) + "%"); // alertDialog = new AlertDialog.Builder(getContext(), R.style.AlertDialogCustomLight);
// } // }
// } catch (NullPointerException e) { // View dialogView = LayoutInflater.from(getContext()).inflate(R.layout.edittext_dialog, null);
// Toast.makeText(getActivity(), getString(R.string.error), // TextView title = dialogView.findViewById(R.id.textviewtitle);
// title.setText(R.string.experimentalmenu);
// TextView dialogText = dialogView.findViewById(R.id.dialogtext);
// dialogText.setText(getString(R.string.fortest));
// final EditText dialogEditText = dialogView.findViewById(R.id.dialog_edittext);
// final Button dialogButton = dialogView.findViewById(R.id.dialog_button);
// dialogButton.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// switch (dialogEditText.getText().toString()) {
// case "@DIAGNOSTICS": {
// AlertDialog.Builder alertDialogDev;
// if (prefs.getInt("themeInt", 0) == 1) {
// alertDialogDev = new AlertDialog.Builder(getContext(), R.style.AlertDialogCustomDark);
// } else {
// alertDialogDev = new AlertDialog.Builder(getContext(), R.style.AlertDialogCustomLight);
// }
// View dialogView = LayoutInflater.from(getContext()).inflate(R.layout.diagnostics_dialog, null);
// TextView title = dialogView.findViewById(R.id.textviewtitle);
// title.setText(R.string.diagnosticsmenu);
// final TextView dialogText = dialogView.findViewById(R.id.dialogtext);
// setDiagnosticsText(dialogText, prefs);
// Button launch = dialogView.findViewById(R.id.btnResetLaunch);
// Button notif = dialogView.findViewById(R.id.btnResetNotif);
// launch.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// edit.putInt("launchDev", 0);
// edit.apply();
// setDiagnosticsText(dialogText, prefs);
// }
// });
// notif.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// edit.putInt("notificationTestNumberDev", 0);
// edit.apply();
// setDiagnosticsText(dialogText, prefs);
// }
// });
//
//
// alertDialogDev.setView(dialogView);
// alertDialogDev.show();
//
// break;
// }
// case "2018-04-20":
// try {
// Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.youtube.com/watch?v=u8tdT5pAE34")); // SOS
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// intent.setPackage("com.google.android.youtube");
// startActivity(intent);
// Toast.makeText(getActivity(), getEmojiByUnicode(0x1F494),
// Toast.LENGTH_LONG).show();
// } catch (ActivityNotFoundException e) {
// Toast.makeText(getActivity(), R.string.noyoutube, Toast.LENGTH_LONG).show();
// }
// break;
// case "Q1 Matchmaker": {
// final Random gen = new Random();
// AlertDialog.Builder alertDialogDev;
// if (prefs.getInt("themeInt", 0) == 1) {
// alertDialogDev = new AlertDialog.Builder(getContext(), R.style.AlertDialogCustomDark);
// } else {
// alertDialogDev = new AlertDialog.Builder(getContext(), R.style.AlertDialogCustomLight);
// }
// View dialogView = LayoutInflater.from(getContext()).inflate(R.layout.dating_dialog, null);
// TextView title = dialogView.findViewById(R.id.textviewtitle);
// title.setText(R.string.dating);
//
// Button datingBtn = dialogView.findViewById(R.id.dating_btn);
// final TextInputEditText boyT = dialogView.findViewById(R.id.dating_txt1);
// final TextInputEditText girlT = dialogView.findViewById(R.id.dating_txt2);
// final CheckBox boy = dialogView.findViewById(R.id.cb1);
// final CheckBox girl = dialogView.findViewById(R.id.cb2);
// final TextView percentage = dialogView.findViewById(R.id.dating_txtp);
// 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(MiscData.boy[gen.nextInt(MiscData.boy.length)]);
//// }
//// if (girlT.getText().toString().isEmpty() || girl.isChecked()) {
//// girlT.setText(MiscData.girl[gen.nextInt(MiscData.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(); // Toast.LENGTH_SHORT).show();
// } // }
Toast.makeText(getActivity(), "Deprecated", // });
Toast.LENGTH_SHORT).show(); // alertDialogDev.setView(dialogView);
} // alertDialogDev.show();
}); //
alertDialogDev.setView(dialogView); // break;
alertDialogDev.show(); // }
// case "@NOTIFICATION": {
break; // edit.putString("time", "");
} // edit.apply();
case "@NOTIFICATION": { // Toast.makeText(getActivity(), "Notification time cleared",
edit.putString("time", ""); // Toast.LENGTH_LONG).show();
edit.apply(); // break;
Toast.makeText(getActivity(), "Notification time cleared", // }
Toast.LENGTH_LONG).show(); // default:
break; // Toast.makeText(getActivity(), getString(R.string.nothinghappened),
} // Toast.LENGTH_LONG).show();
default: // break;
Toast.makeText(getActivity(), getString(R.string.nothinghappened), // }
Toast.LENGTH_LONG).show(); // }
break; // });
} // alertDialog.setView(dialogView);
} // alertDialog.show();
}); // return true;
alertDialog.setView(dialogView); // }
alertDialog.show(); // });
return true;
}
});
} }
private String getEmojiByUnicode(int unicode){ private String getEmojiByUnicode(int unicode){
@@ -5,6 +5,8 @@ class MiscData {
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 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") 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 emoji(unicode: Int): String { return String(Character.toChars(unicode)) }
fun getIcon(course: String): Int { fun getIcon(course: String): Int {
return if (course.toLowerCase().contains("deu") || course.toLowerCase().contains("dep") || course.toLowerCase().contains("daz")) { return if (course.toLowerCase().contains("deu") || course.toLowerCase().contains("dep") || course.toLowerCase().contains("daz")) {
R.drawable.ic_german R.drawable.ic_german
@@ -52,8 +52,6 @@ class SettingsFragment : Fragment(R.layout.content_settings), View.OnClickListen
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
// builder.setToolbarColor(resources.getColor(R.color.white))
val txtName = view.findViewById<TextInputEditText>(R.id.txtName) val txtName = view.findViewById<TextInputEditText>(R.id.txtName)
val txtClasses = view.findViewById<TextInputEditText>(R.id.txtClasses) val txtClasses = view.findViewById<TextInputEditText>(R.id.txtClasses)
val txtCourses = view.findViewById<TextInputEditText>(R.id.txtCourses) val txtCourses = view.findViewById<TextInputEditText>(R.id.txtCourses)
@@ -65,9 +63,7 @@ class SettingsFragment : Fragment(R.layout.content_settings), View.OnClickListen
val switchDefaultPlan = view.findViewById<Switch>(R.id.switchDefaultPlan) val switchDefaultPlan = view.findViewById<Switch>(R.id.switchDefaultPlan)
val switchOpenInfo = view.findViewById<Switch>(R.id.switchOpenInfo) val switchOpenInfo = view.findViewById<Switch>(R.id.switchOpenInfo)
val switchAutoRefresh = view.findViewById<Switch>(R.id.switchAutoRefresh) val switchAutoRefresh = view.findViewById<Switch>(R.id.switchAutoRefresh)
val versionNumber = view.findViewById<TextView>(R.id.txtVersionTwo) val versionNumber = view.findViewById<TextView>(R.id.txtVersionTwo)
val hiddenBtn = view.findViewById<LinearLayout>(R.id.btnHiddenENP)
val helpCourses = view.findViewById<ImageButton>(R.id.chipHelpCourses) val helpCourses = view.findViewById<ImageButton>(R.id.chipHelpCourses)
val helpClasses = view.findViewById<ImageButton>(R.id.chipHelpClasses) val helpClasses = view.findViewById<ImageButton>(R.id.chipHelpClasses)
@@ -134,11 +130,7 @@ class SettingsFragment : Fragment(R.layout.content_settings), View.OnClickListen
} }
}) })
hiddenBtn.setOnClickListener { btnVersion.setOnLongClickListener {
Toast.makeText(mContext, getString(R.string.bestclass), Toast.LENGTH_LONG).show()
}
hiddenBtn.setOnLongClickListener {
debugMenu() debugMenu()
} }
} }
@@ -252,6 +244,7 @@ class SettingsFragment : Fragment(R.layout.content_settings), View.OnClickListen
R.id.btnVersion -> { R.id.btnVersion -> {
if (cs > 0) { if (cs > 0) {
cs-- cs--
Toast.makeText(mContext, getString(R.string.devby), Toast.LENGTH_LONG).show()
} else { } else {
try { try {
cs = 7 cs = 7
+80 -44
View File
@@ -12,11 +12,27 @@
android:fillViewport="true" android:fillViewport="true"
android:scrollbars="vertical"> android:scrollbars="vertical">
<androidx.constraintlayout.widget.ConstraintLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layoutAnimation="@anim/layout_animation_fall_down_quick" android:layoutAnimation="@anim/layout_animation_fall_down"
android:paddingBottom="8dp"> android:paddingBottom="8dp"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="3dp"
android:layout_marginBottom="3dp"
app:cardElevation="2dp"
android:backgroundTint="@color/lightbackground"
app:cardCornerRadius="8dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView <TextView
android:id="@+id/txtPersonalise" android:id="@+id/txtPersonalise"
@@ -174,38 +190,58 @@
android:id="@+id/txtCustomiseColours2" android:id="@+id/txtCustomiseColours2"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:text="@string/customisecolor2" android:text="@string/customisecolor2"
android:textColor="@color/hintcolor" android:textColor="@color/hintcolor"
android:textSize="12sp" android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/txtCustomiseColours1" app:layout_constraintStart_toStartOf="@+id/txtCustomiseColours1"
app:layout_constraintTop_toBottomOf="@+id/txtCustomiseColours1" /> app:layout_constraintTop_toBottomOf="@+id/txtCustomiseColours1" />
<LinearLayout <LinearLayout
android:id="@+id/btnCustomiseColours" android:id="@+id/btnCustomiseColours"
style="@style/SelectableItemBackground"
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="0dp" android:layout_marginBottom="8dp"
android:layout_marginBottom="16dp"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
style="@style/SelectableItemBackground"
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintBottom_toTopOf="@+id/txtFilter" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txtHideInfo2" /> app:layout_constraintTop_toBottomOf="@+id/txtHideInfo2" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="3dp"
android:layout_marginBottom="3dp"
app:cardElevation="2dp"
android:backgroundTint="@color/lightbackground"
app:cardCornerRadius="8dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView <TextView
android:id="@+id/txtFilter" android:id="@+id/txtFilter"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="24dp" android:layout_marginTop="16dp"
android:text="@string/filter" android:text="@string/filter"
android:textColor="@color/accent" android:textColor="@color/accent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txtCustomiseColours2" /> app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/txtLayoutClasses" android:id="@+id/txtLayoutClasses"
@@ -309,34 +345,56 @@
android:id="@+id/txtNotifiedAbout" android:id="@+id/txtNotifiedAbout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:text="@string/notifiedabout" android:text="@string/notifiedabout"
android:textAlignment="textStart" android:textAlignment="textStart"
android:textColor="@color/hintcolor" android:textColor="@color/hintcolor"
android:textSize="12sp" android:textSize="12sp"
app:layout_constraintStart_toStartOf="@+id/txtNotifications" app:layout_constraintStart_toStartOf="@+id/txtNotifications"
app:layout_constraintTop_toBottomOf="@+id/txtNotifications" /> app:layout_constraintTop_toBottomOf="@+id/txtNotifications"
app:layout_constraintBottom_toBottomOf="parent"/>
<Switch <Switch
android:id="@+id/switchNotifications" android:id="@+id/switchNotifications"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:gravity="end|center" android:gravity="end|center"
app:layout_constraintBottom_toBottomOf="@+id/txtNotifiedAbout" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/txtNotifications" app:layout_constraintStart_toStartOf="@+id/txtNotifications"
app:layout_constraintTop_toTopOf="@+id/txtNotifications" /> app:layout_constraintTop_toTopOf="@+id/txtNotifications" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="3dp"
android:layout_marginBottom="3dp"
app:cardElevation="2dp"
android:backgroundTint="@color/lightbackground"
app:cardCornerRadius="8dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView <TextView
android:id="@+id/txtMisc" android:id="@+id/txtMisc"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="24dp" android:layout_marginTop="16dp"
android:text="@string/misc" android:text="@string/misc"
android:textColor="@color/accent" android:textColor="@color/accent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txtNotifiedAbout" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/txtPersonalised" android:id="@+id/txtPersonalised"
@@ -596,11 +654,13 @@
android:id="@+id/txtVersionTwo" android:id="@+id/txtVersionTwo"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:text="" android:text=""
android:textColor="@color/hintcolor" android:textColor="@color/hintcolor"
android:textSize="12sp" android:textSize="12sp"
app:layout_constraintStart_toStartOf="@+id/txtVersion" app:layout_constraintStart_toStartOf="@+id/txtVersion"
app:layout_constraintTop_toBottomOf="@+id/txtVersion" /> app:layout_constraintTop_toBottomOf="@+id/txtVersion"
app:layout_constraintBottom_toBottomOf="parent"/>
<LinearLayout <LinearLayout
android:id="@+id/btnVersion" android:id="@+id/btnVersion"
@@ -608,46 +668,22 @@
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginEnd="0dp" android:layout_marginEnd="0dp"
android:layout_marginBottom="56dp" android:layout_marginBottom="8dp"
android:clickable="true" android:clickable="true"
android:focusable="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_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txtPrivacyPTwo" /> app:layout_constraintTop_toBottomOf="@+id/txtPrivacyPTwo" />
<TextView
android:id="@+id/txtMeee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="64dp"
android:layout_marginEnd="8dp"
android:text="@string/devby"
android:textColor="@color/textcolor"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txtVersionTwo" />
<LinearLayout
android:orientation="vertical"
android:id="@+id/btnHiddenENP"
android:layout_width="0dp"
android:layout_height="0dp"
android:clickable="true"
android:focusable="false"
style="@style/SelectableItemBackground"
android:backgroundTint="@android:color/transparent"
app:layout_constraintBottom_toBottomOf="@+id/txtMeee"
app:layout_constraintEnd_toEndOf="@+id/txtMeee"
app:layout_constraintStart_toStartOf="@+id/txtMeee"
app:layout_constraintTop_toTopOf="@+id/txtMeee"/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>
-1
View File
@@ -2,7 +2,6 @@
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
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:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:backgroundTint="@color/lightbackground" android:backgroundTint="@color/lightbackground"
+2 -1
View File
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="background">#121212</color> <color name="background">#121212</color>
<color name="lightbackground">#1E1E1E</color> <!-- <color name="lightbackground">#1E1E1E</color>-->
<color name="lightbackground">#222222</color>
<color name="accent">#64b5f6</color> <color name="accent">#64b5f6</color>
<color name="textcolor">#e0e0e0</color> <color name="textcolor">#e0e0e0</color>
<color name="hintcolor">#9e9e9e</color> <color name="hintcolor">#9e9e9e</color>
-2
View File
@@ -147,8 +147,6 @@
<string name="showinfo">Show info tab in navigation bar</string> <string name="showinfo">Show info tab in navigation bar</string>
<string name="swipeindependent">Independent of swipe gesture</string> <string name="swipeindependent">Independent of swipe gesture</string>
<string name="lastupdatedK">"Last updated: "</string> <string name="lastupdatedK">"Last updated: "</string>
<string name="darkmode2">Enables night mode</string> <string name="darkmode2">Enables night mode</string>