Skip to content

Commit

Permalink
1. Updated the UI of the App.
Browse files Browse the repository at this point in the history
2. Important Notes:
(i) Resolved the problem encountered last time.
(ii) Titles are adjusted for each page for both doctor and patient.
(iii) Font size, font color and font styles are changed for better readability.
3. No problems encountered.
  • Loading branch information
Zhiquan-Cui committed Aug 7, 2021
1 parent 06e8939 commit 97c941e
Show file tree
Hide file tree
Showing 23 changed files with 97 additions and 18 deletions.
5 changes: 4 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/src/main/java/com/example/b07project/LoginPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_login_page);

Context pageContext = this;

getSupportActionBar().setTitle("B07 Hospital App");



Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/example/b07project/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setActivityBackgroundColor(0xff4293f5, this);

getSupportActionBar().setTitle("B07 Hospital App");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;

import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.Gravity;
import android.view.MenuItem;
import android.widget.LinearLayout;
import android.widget.TextView;
Expand Down Expand Up @@ -39,6 +42,7 @@ protected void onCreate(Bundle savedInstanceState) {

ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle("See Upcoming Appointments");

DatabaseReference ref = FirebaseDatabase.getInstance().getReference();
ref.addValueEventListener(new ValueEventListener() {
Expand Down Expand Up @@ -104,7 +108,11 @@ public void onDataChange(@NonNull DataSnapshot snapshot) {
SimpleDateFormat dateFormat = new SimpleDateFormat("EEE MMM d 'at' h:mm a");
String time = dateFormat.format(date);
appointmentInfo.setText(time + " with " + pat.getName() + "\n");

Resources resource = (Resources) getBaseContext().getResources();
ColorStateList csl = (ColorStateList) resource.getColorStateList(R.color.black);
appointmentInfo.setTextColor(csl);
appointmentInfo.setTextSize(15);
appointmentInfo.setGravity(Gravity.CENTER);
layout.addView(appointmentInfo);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@

import android.content.Context;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.Gravity;
import android.view.MenuItem;
import android.widget.LinearLayout;
import android.widget.TextView;
Expand Down Expand Up @@ -39,7 +43,7 @@ protected void onCreate(Bundle savedInstanceState) {

ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);

actionBar.setTitle("See Available Time");



Expand Down Expand Up @@ -188,7 +192,11 @@ public void addTimeSlot(Date date){
SimpleDateFormat dateFormat = new SimpleDateFormat("EEE MMM d 'at' h:mm a");
String time = dateFormat.format(date);
timeSlot.setText(time + " (available) " + "\n");

Resources resource = (Resources) getBaseContext().getResources();
ColorStateList csl = (ColorStateList) resource.getColorStateList(R.color.black);
timeSlot.setTextColor(csl);
timeSlot.setTextSize(15);
timeSlot.setGravity(Gravity.CENTER);
layout.addView(timeSlot);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ protected void onCreate(Bundle savedInstanceState) {

ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle("Select Time Slots");


Intent intent = getIntent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ protected void onCreate(Bundle savedInstanceState) {

ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle("Book Appointments");

//Declaring Specialties and initializing spinner
String[] specialties = new String[] {"Any", "Cardiology", "Dermatology", "Family Medicine", "Neurology"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;

import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.Gravity;
import android.view.MenuItem;
import android.widget.LinearLayout;
import android.widget.TextView;
Expand Down Expand Up @@ -38,6 +41,7 @@ protected void onCreate(Bundle savedInstanceState) {

ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle("See Upcoming Appointments");

DatabaseReference ref = FirebaseDatabase.getInstance().getReference();
ref.addValueEventListener(new ValueEventListener() {
Expand Down Expand Up @@ -104,7 +108,11 @@ public void onDataChange(@NonNull DataSnapshot snapshot) {
SimpleDateFormat dateFormat = new SimpleDateFormat("EEE MMM d 'at' h:mm a");
String time = dateFormat.format(date);
appointmentInfo.setText(time+" with Dr."+doc.getName() + "\n");

Resources resource = (Resources) getBaseContext().getResources();
ColorStateList csl = (ColorStateList) resource.getColorStateList(R.color.black);
appointmentInfo.setTextColor(csl);
appointmentInfo.setTextSize(15);
appointmentInfo.setGravity(Gravity.CENTER);
layout.addView(appointmentInfo);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;

import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.Gravity;
import android.view.MenuItem;
import android.widget.LinearLayout;
import android.widget.TextView;
Expand Down Expand Up @@ -38,6 +41,7 @@ protected void onCreate(Bundle savedInstanceState) {

ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle("See Past Appointments");

DatabaseReference ref = FirebaseDatabase.getInstance().getReference();
ref.addValueEventListener(new ValueEventListener() {
Expand Down Expand Up @@ -96,6 +100,11 @@ public void onDataChange(@NonNull DataSnapshot snapshot) {
SimpleDateFormat formattedDate = new SimpleDateFormat("EEE MMM d 'at' h:mm a");
String time = formattedDate.format(date);
appointmentInfo.setText(time + " with Dr." + doc.getName() + "\n");
Resources resource = (Resources) getBaseContext().getResources();
ColorStateList csl = (ColorStateList) resource.getColorStateList(R.color.black);
appointmentInfo.setTextColor(csl);
appointmentInfo.setGravity(Gravity.CENTER);
appointmentInfo.setTextSize(15);
layout.addView(appointmentInfo);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_doctor);

getSupportActionBar().setTitle("My Account");

MainActivity.setActivityBackgroundColor(0xff597ea8, this);

doctor = FirebaseAuth.getInstance().getCurrentUser();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ protected void onCreate(Bundle savedInstanceState) {

ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle("See Patient Info");

LinearLayout layout = (LinearLayout) findViewById(R.id.patient_list);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ protected void onCreate(Bundle savedInstanceState) {

auth = FirebaseAuth.getInstance();
Button update_info = findViewById(R.id.add_doctor_info);
update_info.setAllCaps(false);
update_info.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_patient);

getSupportActionBar().setTitle("My Account");

MainActivity.setActivityBackgroundColor(0xf0bccbe8, this);

patient = FirebaseAuth.getInstance().getCurrentUser();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ protected void onCreate(Bundle savedInstanceState) {


Button update_info = findViewById(R.id.add_patient_info);
update_info.setAllCaps(false);
update_info.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;

import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.Gravity;
import android.view.MenuItem;
import android.widget.LinearLayout;
import android.widget.TextView;
Expand Down Expand Up @@ -35,6 +39,7 @@ protected void onCreate(Bundle savedInstanceState) {

ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle("See Visited Doctors");

DatabaseReference ref = FirebaseDatabase.getInstance().getReference();
ref.addValueEventListener(new ValueEventListener() {
Expand Down Expand Up @@ -76,6 +81,11 @@ public void onDataChange(@NonNull DataSnapshot snapshot) {
doctorName.add(doc.getName());
doctorInfo = new TextView(PatientViewVisitedDoctorsActivity.this);
doctorInfo.setText("Dr." + doc.getName() + ", specializes in " + doc.getSpecialty() + "\n");
Resources resource = (Resources) getBaseContext().getResources();
ColorStateList csl = (ColorStateList) resource.getColorStateList(R.color.black);
doctorInfo.setTextColor(csl);
doctorInfo.setGravity(Gravity.CENTER);
doctorInfo.setTextSize(15);
layout.addView(doctorInfo);
}
}
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/res/layout/activity_doctor_patient_checkup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@

<TextView
android:id="@+id/textView7"
android:textColor="@color/black"
android:textStyle="bold"
android:textSize="20sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="View the following patient information"
android:text="View the following patient information:"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/layout/activity_doctor_view_appointment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

<TextView
android:id="@+id/textView6"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
Expand Down
10 changes: 6 additions & 4 deletions app/src/main/res/layout/activity_doctor_view_availability.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@

<TextView
android:id="@+id/textView5"
android:gravity="center"
android:layout_width="205dp"
android:layout_height="33dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="center"
android:text="Here are your schedule:"
android:textSize="18sp"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/scrollView3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/layout/activity_patient_book_appointment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

<TextView
android:id="@+id/textView3"
android:textColor="@color/black"
android:textSize="18sp"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_marginStart="50dp"
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/res/layout/activity_patient_choose_doctor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="44dp"
android:layout_marginTop="35dp"
android:text="Please choose from the following doctors:"
android:textColor="@color/black"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.496"
app:layout_constraintStart_toStartOf="parent"
Expand Down
7 changes: 5 additions & 2 deletions app/src/main/res/layout/activity_patient_view_appointment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

<TextView
android:id="@+id/textView4"
android:textSize="20sp"
android:textColor="@color/black"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
Expand All @@ -19,7 +22,7 @@
<ScrollView
android:layout_width="312dp"
android:layout_height="604dp"
android:layout_marginStart="50dp"
android:layout_marginStart="40dp"
android:layout_marginTop="32dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -30,7 +33,7 @@

<LinearLayout
android:id="@+id/appointment_list"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
</ScrollView>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

<TextView
android:id="@+id/textView8"
android:textStyle="bold"
android:textColor="@color/black"
android:textSize="20sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
Expand All @@ -19,8 +22,9 @@
<ScrollView
android:layout_width="312dp"
android:layout_height="604dp"
android:layout_marginStart="50dp"
android:layout_marginStart="40dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="50dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,21 @@

<TextView
android:id="@+id/textView9"
android:textColor="@color/black"
android:textStyle="bold"
android:textSize="20sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="View the following doctors information"
android:text="View the following doctors information:"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<ScrollView
android:layout_width="306dp"
android:layout_height="489dp"
android:layout_marginStart="54dp"
android:layout_marginStart="40dp"
android:layout_marginTop="32dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
Expand Down

0 comments on commit 97c941e

Please sign in to comment.