Skip to content

Commit

Permalink
1. UI updates. Updated all screens of the app. The top bar in each sc…
Browse files Browse the repository at this point in the history
…reen is now in the same color, which increase the consistency of the UI design.

2. Adjusted the font in the view availability page for doctor and the view patient info page for doctor.
  • Loading branch information
Zhiquan-Cui committed Aug 8, 2021
1 parent 561eff9 commit 1cea1db
Show file tree
Hide file tree
Showing 18 changed files with 58 additions and 6 deletions.
1 change: 1 addition & 0 deletions .idea/misc.xml

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

4 changes: 4 additions & 0 deletions app/src/main/java/com/example/b07project/LoginPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.Log;
import android.util.Patterns;
Expand Down Expand Up @@ -67,6 +70,7 @@ protected void onCreate(Bundle savedInstanceState) {

Context pageContext = this;
getSupportActionBar().setTitle("B07 Hospital App");
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#2E5DA3")));

presenter = new Presenter(new Model(), this);

Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/com/example/b07project/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
Expand All @@ -26,6 +28,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_main);
setActivityBackgroundColor(0xff4293f5, this);
getSupportActionBar().setTitle("B07 Hospital App");
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#2E5DA3")));

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.Gravity;
import android.view.MenuItem;
Expand Down Expand Up @@ -43,6 +45,7 @@ protected void onCreate(Bundle savedInstanceState) {
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle("See Upcoming Appointments");
actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#2E5DA3")));

DatabaseReference ref = FirebaseDatabase.getInstance().getReference();
ref.addValueEventListener(new ValueEventListener() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.content.Intent;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.Gravity;
Expand Down Expand Up @@ -44,7 +45,7 @@ protected void onCreate(Bundle savedInstanceState) {
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle("See Available Time");

actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#2E5DA3")));


String doctorID = auth.getUid();
Expand Down Expand Up @@ -220,7 +221,11 @@ public void onDataChange(@NonNull DataSnapshot snapshot) {
SimpleDateFormat dateFormat = new SimpleDateFormat("EEE MMM d 'at' h:mm a");
String time = dateFormat.format(date);
timeSlot.setText("An appointment is booked at " + time + "\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);
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
Expand Down Expand Up @@ -43,7 +45,7 @@ protected void onCreate(Bundle savedInstanceState) {
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle("Select Time Slots");

actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#2E5DA3")));

Intent intent = getIntent();
String doctorID = intent.getStringExtra("doctorID");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.MenuItem;
Expand Down Expand Up @@ -39,6 +41,7 @@ protected void onCreate(Bundle savedInstanceState) {
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle("Book Appointments");
actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#2E5DA3")));

//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 @@ -6,6 +6,8 @@

import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.Gravity;
import android.view.MenuItem;
Expand Down Expand Up @@ -42,6 +44,7 @@ protected void onCreate(Bundle savedInstanceState) {
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle("See Upcoming Appointments");
actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#2E5DA3")));

DatabaseReference ref = FirebaseDatabase.getInstance().getReference();
ref.addValueEventListener(new ValueEventListener() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.Gravity;
import android.view.MenuItem;
Expand Down Expand Up @@ -42,6 +44,7 @@ protected void onCreate(Bundle savedInstanceState) {
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle("See Past Appointments");
actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#2E5DA3")));

DatabaseReference ref = FirebaseDatabase.getInstance().getReference();
ref.addValueEventListener(new ValueEventListener() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
Expand Down Expand Up @@ -35,6 +37,7 @@ protected void onCreate(Bundle savedInstanceState){
setContentView(R.layout.activity_doctor);

getSupportActionBar().setTitle("My Account");
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#2E5DA3")));

MainActivity.setActivityBackgroundColor(0xff597ea8, this);

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

import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.MenuItem;
import android.widget.LinearLayout;
import android.widget.TextView;
Expand Down Expand Up @@ -38,6 +43,7 @@ protected void onCreate(Bundle savedInstanceState) {
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle("See Patient Info");
actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#2E5DA3")));

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

Expand Down Expand Up @@ -131,6 +137,10 @@ public void onDataChange(@NonNull DataSnapshot snapshot) {
}

patientInfo.append("\n\n");
Resources resource = (Resources) getBaseContext().getResources();
ColorStateList csl = (ColorStateList) resource.getColorStateList(R.color.black);
patientInfo.setTextColor(csl);
patientInfo.setTextSize(13);
layout.addView(patientInfo);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.util.Patterns;
import android.view.Gravity;
Expand Down Expand Up @@ -46,6 +48,7 @@ protected void onCreate(Bundle savedInstanceState) {
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle("Create An Account");
actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#2E5DA3")));

String[] specialties = new String[] {"Specialty", "Cardiology", "Dermatology", "Family Medicine", "Neurology"
, "Gynecology", "Pediatrics", "Physiotherapy", "Psychiatry"};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
Expand Down Expand Up @@ -37,6 +39,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_patient);

getSupportActionBar().setTitle("My Account");
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#2E5DA3")));

MainActivity.setActivityBackgroundColor(0xf0bccbe8, this);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.util.Log;
import android.util.Patterns;
Expand Down Expand Up @@ -37,6 +39,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_patient_signup);
getSupportActionBar().setTitle("Create An Account");
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#2E5DA3")));



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.Gravity;
import android.view.MenuItem;
Expand Down Expand Up @@ -40,6 +42,7 @@ protected void onCreate(Bundle savedInstanceState) {
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle("See Visited Doctors");
actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#2E5DA3")));

DatabaseReference ref = FirebaseDatabase.getInstance().getReference();
ref.addValueEventListener(new ValueEventListener() {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_doctor_signup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
android:id="@+id/toolbar"
android:layout_width="409dp"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:background="@color/white"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,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 Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_patient_signup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
android:id="@+id/toolbar"
android:layout_width="409dp"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:background="@color/white"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
app:layout_constraintEnd_toEndOf="parent"
Expand Down

0 comments on commit 1cea1db

Please sign in to comment.