Archived
Settings fragment xml now divided by cards
This commit is contained in:
@@ -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>() {
|
||||
|
||||
var jobservice = isjobservice
|
||||
var plan = isplan
|
||||
var menu = ismenu
|
||||
private var jobservice = isjobservice
|
||||
private var plan = isplan
|
||||
private var menu = ismenu
|
||||
|
||||
/* booleans to improve performance when fetching 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
|
||||
*/
|
||||
|
||||
var mContext = context
|
||||
var mApplication = application
|
||||
var mView = parentview
|
||||
var priority = 200
|
||||
var notifText = ""
|
||||
var informational = ""
|
||||
var foodList = ArrayList<String>()
|
||||
lateinit var connection: URLConnection
|
||||
lateinit var rows: Elements
|
||||
lateinit var paragraphs: Elements
|
||||
lateinit var foodElements: Elements
|
||||
lateinit var doc: Document
|
||||
lateinit var docFood: Document
|
||||
var manager = mContext.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||
val channelId = "general"
|
||||
var channelName = mContext.getString(R.string.general)
|
||||
val importance = NotificationManager.IMPORTANCE_DEFAULT
|
||||
lateinit var channel: NotificationChannel
|
||||
lateinit var notification: Notification
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(mContext) as SharedPreferences
|
||||
val edit = prefs.edit() as SharedPreferences.Editor
|
||||
lateinit var pullToRefresh: SwipeRefreshLayout
|
||||
lateinit var progressBar: ProgressBar
|
||||
val easyPrefs = EasyPrefrences(mContext)
|
||||
val substViewModel = SubstViewModel(mApplication)
|
||||
val oldDateFormat = "EEE, dd MMM yyyy HH:mm:ss zzz"
|
||||
val newDateFormat = "yyyy-MM-dd, HH:mm:ss"
|
||||
var sdf = SimpleDateFormat(oldDateFormat)
|
||||
lateinit var d: Date
|
||||
private var mContext = context
|
||||
private var mApplication = application
|
||||
private var mView = parentview
|
||||
private var priority = 200
|
||||
private var notifText = ""
|
||||
private var informational = ""
|
||||
private var foodList = ArrayList<String>()
|
||||
private lateinit var connection: URLConnection
|
||||
private lateinit var rows: Elements
|
||||
private lateinit var paragraphs: Elements
|
||||
private lateinit var foodElements: Elements
|
||||
private lateinit var doc: Document
|
||||
private lateinit var docFood: Document
|
||||
private var manager = mContext.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||
private val channelId = "general"
|
||||
private var channelName = mContext.getString(R.string.general)
|
||||
private val importance = NotificationManager.IMPORTANCE_DEFAULT
|
||||
private lateinit var channel: NotificationChannel
|
||||
private lateinit var notification: Notification
|
||||
private val prefs = PreferenceManager.getDefaultSharedPreferences(mContext) as SharedPreferences
|
||||
private val edit = prefs.edit() as SharedPreferences.Editor
|
||||
private lateinit var pullToRefresh: SwipeRefreshLayout
|
||||
private lateinit var progressBar: ProgressBar
|
||||
private val easyPrefs = EasyPrefrences(mContext)
|
||||
private val substViewModel = SubstViewModel(mApplication)
|
||||
private val oldDateFormat = "EEE, dd MMM yyyy HH:mm:ss zzz"
|
||||
private val newDateFormat = "yyyy-MM-dd, HH:mm:ss"
|
||||
private var sdf = SimpleDateFormat(oldDateFormat)
|
||||
private lateinit var d: Date
|
||||
|
||||
override fun doInBackground(vararg params: Void?): Void? {
|
||||
|
||||
|
||||
@@ -608,176 +608,176 @@ public class FragmentSettings extends Fragment implements View.OnClickListener {
|
||||
versionNumber.setText(BuildConfig.VERSION_NAME);
|
||||
// }
|
||||
|
||||
final LinearLayout hiddenBtn = getView().findViewById(R.id.btnHiddenENP);
|
||||
hiddenBtn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Toast.makeText(getActivity(), getString(R.string.bestclass),
|
||||
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)]);
|
||||
// }
|
||||
// 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),
|
||||
// final LinearLayout hiddenBtn = getView().findViewById(R.id.btnHiddenENP);
|
||||
// hiddenBtn.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View view) {
|
||||
// Toast.makeText(getActivity(), getString(R.string.bestclass),
|
||||
// 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)]);
|
||||
//// }
|
||||
//// 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.makeText(getActivity(), "Deprecated",
|
||||
Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
alertDialogDev.setView(dialogView);
|
||||
alertDialogDev.show();
|
||||
|
||||
break;
|
||||
}
|
||||
case "@NOTIFICATION": {
|
||||
edit.putString("time", "");
|
||||
edit.apply();
|
||||
Toast.makeText(getActivity(), "Notification time cleared",
|
||||
Toast.LENGTH_LONG).show();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
Toast.makeText(getActivity(), getString(R.string.nothinghappened),
|
||||
Toast.LENGTH_LONG).show();
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
alertDialog.setView(dialogView);
|
||||
alertDialog.show();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
// }
|
||||
// });
|
||||
// alertDialogDev.setView(dialogView);
|
||||
// alertDialogDev.show();
|
||||
//
|
||||
// break;
|
||||
// }
|
||||
// case "@NOTIFICATION": {
|
||||
// edit.putString("time", "");
|
||||
// edit.apply();
|
||||
// Toast.makeText(getActivity(), "Notification time cleared",
|
||||
// Toast.LENGTH_LONG).show();
|
||||
// break;
|
||||
// }
|
||||
// default:
|
||||
// Toast.makeText(getActivity(), getString(R.string.nothinghappened),
|
||||
// Toast.LENGTH_LONG).show();
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// alertDialog.setView(dialogView);
|
||||
// alertDialog.show();
|
||||
// return true;
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
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 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 {
|
||||
return if (course.toLowerCase().contains("deu") || course.toLowerCase().contains("dep") || course.toLowerCase().contains("daz")) {
|
||||
R.drawable.ic_german
|
||||
|
||||
@@ -52,8 +52,6 @@ class SettingsFragment : Fragment(R.layout.content_settings), View.OnClickListen
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
// builder.setToolbarColor(resources.getColor(R.color.white))
|
||||
|
||||
val txtName = view.findViewById<TextInputEditText>(R.id.txtName)
|
||||
val txtClasses = view.findViewById<TextInputEditText>(R.id.txtClasses)
|
||||
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 switchOpenInfo = view.findViewById<Switch>(R.id.switchOpenInfo)
|
||||
val switchAutoRefresh = view.findViewById<Switch>(R.id.switchAutoRefresh)
|
||||
|
||||
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 helpClasses = view.findViewById<ImageButton>(R.id.chipHelpClasses)
|
||||
@@ -134,11 +130,7 @@ class SettingsFragment : Fragment(R.layout.content_settings), View.OnClickListen
|
||||
}
|
||||
})
|
||||
|
||||
hiddenBtn.setOnClickListener {
|
||||
Toast.makeText(mContext, getString(R.string.bestclass), Toast.LENGTH_LONG).show()
|
||||
}
|
||||
|
||||
hiddenBtn.setOnLongClickListener {
|
||||
btnVersion.setOnLongClickListener {
|
||||
debugMenu()
|
||||
}
|
||||
}
|
||||
@@ -252,6 +244,7 @@ class SettingsFragment : Fragment(R.layout.content_settings), View.OnClickListen
|
||||
R.id.btnVersion -> {
|
||||
if (cs > 0) {
|
||||
cs--
|
||||
Toast.makeText(mContext, getString(R.string.devby), Toast.LENGTH_LONG).show()
|
||||
} else {
|
||||
try {
|
||||
cs = 7
|
||||
|
||||
Reference in New Issue
Block a user