Compare commits

..

No commits in common. "40ea700e0bdf5790515fb0fa35ea9573f4609be0" and "c187c0579f0a147edf23c171159963872338e989" have entirely different histories.

6 changed files with 18 additions and 48 deletions

View File

@ -184,7 +184,7 @@ dependencies {
implementation "com.squareup.retrofit2:retrofit:2.9.0" implementation "com.squareup.retrofit2:retrofit:2.9.0"
implementation "com.squareup.retrofit2:converter-gson:2.9.0" implementation "com.squareup.retrofit2:converter-gson:2.9.0"
implementation "com.squareup.retrofit2:converter-scalars:2.9.0" implementation "com.squareup.retrofit2:converter-scalars:2.9.0"
implementation 'com.google.code.gson:gson:2.11.0' implementation 'com.google.code.gson:gson:2.10.1'
implementation 'org.jsoup:jsoup:1.14.3' implementation 'org.jsoup:jsoup:1.14.3'
implementation "pl.droidsonroids:jspoon:1.3.2" implementation "pl.droidsonroids:jspoon:1.3.2"
implementation "pl.droidsonroids.retrofit2:converter-jspoon:1.3.2" implementation "pl.droidsonroids.retrofit2:converter-jspoon:1.3.2"

View File

@ -58,17 +58,6 @@
-keep class com.google.android.material.tabs.** {*;} -keep class com.google.android.material.tabs.** {*;}
# Exclude AgendaCalendarView
# Preserve generic type information for EventRenderer and its subclasses
-keepclassmembers class * extends com.github.tibolte.agendacalendarview.render.EventRenderer {
<fields>;
<methods>;
}
# Keep the EventRenderer class itself and all its subclasses
-keep class com.github.tibolte.agendacalendarview.render.EventRenderer
-keep class * extends com.github.tibolte.agendacalendarview.render.EventRenderer
# ServiceLoader support # ServiceLoader support
-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {} -keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {} -keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}

View File

@ -38,7 +38,7 @@ class VulcanHebeGrades(
val column = grade.getJsonObject("Column") val column = grade.getJsonObject("Column")
val category = column.getJsonObject("Category") val category = column.getJsonObject("Category")
val categoryText = category.getString("Name") val categoryText = category.getString("Name")
val code = column.getString("Code").takeValue() val code = column.getString("Code").orNullIfEmpty()
val teacherId = getTeacherId(grade, "Creator") ?: -1 val teacherId = getTeacherId(grade, "Creator") ?: -1
val subjectId = getSubjectId(column, "Subject") ?: -1 val subjectId = getSubjectId(column, "Subject") ?: -1

View File

@ -141,6 +141,8 @@ fun String.fixWhiteSpaces() = buildString(length) {
} }
}.trimEnd() }.trimEnd()
fun String?.orNullIfEmpty(): String? = if (this.isNullOrEmpty()) null else this
fun CharSequence?.asColoredSpannable(colorInt: Int): Spannable { fun CharSequence?.asColoredSpannable(colorInt: Int): Spannable {
val spannable = SpannableString(this) val spannable = SpannableString(this)
spannable.setSpan(ForegroundColorSpan(colorInt), 0, spannable.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE) spannable.setSpan(ForegroundColorSpan(colorInt), 0, spannable.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)

View File

@ -49,6 +49,8 @@ class LessonDetailsDialog(
DialogLessonDetailsBinding.inflate(layoutInflater) DialogLessonDetailsBinding.inflate(layoutInflater)
override fun getPositiveButtonText() = R.string.close override fun getPositiveButtonText() = R.string.close
override fun getNegativeButtonText() = R.string.notes_button
override fun getNeutralButtonText() = R.string.add
private lateinit var adapter: EventListAdapter private lateinit var adapter: EventListAdapter
private val manager private val manager
@ -56,7 +58,7 @@ class LessonDetailsDialog(
private val attendanceManager private val attendanceManager
get() = app.attendanceManager get() = app.attendanceManager
fun openAddEventDialog(): Boolean { override suspend fun onNeutralClick(): Boolean {
EventManualDialog( EventManualDialog(
activity, activity,
lesson.profileId, lesson.profileId,
@ -66,7 +68,6 @@ class LessonDetailsDialog(
).show() ).show()
return NO_DISMISS return NO_DISMISS
} }
override suspend fun onShow() { override suspend fun onShow() {
if (App.devMode) if (App.devMode)
b.lessonId.visibility = View.VISIBLE b.lessonId.visibility = View.VISIBLE
@ -226,8 +227,6 @@ class LessonDetailsDialog(
addItemDecoration(SimpleDividerItemDecoration(context)) addItemDecoration(SimpleDividerItemDecoration(context))
} }
} }
@Suppress("NotifyDataSetChanged")
adapter.notifyDataSetChanged() adapter.notifyDataSetChanged()
if (events != null && events.isNotEmpty()) { if (events != null && events.isNotEmpty()) {
@ -241,6 +240,7 @@ class LessonDetailsDialog(
lesson.displayTeacherName?.let { name -> lesson.displayTeacherName?.let { name ->
lesson.displayTeacherId ?: return@let lesson.displayTeacherId ?: return@let
/*
BetterLink.attach( BetterLink.attach(
b.teacherNameView, b.teacherNameView,
teachers = mapOf(lesson.displayTeacherId!! to name), teachers = mapOf(lesson.displayTeacherId!! to name),
@ -251,9 +251,9 @@ class LessonDetailsDialog(
teachers = mapOf(lesson.displayTeacherId!! to name), teachers = mapOf(lesson.displayTeacherId!! to name),
onActionSelected = dialog::dismiss onActionSelected = dialog::dismiss
) )
*/
} }
/*
b.addEventButton.onClick { openAddEventDialog() }
b.notesButton.isVisible = showNotes b.notesButton.isVisible = showNotes
b.notesButton.setupNotesButton( b.notesButton.setupNotesButton(
activity = activity, activity = activity,
@ -261,9 +261,9 @@ class LessonDetailsDialog(
onShowListener = onShowListener, onShowListener = onShowListener,
onDismissListener = onDismissListener, onDismissListener = onDismissListener,
) )
b.legend.isVisible = showNotes b.legend.isVisible = showNotes
if (showNotes) if (showNotes)
NoteManager.setLegendText(lesson, b.legend) NoteManager.setLegendText(lesson, b.legend)
*/
} }
} }

View File

@ -398,35 +398,14 @@
tools:visibility="visible" tools:visibility="visible"
tools:listitem="@layout/event_list_item" /> tools:listitem="@layout/event_list_item" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:layout_marginTop="8dp"
android:gravity="center_horizontal"
android:orientation="horizontal">
<com.google.android.material.button.MaterialButton
android:id="@+id/addEventButton"
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="8dp"
android:text="@string/add"
app:icon="@drawable/ic_action_add"/>
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/notesButton" android:id="@+id/notesButton"
style="@style/Widget.Material3.Button.OutlinedButton.Icon" style="@style/Widget.Material3.Button.TextButton.Icon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_margin="8dp"
android:text="@string/notes_button" android:text="@string/notes_button"
app:icon="@drawable/ic_note_legacy"
android:visibility="gone"/> android:visibility="gone"/>
</LinearLayout> </LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</layout> </layout>