mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-19 05:16:56 -06:00
[UI/Dialogs] Update Lesson Details dialog when no classroom/teacher. Fix double events when metadata duplicated for different type.
This commit is contained in:
parent
16320b4486
commit
99006d7923
@ -68,6 +68,7 @@ public abstract class EventDao {
|
|||||||
"LEFT JOIN eventTypes USING(profileId, eventType)\n" +
|
"LEFT JOIN eventTypes USING(profileId, eventType)\n" +
|
||||||
"LEFT JOIN metadata ON eventId = thingId AND (thingType = " + TYPE_EVENT + " OR thingType = " + TYPE_HOMEWORK + ") AND metadata.profileId = "+profileId+"\n" +
|
"LEFT JOIN metadata ON eventId = thingId AND (thingType = " + TYPE_EVENT + " OR thingType = " + TYPE_HOMEWORK + ") AND metadata.profileId = "+profileId+"\n" +
|
||||||
"WHERE events.profileId = "+profileId+" AND events.eventBlacklisted = 0 AND "+filter+"\n" +
|
"WHERE events.profileId = "+profileId+" AND events.eventBlacklisted = 0 AND "+filter+"\n" +
|
||||||
|
"GROUP BY eventId\n" +
|
||||||
"ORDER BY eventDate, eventStartTime ASC";
|
"ORDER BY eventDate, eventStartTime ASC";
|
||||||
Log.d("DB", query);
|
Log.d("DB", query);
|
||||||
return getAll(new SimpleSQLiteQuery(query));
|
return getAll(new SimpleSQLiteQuery(query));
|
||||||
@ -111,6 +112,7 @@ public abstract class EventDao {
|
|||||||
"LEFT JOIN eventTypes USING(profileId, eventType)\n" +
|
"LEFT JOIN eventTypes USING(profileId, eventType)\n" +
|
||||||
"LEFT JOIN metadata ON eventId = thingId AND (thingType = " + TYPE_EVENT + " OR thingType = " + TYPE_HOMEWORK + ") AND metadata.profileId = "+profileId+"\n" +
|
"LEFT JOIN metadata ON eventId = thingId AND (thingType = " + TYPE_EVENT + " OR thingType = " + TYPE_HOMEWORK + ") AND metadata.profileId = "+profileId+"\n" +
|
||||||
"WHERE events.profileId = "+profileId+" AND events.eventBlacklisted = 0 AND "+filter+"\n" +
|
"WHERE events.profileId = "+profileId+" AND events.eventBlacklisted = 0 AND "+filter+"\n" +
|
||||||
|
"GROUP BY eventId\n" +
|
||||||
"ORDER BY eventStartTime, addedDate ASC"));
|
"ORDER BY eventStartTime, addedDate ASC"));
|
||||||
}
|
}
|
||||||
public List<EventFull> getNotNotifiedNow(int profileId) {
|
public List<EventFull> getNotNotifiedNow(int profileId) {
|
||||||
|
@ -154,13 +154,13 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="8dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
android:visibility="@{teacherName != null || oldTeacherName != null ? View.VISIBLE : View.GONE}">
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="@style/NavView.TextView.Helper"
|
android:textAppearance="@style/NavView.TextView.Helper"
|
||||||
android:text="@string/dialog_lesson_details_teacher"
|
android:text="@string/dialog_lesson_details_teacher" />
|
||||||
android:visibility="@{teacherName != null || oldTeacherName != null ? View.VISIBLE : View.GONE}"/>
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -184,13 +184,13 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
android:visibility="@{teamName != null || oldTeamName != null ? View.VISIBLE : View.GONE}">
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="@style/NavView.TextView.Helper"
|
android:textAppearance="@style/NavView.TextView.Helper"
|
||||||
android:text="@string/dialog_lesson_details_team"
|
android:text="@string/dialog_lesson_details_team" />
|
||||||
android:visibility="@{teamName != null || oldTeamName != null ? View.VISIBLE : View.GONE}"/>
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -223,14 +223,14 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
android:visibility="@{classroom != null || oldClassroom != null ? View.VISIBLE : View.GONE}">
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:textAppearance="@style/NavView.TextView.Helper"
|
android:textAppearance="@style/NavView.TextView.Helper"
|
||||||
android:text="@string/dialog_lesson_details_classroom"
|
android:text="@string/dialog_lesson_details_classroom" />
|
||||||
android:visibility="@{classroom != null || oldClassroom != null ? View.VISIBLE : View.GONE}"/>
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -253,13 +253,13 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
android:visibility="@{App.devMode ? View.VISIBLE : View.GONE}">
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:textAppearance="@style/NavView.TextView.Helper"
|
android:textAppearance="@style/NavView.TextView.Helper"
|
||||||
android:visibility="@{App.devMode ? View.VISIBLE : View.GONE}"
|
|
||||||
android:text="@string/dialog_lesson_details_id" />
|
android:text="@string/dialog_lesson_details_id" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -268,7 +268,6 @@
|
|||||||
android:layout_marginTop="0dp"
|
android:layout_marginTop="0dp"
|
||||||
android:text="@{Long.toString(lesson.id)}"
|
android:text="@{Long.toString(lesson.id)}"
|
||||||
android:textIsSelectable="true"
|
android:textIsSelectable="true"
|
||||||
android:visibility="@{App.devMode ? View.VISIBLE : View.GONE}"
|
|
||||||
tools:text="12345" />
|
tools:text="12345" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user