mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2024-09-20 05:49:09 -05:00
[Widgets/Timetable] Show crossed out classroom in lesson change if no new classroom specified.
This commit is contained in:
parent
88ec463284
commit
faa77ee5fb
@ -47,6 +47,7 @@ class LessonDialogActivity : AppCompatActivity(), CoroutineScope {
|
|||||||
val i = Intent(app, MainActivity::class.java)
|
val i = Intent(app, MainActivity::class.java)
|
||||||
.putExtra("fragmentId", MainActivity.DRAWER_ITEM_TIMETABLE)
|
.putExtra("fragmentId", MainActivity.DRAWER_ITEM_TIMETABLE)
|
||||||
.putExtra("profileId", profileId)
|
.putExtra("profileId", profileId)
|
||||||
|
.putExtra("timetableDate", extras.getString("timetableDate", null))
|
||||||
.addFlags(FLAG_ACTIVITY_REORDER_TO_FRONT or FLAG_ACTIVITY_NEW_TASK)
|
.addFlags(FLAG_ACTIVITY_REORDER_TO_FRONT or FLAG_ACTIVITY_NEW_TASK)
|
||||||
app.startActivity(i)
|
app.startActivity(i)
|
||||||
finish()
|
finish()
|
||||||
|
@ -164,6 +164,8 @@ public class WidgetTimetableFactory implements RemoteViewsService.RemoteViewsFac
|
|||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.putExtra("profileId", lesson.profileId);
|
intent.putExtra("profileId", lesson.profileId);
|
||||||
intent.putExtra("separatorItem", true);
|
intent.putExtra("separatorItem", true);
|
||||||
|
if (lesson.lessonDate != null)
|
||||||
|
intent.putExtra("timetableDate", lesson.lessonDate.getStringY_m_d());
|
||||||
views.setOnClickFillInIntent(R.id.widgetTimetableRoot, intent);
|
views.setOnClickFillInIntent(R.id.widgetTimetableRoot, intent);
|
||||||
|
|
||||||
return views;
|
return views;
|
||||||
@ -298,7 +300,12 @@ public class WidgetTimetableFactory implements RemoteViewsService.RemoteViewsFac
|
|||||||
views.setViewVisibility(R.id.widgetTimetableOldSubjectName, View.GONE);
|
views.setViewVisibility(R.id.widgetTimetableOldSubjectName, View.GONE);
|
||||||
if (lesson.lessonChange) {
|
if (lesson.lessonChange) {
|
||||||
views.setTextViewText(R.id.widgetTimetableSubjectName, Html.fromHtml("<i>"+lesson.subjectName+"</i>"));
|
views.setTextViewText(R.id.widgetTimetableSubjectName, Html.fromHtml("<i>"+lesson.subjectName+"</i>"));
|
||||||
views.setTextViewText(R.id.widgetTimetableClassroomName, Html.fromHtml("<i>"+lesson.classroomName+"</i>"));
|
if (lesson.lessonChangeNoClassroom) {
|
||||||
|
views.setTextViewText(R.id.widgetTimetableClassroomName, Html.fromHtml("<del>"+lesson.classroomName+"</del>"));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
views.setTextViewText(R.id.widgetTimetableClassroomName, Html.fromHtml("<i>" + lesson.classroomName + "</i>"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (lesson.lessonCancelled) {
|
else if (lesson.lessonCancelled) {
|
||||||
views.setTextViewText(R.id.widgetTimetableSubjectName, Html.fromHtml("<del>"+lesson.subjectName+"</del>"));
|
views.setTextViewText(R.id.widgetTimetableSubjectName, Html.fromHtml("<del>"+lesson.subjectName+"</del>"));
|
||||||
|
@ -324,13 +324,14 @@ class WidgetTimetableProvider : AppWidgetProvider() {
|
|||||||
|
|
||||||
// make the model aware of the lesson type
|
// make the model aware of the lesson type
|
||||||
when (lesson.type) {
|
when (lesson.type) {
|
||||||
Lesson.TYPE_CANCELLED -> {
|
Lesson.TYPE_CANCELLED,
|
||||||
|
Lesson.TYPE_SHIFTED_SOURCE -> {
|
||||||
model.lessonCancelled = true
|
model.lessonCancelled = true
|
||||||
}
|
}
|
||||||
Lesson.TYPE_CHANGE,
|
Lesson.TYPE_CHANGE,
|
||||||
Lesson.TYPE_SHIFTED_SOURCE,
|
Lesson.TYPE_SHIFTED_TARGET -> {
|
||||||
Lesson.TYPE_SHIFTED_TARGET -> {
|
|
||||||
model.lessonChange = true
|
model.lessonChange = true
|
||||||
|
model.lessonChangeNoClassroom = lesson.classroom.isNullOrBlank()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ public class ItemWidgetTimetableModel {
|
|||||||
public String subjectName = "";
|
public String subjectName = "";
|
||||||
public String classroomName = "";
|
public String classroomName = "";
|
||||||
public boolean lessonChange = false;
|
public boolean lessonChange = false;
|
||||||
|
public boolean lessonChangeNoClassroom = false;
|
||||||
public String newSubjectName = null;
|
public String newSubjectName = null;
|
||||||
public String newClassroomName = null;
|
public String newClassroomName = null;
|
||||||
public boolean lessonCancelled = false;
|
public boolean lessonCancelled = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user