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 SE4351_class_project-master/MedMemory/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


<uses-sdk
android:minSdkVersion="19"
android:minSdkVersion="16"
android:targetSdkVersion="21" />

<application
Expand Down Expand Up @@ -46,7 +46,7 @@
android:parentActivityName=".Meds"></activity>
<activity
android:name="CalendarEventActivity"
android:parentActivityName=".Calendar"></activity>
android:parentActivityName=".Appointments"></activity>

<service android:name="NotifyService"></service>
<service android:name="TakeMedNowService"></service>
Expand Down
2 changes: 1 addition & 1 deletion SE4351_class_project-master/MedMemory/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=Google Inc.:Google APIs:17
target=android-21
26 changes: 26 additions & 0 deletions SE4351_class_project-master/MedMemory/res/layout/appointments.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="15dp">

<ListView
android:id="@+id/LVEventContainer"
android:layout_width="match_parent"
android:layout_height="350dp"
android:layout_gravity="center" >


</ListView>

<Button
android:id="@+id/BAddEvent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="15dp"
android:layout_marginRight="15dp"
android:text="Add Event" />

</RelativeLayout>
28 changes: 0 additions & 28 deletions SE4351_class_project-master/MedMemory/res/layout/calendar.xml

This file was deleted.

137 changes: 137 additions & 0 deletions SE4351_class_project-master/MedMemory/res/layout/eventcreation.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="15dp" >

<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="370dp" >

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >

<TextView
android:id="@+id/TVTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="false"
android:layout_centerInParent="false"
android:layout_centerVertical="false"
android:text="Title"
android:textSize="25sp" />

<EditText
android:id="@+id/ETTitle"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/TVTitle"
android:layout_alignBottom="@+id/TVTitle"
android:layout_toRightOf="@+id/TVDescription"
android:ems="10"
android:maxLength="30"
android:maxLines="1" />

<EditText
android:id="@+id/ETDescription"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="false"
android:layout_below="@+id/TVDescription"
android:layout_centerInParent="true"
android:layout_marginLeft="18dp"
android:ems="10"
android:lines="5"
android:maxLength="30" >
</EditText>

<TextView
android:id="@+id/TVDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/ETTitle"
android:layout_marginTop="22dp"
android:text="Description"
android:textSize="25sp" />

<Spinner
android:id="@+id/SRepeat"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/ETTitle"
android:layout_below="@+id/ETDescription"
android:layout_marginLeft="15dp"
android:layout_marginTop="34dp" />

<TextView
android:id="@+id/TVRepeat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignTop="@+id/SRepeat"
android:text="Repeat:"
android:textAlignment="center"
android:textSize="25sp" />

<TextView
android:id="@+id/TVStartTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/SRepeat"
android:text="Start at:"
android:textSize="25sp" />

<TextView
android:id="@+id/TVEndTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/TVStartTime"
android:text="End at:"
android:textSize="25sp" />

<TimePicker
android:id="@+id/TPStartTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/TVEndTime" />

<TimePicker
android:id="@+id/TPEndTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/TPStartTime" />
</RelativeLayout>
</ScrollView>

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/scrollView1"
android:weightSum="2" >

<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Button" />

<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="Button" />
</LinearLayout>

</RelativeLayout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
package com.example.memorymed;

import java.util.Iterator;
import java.util.TreeMap;

import android.os.Bundle;


//Simplified storage for events
public abstract class AlarmManager
{
private static TreeMap<String, Event> events = new TreeMap<String, Event>();

public static void addEvent(String name, Event e)
{
events.put(name, e);
}

public static Event getEvent(String name)
{
return events.get(name);
}

public static Event removeEvent(String name)
{
return events.remove(name);
}

public static boolean removeEvent(Event e)
{
Iterator<Event> it = events.values().iterator();
while(it.hasNext())
{
Event e2 = it.next();
if(e.equals(e2))
{
it.remove();
return true;
}
}
return false;
}

public static boolean containsEvent(Event e)
{
return events.containsValue(e);
}

public static boolean containsName(String name)
{
return events.containsKey(name);
}

public static int getSize()
{
return events.size();
}



//A basic wrapper for the event information
private final class Event
{
private Bundle information;
public static final String
REPEAT = "repeat",
BEGIN_TIME = "begintime",
END_TIME = "endtime",
TITLE = "title",
CONTENT = "content";

public static final int
WEEKLY = 0xF001,
BIWEEKLY = 0xF002,
MONTHLY = 0xF003,
YEARLY = 0xF004;

public Event()
{
information = new Bundle();
}


/*
* Makes sure the Bundle only has specific entries related to information
* needed for an event (i.e. date, start time, etc.). Returns true if the
* extra was added successfully.
*/
public boolean putExtra(String key, Object value)
{
if(key.equals(REPEAT) && value instanceof Integer)
{
Integer v = (Integer) value;
switch(v)
{
case WEEKLY: case BIWEEKLY: case MONTHLY: case YEARLY: information.putInt(key, v); return true;
}
}
else if(key.equals(BEGIN_TIME) && value instanceof java.util.Calendar)
{
java.util.Calendar v = (java.util.Calendar) value;
information.putSerializable(key, v);
return true;
}
else if(key.equals(END_TIME) && value instanceof java.util.Calendar)
{
java.util.Calendar v = (java.util.Calendar) value;
information.putSerializable(key, v);
return true;
}
else if(key.equals(TITLE) && value instanceof String)
{
String v = (String) value;
information.putString(key, v);
return true;
}
else if(key.equals(CONTENT) && value instanceof String)
{
String v = (String) value;
information.putString(key, v);
return true;
}

return false;
}

public Object getValue(String key)
{
return information.get(key);
}
}
}
Loading