Skip to content
This repository was archived by the owner on Sep 22, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 14 additions & 23 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,15 @@
android:name="android.hardware.camera"
android:required="false" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- For reading images -->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />

<!-- For reading videos -->
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.CAMERA" />


<!-- For reading audio -->
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />

<!-- Add WRITE permissions only if necessary -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<!-- Add the permission here -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<!-- Application -->
<application
android:name=".GuardianApplication"
android:allowBackup="false"
Expand All @@ -32,11 +24,12 @@
android:label="Guardians"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:theme="@style/Theme.GopherGuardian"
android:usesCleartextTraffic="true"
tools:replace="android:allowBackup,android:label"
tools:targetApi="31"
tools:ignore="ExtraText">

<activity
android:name=".WelcomeActivity"
android:exported="false" />
Expand All @@ -45,15 +38,16 @@
android:exported="false" />
<activity
android:name=".Training2"
android:exported="false"></activity>
android:exported="false" />
<activity
android:name=".Training"
android:exported="false" />

<activity
android:name=".view.patient.patientdata.heartrate.HeartRateActivity"
android:exported="false"
android:label="@string/title_activity_heart_rate"
android:theme="@style/Theme.TeamGuardians" />
android:label="@string/title_activity_heart_rate" />

<activity
android:name=".view.general.Setting"
android:exported="false" />
Expand Down Expand Up @@ -162,16 +156,18 @@
android:exported="false" />
<activity
android:name=".view.general.AddNewPatientActivity"
android:exported="false" /> <!-- Kussay: may we need to change the start up page into login page -->
android:exported="false" />

<!-- Main entry point -->
<activity
android:name=".view.general.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity> <!-- These are here only for UI testing -->
</activity>

<activity
android:name=".view.patient.patientdata.medicaldiagnostics.MedicalDiagnosticsActivity"
android:exported="false" />
Expand All @@ -186,19 +182,15 @@
android:exported="false" />

<activity android:name=".ModulesActivity" />


<activity android:name=".Module1CoursesActivity" />
<activity android:name=".HomecareInductionActivity" />
<activity android:name=".InfectionControlActivity" />
<activity android:name=".SupportingMealtimesActivity" />


<activity android:name=".Module2CoursesActivity" />
<activity android:name=".MedicationTechniqueActivity" />
<activity android:name=".MedicationSafetyActivity" />


<activity android:name=".Module3CoursesActivity" />
<activity android:name=".InspiringLeadershipEIActivity" />
<activity android:name=".EmotionalIntelligenceCommunicationActivity" />
Expand All @@ -212,7 +204,6 @@
android:exported="false"
android:label="Patient Exercise Modules" />


<service
android:name=".model.FirebaseMessagingService"
android:exported="false">
Expand All @@ -226,6 +217,6 @@
android:resource="@array/preloaded_fonts" />

<activity android:name=".view.general.DashboardActivity"/>
</application>

</manifest>
</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import retrofit2.converter.gson.GsonConverterFactory

object RetrofitClient {
// private const val BASE_URL = "http://10.0.2.2:3000/api/v1/"
private const val BASE_URL = "https://guardian-backend-opal.vercel.app/api/v1/"
private const val BASE_URL = "https://guardian-backend-x5v6.vercel.app/api/v1/"

private val client = OkHttpClient()
private val interceptor = HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
package deakin.gopher.guardian.view.general

import android.content.Intent
import android.content.SharedPreferences
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import android.os.Bundle
import deakin.gopher.guardian.model.login.SessionManager
import deakin.gopher.guardian.model.login.SessionManager.isLoggedIn
import deakin.gopher.guardian.model.login.SessionManager.logoutUser
import deakin.gopher.guardian.model.login.SessionManager.updateLastActiveTime

abstract class BaseActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
// 🔑 Apply night mode before super.onCreate() + setContentView()
val sharedPreferences: SharedPreferences = getSharedPreferences("settings", MODE_PRIVATE)
val isNightMode: Boolean = sharedPreferences.getBoolean("night_mode", false)

if (isNightMode) {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
} else {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
}

super.onCreate(savedInstanceState)
}

override fun onResume() {
super.onResume()

// Check for user session expiry and timeout
// ✅ Session timeout logic
if (isLoggedIn) {
val lastActiveTime: Long = SessionManager.getLastActiveTime()
val currentTime = System.currentTimeMillis()
Expand Down
Loading
Loading