From b7bc090313b62ab1584e2953810f88371ec4c056 Mon Sep 17 00:00:00 2001 From: Skeletrobro <67814129+baronhsieh2005@users.noreply.github.com> Date: Fri, 23 Aug 2024 17:25:18 +0800 Subject: [PATCH] Final fix with widget item click set dining tab. For some reason when declared as a separate function, the tab is not set to dining when widget is clicked. --- .../com/pennapps/labs/pennmobile/GsrReservationsFragment.kt | 1 + .../labs/pennmobile/adapters/DiningHallWidgetAdapter.kt | 4 +++- .../pennapps/labs/pennmobile/viewmodels/LaundryViewModel.kt | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/PennMobile/src/main/java/com/pennapps/labs/pennmobile/GsrReservationsFragment.kt b/PennMobile/src/main/java/com/pennapps/labs/pennmobile/GsrReservationsFragment.kt index a65a597d..6dcf060c 100644 --- a/PennMobile/src/main/java/com/pennapps/labs/pennmobile/GsrReservationsFragment.kt +++ b/PennMobile/src/main/java/com/pennapps/labs/pennmobile/GsrReservationsFragment.kt @@ -131,6 +131,7 @@ class GsrReservationsFragment : Fragment() { } }) } catch (e: Exception) { + FirebaseCrashlytics.getInstance().recordException(e) e.printStackTrace() } } diff --git a/PennMobile/src/main/java/com/pennapps/labs/pennmobile/adapters/DiningHallWidgetAdapter.kt b/PennMobile/src/main/java/com/pennapps/labs/pennmobile/adapters/DiningHallWidgetAdapter.kt index a7911a00..925e3aa4 100644 --- a/PennMobile/src/main/java/com/pennapps/labs/pennmobile/adapters/DiningHallWidgetAdapter.kt +++ b/PennMobile/src/main/java/com/pennapps/labs/pennmobile/adapters/DiningHallWidgetAdapter.kt @@ -7,6 +7,7 @@ import android.graphics.Color import android.os.Bundle import android.widget.RemoteViews import android.widget.RemoteViewsService +import com.google.firebase.crashlytics.FirebaseCrashlytics import com.pennapps.labs.pennmobile.DiningHallWidget import com.pennapps.labs.pennmobile.R import com.pennapps.labs.pennmobile.api.DiningRequest @@ -131,7 +132,8 @@ class DiningHallWidgetAdapter : RemoteViewsService() { } } } catch (e: Exception) { - e.printStackTrace(); + FirebaseCrashlytics.getInstance().recordException(e) + e.printStackTrace() } } diff --git a/PennMobile/src/main/java/com/pennapps/labs/pennmobile/viewmodels/LaundryViewModel.kt b/PennMobile/src/main/java/com/pennapps/labs/pennmobile/viewmodels/LaundryViewModel.kt index a5ccc55b..d132fe59 100644 --- a/PennMobile/src/main/java/com/pennapps/labs/pennmobile/viewmodels/LaundryViewModel.kt +++ b/PennMobile/src/main/java/com/pennapps/labs/pennmobile/viewmodels/LaundryViewModel.kt @@ -77,6 +77,7 @@ class LaundryViewModel : ViewModel() { val room = roomResponse.body()!! room.id = roomId rooms.add(room) + Log.i("Laundry", "Room data fetched") true } else { Log.i("Laundry", "Failed to get room data")