1
0
mirror of https://github.com/XFox111/GUTSchedule.git synced 2026-04-22 06:58:01 +03:00

- Added "Exclude military department schedule" option

This commit is contained in:
Eugene Fox
2023-03-13 13:49:58 +03:00
parent 47477dc406
commit 2f80f74b65
6 changed files with 2584 additions and 4618 deletions
@@ -23,6 +23,7 @@ namespace GUTSchedule.Droid.Activities
public static List<(string id, string name)> Faculties { get; set; } public static List<(string id, string name)> Faculties { get; set; }
public static List<(string id, string name)> Groups { get; set; } public static List<(string id, string name)> Groups { get; set; }
public static bool AddGroupToTitle { get; set; } public static bool AddGroupToTitle { get; set; }
public static bool ExcludeMilitary { get; set; }
public static int SelectedCalendarIndex { get; set; } public static int SelectedCalendarIndex { get; set; }
public static int Reminder { get; set; } public static int Reminder { get; set; }
@@ -43,7 +44,7 @@ namespace GUTSchedule.Droid.Activities
Button start, end, export, applyForOccupation, validateCredential; Button start, end, export, applyForOccupation, validateCredential;
Button forDay, forWeek, forMonth, forSemester; Button forDay, forWeek, forMonth, forSemester;
Spinner faculty, course, group, reminder, calendar; Spinner faculty, course, group, reminder, calendar;
CheckBox groupTitle, authorize; CheckBox groupTitle, authorize, excludeMilitary;
TextView error; TextView error;
LinearLayout studentParams, profParams; LinearLayout studentParams, profParams;
EditText email, password; EditText email, password;
@@ -93,6 +94,7 @@ namespace GUTSchedule.Droid.Activities
groupTitle.Checked = prefs.GetBoolean("AddGroupToHeader", false); groupTitle.Checked = prefs.GetBoolean("AddGroupToHeader", false);
authorize.Checked = prefs.GetBoolean("Authorize", true); authorize.Checked = prefs.GetBoolean("Authorize", true);
excludeMilitary.Checked = prefs.GetBoolean("ExcludeMilitary", false);
email.Text = prefs.GetString("email", ""); email.Text = prefs.GetString("email", "");
password.Text = prefs.GetString("password", ""); password.Text = prefs.GetString("password", "");
@@ -165,6 +167,7 @@ namespace GUTSchedule.Droid.Activities
} }
AddGroupToTitle = groupTitle.Checked; AddGroupToTitle = groupTitle.Checked;
ExcludeMilitary = excludeMilitary.Checked;
SelectedCalendarIndex = calendar.SelectedItemPosition; SelectedCalendarIndex = calendar.SelectedItemPosition;
Reminder = (reminder.SelectedItemPosition - 1) * 5; Reminder = (reminder.SelectedItemPosition - 1) * 5;
@@ -225,6 +228,7 @@ namespace GUTSchedule.Droid.Activities
groupTitle = FindViewById<CheckBox>(Resource.Id.groupTitle); groupTitle = FindViewById<CheckBox>(Resource.Id.groupTitle);
authorize = FindViewById<CheckBox>(Resource.Id.authorization); authorize = FindViewById<CheckBox>(Resource.Id.authorization);
excludeMilitary = FindViewById<CheckBox>(Resource.Id.excludeMilitary);
studentParams = FindViewById<LinearLayout>(Resource.Id.studentParams); studentParams = FindViewById<LinearLayout>(Resource.Id.studentParams);
profParams = FindViewById<LinearLayout>(Resource.Id.professorParams); profParams = FindViewById<LinearLayout>(Resource.Id.professorParams);
@@ -268,6 +272,8 @@ namespace GUTSchedule.Droid.Activities
groupTitle.Click += (s, e) => groupTitle.Click += (s, e) =>
prefs.Edit().PutBoolean("AddGroupToHeader", groupTitle.Checked).Apply(); prefs.Edit().PutBoolean("AddGroupToHeader", groupTitle.Checked).Apply();
excludeMilitary.Click += (s, e) =>
prefs.Edit().PutBoolean("ExcludeMilitary", excludeMilitary.Checked).Apply();
forDay.Click += (s, e) => SetDate(0); forDay.Click += (s, e) => SetDate(0);
@@ -45,6 +45,9 @@ namespace GUTSchedule.Droid
{ {
foreach (Occupation item in schedule) foreach (Occupation item in schedule)
{ {
if (MainActivity.ExcludeMilitary && item.Name.ToLowerInvariant().Contains("военная подготовка"))
continue;
ContentValues eventValues = new ContentValues(); ContentValues eventValues = new ContentValues();
eventValues.Put(CalendarContract.Events.InterfaceConsts.CalendarId, Calendars[MainActivity.SelectedCalendarIndex].Id); eventValues.Put(CalendarContract.Events.InterfaceConsts.CalendarId, Calendars[MainActivity.SelectedCalendarIndex].Id);
File diff suppressed because it is too large Load Diff
@@ -230,6 +230,12 @@
android:layout_marginVertical="5dp" android:layout_marginVertical="5dp"
android:visibility="gone"/> android:visibility="gone"/>
<CheckBox
android:id="@+id/excludeMilitary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/excludeMilitary"/>
<Button <Button
android:id="@+id/export" android:id="@+id/export"
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -57,6 +57,8 @@
<string name="destinationCalendarSpinner">Конечный календарь</string> <string name="destinationCalendarSpinner">Конечный календарь</string>
<string name="excludeMilitary">Не добавлять расписание военной кафедры</string>
<string name="addScheduleButton">Добавить расписание</string> <string name="addScheduleButton">Добавить расписание</string>
<string name="copyrights">©2020 Михаил Гордеев, ИСиТ, ИСТ-942</string> <string name="copyrights">©2020 Михаил Гордеев, ИСиТ, ИСТ-942</string>
@@ -56,6 +56,8 @@
<string name="destinationCalendarSpinner">Destination calendar</string> <string name="destinationCalendarSpinner">Destination calendar</string>
<string name="excludeMilitary">Exclude military department schedule</string>
<string name="addScheduleButton">Add schedule</string> <string name="addScheduleButton">Add schedule</string>
<string name="copyrights">©2020 Michael Gordeev, IST, IST-942</string> <string name="copyrights">©2020 Michael Gordeev, IST, IST-942</string>