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