Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
d2e9942
Doctor role has been added to the frontend code
munnokd Mar 31, 2026
711d33a
Doctor role has been added to the frontend code
munnokd Mar 31, 2026
7285e66
dded reusable loading, empty and error UI components with testing
dilmigunaratne Mar 31, 2026
68f6028
Staff Management UI Design
thisara-jayamuni Apr 1, 2026
4f66750
Staff Management Form Validation, Loaders Org Staff API Call
thisara-jayamuni Apr 3, 2026
0dab124
Merge pull request #383 from munnokd/kalp-role-based-login
KudratAroraa Apr 5, 2026
1993cf0
Staff Management Create Form, Filters and API Integration
thisara-jayamuni Apr 6, 2026
a5a1d12
Merge pull request #394 from Gopher-Industries/thisara/admin-dashboard
KudratAroraa Apr 7, 2026
b85d342
added admin dashboard overview page
Apr 12, 2026
f6c8ec5
Patient Overview page improvements and API integration
Apr 13, 2026
3960a9a
Patient management implementation
Nishiki-Asumi97 Apr 15, 2026
cb08b0f
Merge pull request #398 from Gopher-Industries/Nishiki/admin-dashboard
KudratAroraa Apr 19, 2026
c58bb80
Merge pull request #396 from Gopher-Industries/shubham/admin
KudratAroraa Apr 19, 2026
cb1d490
Merge branch 'master' into palak/patient-overview
KudratAroraa Apr 29, 2026
ae3b04f
Merge pull request #397 from Gopher-Industries/palak/patient-overview
KudratAroraa Apr 29, 2026
1383578
Fixed admin auth integration and related UI issues
Apr 29, 2026
1001765
Merge pull request #405 from Gopher-Industries/kudrat/admin-auth-back…
sakthiarajapandian27 Apr 30, 2026
1dba7f9
Merge remote-tracking branch 'origin/dilmi' into dilmi
dilmigunaratne May 11, 2026
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
3 changes: 3 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
<activity
android:name=".view.general.Homepage4nurse"
android:exported="false" />
<activity
android:name=".view.general.Homepage4doctor"
android:exported="false" />
<activity
android:name=".view.general.TaskDetailActivity"
android:exported="false" />
Expand Down
58 changes: 57 additions & 1 deletion app/src/main/java/deakin/gopher/guardian/WelcomeActivity.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,67 @@
package deakin.gopher.guardian

import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.view.View
import android.widget.Button
import deakin.gopher.guardian.components.EmptyView
import deakin.gopher.guardian.components.ErrorView
import deakin.gopher.guardian.components.LoadingView
import androidx.appcompat.app.AppCompatActivity

class WelcomeActivity : AppCompatActivity() {

private lateinit var loadingView: LoadingView
private lateinit var emptyView: EmptyView
private lateinit var errorView: ErrorView

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_welcome) // This links to your activity_welcome.xml

loadingView = findViewById(R.id.loadingView)
emptyView = findViewById(R.id.emptyView)
errorView = findViewById(R.id.errorView)

val btnShowLoading = findViewById<Button>(R.id.btnShowLoading)
val btnShowEmpty = findViewById<Button>(R.id.btnShowEmpty)
val btnShowError = findViewById<Button>(R.id.btnShowError)
val btnHideAll = findViewById<Button>(R.id.btnHideAll)

btnShowLoading.setOnClickListener {
hideAllStateViews()
loadingView.show()
}

btnShowEmpty.setOnClickListener {
hideAllStateViews()
emptyView.show("No records found")
}

btnShowError.setOnClickListener {
hideAllStateViews()
errorView.show("Failed to load data")
}

btnHideAll.setOnClickListener {
hideAllStateViews()
}

errorView.setOnRetryClick {
hideAllStateViews()
loadingView.show()

loadingView.postDelayed({
loadingView.hide()
emptyView.show("Retry completed, but no data available")
}, 2000)
}
}

private fun hideAllStateViews() {
loadingView.hide()
emptyView.hide()
errorView.hide()
}
}
}
36 changes: 36 additions & 0 deletions app/src/main/java/deakin/gopher/guardian/components/EmptyView.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package deakin.gopher.guardian.components
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.FrameLayout
import android.widget.TextView
import deakin.gopher.guardian.R

class EmptyView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null
) : FrameLayout(context, attrs) {

private val message: TextView

init {
LayoutInflater.from(context).inflate(R.layout.view_empty, this, true)
visibility = GONE
message = findViewById(R.id.emptyMessage)
}

fun setMessage(text: String) {
message.text = text
}

fun show(messageText: String? = null) {
if (messageText != null) {
message.text = messageText
}
visibility = VISIBLE
}

fun hide() {
visibility = GONE
}
}
44 changes: 44 additions & 0 deletions app/src/main/java/deakin/gopher/guardian/components/ErrorView.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package deakin.gopher.guardian.components
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.Button
import android.widget.FrameLayout
import android.widget.TextView
import deakin.gopher.guardian.R

class ErrorView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null
) : FrameLayout(context, attrs) {

private val message: TextView
private val retryButton: Button

init {
LayoutInflater.from(context).inflate(R.layout.view_error, this, true)
visibility = GONE

message = findViewById(R.id.errorMessage)
retryButton = findViewById(R.id.retryButton)
}

fun setMessage(text: String) {
message.text = text
}

fun setOnRetryClick(listener: () -> Unit) {
retryButton.setOnClickListener { listener() }
}

fun show(messageText: String? = null) {
if (messageText != null) {
message.text = messageText
}
visibility = VISIBLE
}

fun hide() {
visibility = GONE
}
}
25 changes: 25 additions & 0 deletions app/src/main/java/deakin/gopher/guardian/components/LoadingView.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package deakin.gopher.guardian.components
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.FrameLayout
import deakin.gopher.guardian.R

class LoadingView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null
) : FrameLayout(context, attrs) {

init {
LayoutInflater.from(context).inflate(R.layout.view_loading, this, true)
visibility = GONE
}

fun show() {
visibility = VISIBLE
}

fun hide() {
visibility = GONE
}
}
6 changes: 6 additions & 0 deletions app/src/main/java/deakin/gopher/guardian/model/login/Role.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,22 @@ sealed class Role(val name: String) : Serializable {
private fun readResolve(): Any = Nurse
}

data object Doctor : Role("doctor") {
private fun readResolve(): Any = Doctor
}

companion object {
private const val CARETAKER_ROLE = "caretaker"
private const val ADMIN_ROLE = "admin"
private const val NURSE_ROLE = "nurse"
private const val DOCTOR_ROLE = "doctor"

fun create(name: String): Role {
return when (name.lowercase()) {
CARETAKER_ROLE.lowercase() -> Caretaker
ADMIN_ROLE.lowercase() -> Admin
NURSE_ROLE.lowercase() -> Nurse
DOCTOR_ROLE.lowercase() -> Doctor
else -> throw IllegalArgumentException("Unknown role: $name")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.content.Intent
import deakin.gopher.guardian.model.login.Role
import deakin.gopher.guardian.view.general.Homepage4admin
import deakin.gopher.guardian.view.general.Homepage4caretaker
import deakin.gopher.guardian.view.general.Homepage4doctor
import deakin.gopher.guardian.view.general.Homepage4nurse
import deakin.gopher.guardian.view.general.LoginActivity
import deakin.gopher.guardian.view.general.PatientListActivity
Expand Down Expand Up @@ -43,6 +44,15 @@ class NavigationService(val activity: Activity) {
),
)
}

Role.Doctor -> {
activity.startActivity(
Intent(
activity.applicationContext,
Homepage4doctor::class.java,
),
)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package deakin.gopher.guardian.view.general

import android.os.Bundle
import android.widget.Button
import androidx.appcompat.app.AppCompatActivity
import deakin.gopher.guardian.R
import deakin.gopher.guardian.services.EmailPasswordAuthService

class Homepage4doctor : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_homepage4doctor)

val signOutButton: Button = findViewById(R.id.signOutButton_doctor)
signOutButton.setOnClickListener {
EmailPasswordAuthService.signOut(this)
finish()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ class MainActivity : BaseActivity() {
Role.Nurse -> {
startActivity(Intent(this@MainActivity, Homepage4nurse::class.java))
}
Role.Doctor -> {
startActivity(Intent(this@MainActivity, Homepage4doctor::class.java))
}
}
}
}
Expand Down
29 changes: 29 additions & 0 deletions app/src/main/res/layout/activity_homepage4doctor.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/welcomeDoctorText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Welcome Doctor"
android:textSize="24sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<Button
android:id="@+id/signOutButton_doctor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="Sign Out"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/welcomeDoctorText" />

</androidx.constraintlayout.widget.ConstraintLayout>
Loading
Loading