Skip to content
Open
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MEDMAPPER

The purpose of this application is to assist a user with medication administration. This application recieves input from the user about their medications and when they should be administered. The application sends alerts and reminders to the user to take their medications at the appropriate time, and logs successful administration for the user as well as other parties that the user may choose to share their information with. This will allow a user to track their medication usage, and help ensure that they are taking each medication at the appropriate time each day.
The purpose of this application is to assist a user with medication administration. This application receives input from the user about their medications and when they should be administered. The application sends alerts and reminders to the user to take their medications at the appropriate time, and logs successful administration for the user as well as other parties that the user may choose to share their information with. This will allow a user to track their medication usage, and help ensure that they are taking each medication at the appropriate time each day.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling error


STORYBOARD / MOCKUP DEMO:

Expand Down Expand Up @@ -74,7 +74,7 @@ https://github.com/jakeFarrish/MedMapper/files/10531467/ClassDescription.docx

SCRUM ROLES:

Intergration Developer: Cherissa Tan
Integration Developer: Cherissa Tan
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling error


Backend Developers: Logan Farwick, Jacob Farrish

Expand Down
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ dependencies {
implementation "androidx.compose.ui:ui-tooling-preview:$compose_ui_version"
implementation 'androidx.compose.material:material:1.3.1'
implementation 'junit:junit:4.13.2'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.android.material:material:1.8.0'
Comment on lines +58 to +59
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these used?

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
Expand Down
7 changes: 2 additions & 5 deletions app/src/main/UI.xml → app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed unused tools

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I urge caution making changes to the AndroidManifest.xml. This file describes the program. Most items are here for a reason. Are you certain they are not used? Is it a best practice to remove them?

<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
Expand All @@ -9,12 +8,10 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.MedMapper"
tools:targetApi="31">
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary; SDK_INT is always >= 31

android:theme="@style/Theme.MedMapper">
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant label can be removed

android:theme="@style/Theme.MedMapper">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
70 changes: 37 additions & 33 deletions app/src/main/java/com/medmapper/v33001/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,43 +1,47 @@
package com.medmapper.v33001

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import com.medmapper.v33001.ui.theme.MedMapperTheme

class MainActivity : ComponentActivity() {
import android.view.Menu
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager

class MainActivity : AppCompatActivity() {

private val fragmentManager: FragmentManager = supportFragmentManager

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
MedMapperTheme {
// A surface container using the 'background' color from the theme
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colors.background
) {
Greeting("Android")
}
setContentView(layoutInflater.inflate(R.layout.main_activity, null))
setSupportActionBar(findViewById(R.id.toolbar))
setFragment(ScheduleFragment())
Comment on lines +16 to +18
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initialize layout

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are significant changes to this file. It looks like you're moving it from Jetpack Compose to Fragments. What is the tech debt reduction you achieve with this change?

}

override fun onCreateOptionsMenu(menu: Menu?): Boolean {
menuInflater.inflate(R.menu.main, menu)
return super.onCreateOptionsMenu(menu)
}

override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.schedule_menu_item -> {
setFragment(ScheduleFragment())
}
R.id.medication_menu_item -> {
setFragment(MedicationsFragment())
}
R.id.share_menu_item -> {
//todo: share()
}
else -> return false
}

return true
}
Comment on lines +21 to 41
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implemented menu options

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Menus are not necessarily a good idea.

  • It's one more click for the user.
  • It often indicates a multi-screen app, where we try to minimize screens, where possible, to give a simpler experience.

}

@Composable
fun Greeting(name: String) {
Text(text = "Hello $name!")
}

@Preview(showBackground = true)
@Composable
fun DefaultPreview() {
MedMapperTheme {
Greeting("Android")

private fun setFragment(fragment: Fragment){
fragmentManager.beginTransaction()
.replace(R.id.fragment_view, fragment).commit()
}
}
26 changes: 26 additions & 0 deletions app/src/main/java/com/medmapper/v33001/MedRecyclerAdapter.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.medmapper.v33001

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.medmapper.v33001.dto.Medicine

class MedRecyclerAdapter(private val inflater: LayoutInflater, var meds: ArrayList<Medicine>): RecyclerView.Adapter<MedRecyclerAdapter.ViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(inflater.inflate(R.layout.medication_line_item, parent, false))
}

override fun getItemCount(): Int {
return meds.size
}

override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.name.text = meds[position].name
}

class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val name: TextView = itemView.findViewById(R.id.medication_name)
}
Comment on lines +10 to +25
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added recycler adapter for med list

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Compose, we'd use LazyColumn for repeating lists. RecyclerView is essentially deprecated, except in XML based layouts, which predates Compose.

}
24 changes: 24 additions & 0 deletions app/src/main/java/com/medmapper/v33001/MedicationsFragment.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.medmapper.v33001

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView

class MedicationsFragment : Fragment() {
lateinit var recyclerView: RecyclerView
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.medications_fragment, container, false)
recyclerView = view.findViewById(R.id.medications)
recyclerView.layoutManager = LinearLayoutManager(context)
recyclerView.adapter = MedRecyclerAdapter(inflater, ArrayList())
return view
}
Comment on lines +11 to +23
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added fragment for med list

}
24 changes: 24 additions & 0 deletions app/src/main/java/com/medmapper/v33001/ScheduleFragment.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.medmapper.v33001

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.EditText
import android.widget.TextView
import androidx.fragment.app.Fragment

class ScheduleFragment: Fragment() {
lateinit var email: EditText
lateinit var schedule: TextView
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.schedule_fragment, container, false)
schedule = view.findViewById(R.id.schedule)
email = view.findViewById(R.id.editTextTextEmailAddress)
return view
}
Comment on lines +11 to +23
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added fragment for schedule

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import androidx.room.RoomDatabase
import com.medmapper.v33001.dao.MedicineDAO
import com.medmapper.v33001.dto.Medicine

@Database(entities = arrayOf(Medicine::class), version = 1, exportSchema = false)
@Database(entities = [Medicine::class], version = 1, exportSchema = false)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'arrayOf' call should be replaced with array literal [...]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was covered in a previously submitted review.

public abstract class MedicineRoomDatabase : RoomDatabase() {

abstract fun medicineDao(): MedicineDAO
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/pill.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M345,840Q251,840 185.5,774.5Q120,709 120,615Q120,570 137,529Q154,488 186,456L456,186Q488,154 529,137Q570,120 615,120Q709,120 774.5,185.5Q840,251 840,345Q840,390 823,431Q806,472 774,504L504,774Q472,806 431,823Q390,840 345,840ZM618,575L732,462Q755,439 767.5,408.5Q780,378 780,345Q780,276 732,228Q684,180 615,180Q582,180 551.5,192.5Q521,205 498,228L385,342L618,575ZM345,780Q377,780 408,767.5Q439,755 462,732L575,618L342,385L228,498Q205,521 192.5,551.5Q180,582 180,615Q180,684 228,732Q276,780 345,780Z"/>
Comment on lines +1 to +9
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added pill icon drawable

</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/schedule.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M627,673L672,628L513,468L513,267L453,267L453,492L627,673ZM480,880Q398,880 325,848.5Q252,817 197.5,762.5Q143,708 111.5,635Q80,562 80,480Q80,398 111.5,325Q143,252 197.5,197.5Q252,143 325,111.5Q398,80 480,80Q562,80 635,111.5Q708,143 762.5,197.5Q817,252 848.5,325Q880,398 880,480Q880,562 848.5,635Q817,708 762.5,762.5Q708,817 635,848.5Q562,880 480,880ZM480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480ZM480,820Q620,820 720,720Q820,620 820,480Q820,340 720,240Q620,140 480,140Q340,140 240,240Q140,340 140,480Q140,620 240,720Q340,820 480,820Z"/>
Comment on lines +1 to +9
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added schedule icon drawable

</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/share.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M727,880Q679.5,880 646.25,846.65Q613,813.31 613,765.67Q613,759 614.5,749.36Q616,739.71 619,732L316,556Q301,573 279,583.5Q257,594 234,594Q186.5,594 153.25,560.75Q120,527.5 120,480Q120,432.5 153.25,399.25Q186.5,366 234,366Q257,366 278,375Q299,384 316,401L619,227Q616,219.93 614.5,211.09Q613,202.25 613,194Q613,146.5 646.25,113.25Q679.5,80 727,80Q774.5,80 807.75,113.25Q841,146.5 841,194Q841,241.5 807.75,274.75Q774.5,308 727,308Q703.65,308 682.32,300.5Q661,293 646,276L343,444Q345,452 346.5,462.5Q348,473 348,480.24Q348,487.48 346.5,495.24Q345,503 343,511L646,683Q661,669 681,660.5Q701,652 727,652Q774.5,652 807.75,685.25Q841,718.5 841,766Q841,813.5 807.75,846.75Q774.5,880 727,880ZM727.03,248Q750,248 765.5,232.46Q781,216.93 781,193.96Q781,171 765.47,155.5Q749.93,140 726.97,140Q704,140 688.5,155.54Q673,171.07 673,194.04Q673,217 688.53,232.5Q704.07,248 727.03,248ZM234.04,534Q257,534 272.5,518.47Q288,502.93 288,479.97Q288,457 272.46,441.5Q256.93,426 233.96,426Q211,426 195.5,441.53Q180,457.07 180,480.03Q180,503 195.54,518.5Q211.07,534 234.04,534ZM727.03,820Q750,820 765.5,804.47Q781,788.93 781,765.97Q781,743 765.47,727.5Q749.93,712 726.97,712Q704,712 688.5,727.53Q673,743.07 673,766.03Q673,789 688.53,804.5Q704.07,820 727.03,820ZM727,194Q727,194 727,194Q727,194 727,194Q727,194 727,194Q727,194 727,194Q727,194 727,194Q727,194 727,194Q727,194 727,194Q727,194 727,194ZM234,480Q234,480 234,480Q234,480 234,480Q234,480 234,480Q234,480 234,480Q234,480 234,480Q234,480 234,480Q234,480 234,480Q234,480 234,480ZM727,766Q727,766 727,766Q727,766 727,766Q727,766 727,766Q727,766 727,766Q727,766 727,766Q727,766 727,766Q727,766 727,766Q727,766 727,766Z"/>
Comment on lines +2 to +9
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added share icon drawable

</vector>
96 changes: 0 additions & 96 deletions app/src/main/res/layout/layout.xml

This file was deleted.

Loading