Skip to content

Commit

Permalink
add info screen and remove back button
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaudiaHosu committed Apr 23, 2017
1 parent ace7ea8 commit 030367b
Show file tree
Hide file tree
Showing 9 changed files with 154 additions and 47 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "uk.co.medivoice.jv"
minSdkVersion 19
targetSdkVersion 23
versionCode 3
versionName "1.0.2"
versionCode 4
versionName "1.0.3"
}

signingConfigs {
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
android:label="@string/allergies"/>
<activity android:name=".activities.DiagnosesActivity"
android:label="@string/diagnosis"></activity>
<activity
android:name=".activities.TermsAndConditionsActivity"
android:label="@string/terms_and_conditions"></activity>
</application>

</manifest>
57 changes: 28 additions & 29 deletions app/src/main/java/uk/co/jaspalsvoice/jv/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package uk.co.jaspalsvoice.jv;

import android.app.PendingIntent;
import android.app.TaskStackBuilder;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
Expand All @@ -9,8 +11,10 @@
import android.os.Handler;
import android.os.Message;
import android.speech.tts.TextToSpeech;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.NotificationCompat;
import android.support.v7.widget.ShareActionProvider;
import android.text.Editable;
import android.text.InputType;
Expand Down Expand Up @@ -63,6 +67,7 @@
import uk.co.jaspalsvoice.jv.activities.LikesDislikesActivity;
import uk.co.jaspalsvoice.jv.activities.MedicinesActivity;
import uk.co.jaspalsvoice.jv.activities.PersonalDetailsActivity;
import uk.co.jaspalsvoice.jv.activities.TermsAndConditionsActivity;
import uk.co.jaspalsvoice.jv.activities.VitalsActivity;
import uk.co.jaspalsvoice.jv.db.DatabaseHelper;
import uk.co.jaspalsvoice.jv.task.FetchWordsTask;
Expand Down Expand Up @@ -118,35 +123,6 @@ public void onUpdateUi(List<String> text) {
}
};

/*@Override
public View findViewById(int id) {
View view= super.findViewById(id);
if (view instanceof TextView){
*//*float a = ((TextView) view).getTextSize();
a += 120;*//*
((TextView) view).setTextSize(200);
}
return view;
}*/

/* private View.OnClickListener onSuggestionListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
String currentText = messageTextView.getText().toString();
String suggestion = ((TextView) v).getText().toString();
// Don't do any replacement if we have the default suggestion.
if (!defaultSuggestion.equals(suggestion)) {
if (t9Enabled) {
((T9Handler) currentHandler).replaceWordWith(currentText, suggestion);
} else {
((KeypadHandler) currentHandler).replaceWordWith(currentText, suggestion);
}
}
}
};
*/


private View.OnClickListener onSuggestionListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand Down Expand Up @@ -613,6 +589,10 @@ public void run() {
defaultSuggestion = getString(R.string.no_suggestion);
shareIntent.setType("text/plain");

getSupportActionBar().setDisplayHomeAsUpEnabled(false);
getSupportActionBar().setHomeButtonEnabled(false);
getSupportActionBar().setDisplayShowHomeEnabled(false);

if (t9Enabled) {
currentHandler = new T9Handler(ContextCompat.getColor(this, R.color.colorAccent_40));
((T9Handler) currentHandler).setListener(keyPadListener);
Expand All @@ -633,13 +613,32 @@ public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMen
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_menu, menu);
MenuItem appInfoItem = menu.findItem(R.id.menu_app_info);
appInfoItem.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
Intent appInfoIntent = new Intent(MainActivity.this, TermsAndConditionsActivity.class);

//hack so that the back button works correctly
//todo find a better fix
isPassportScene = true;

startActivity(appInfoIntent);
return false;
}
});
MenuItem item = menu.findItem(R.id.menu_text_share);
shareActionProvider = (ShareActionProvider) MenuItemCompat.getActionProvider(item);
MenuItem textSizeItem = menu.findItem(R.id.menu_text_font);
textSizeItem.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
Intent intent = new Intent(MainActivity.this, FontSizeActivity.class);

//hack so that the back button works correctly
//todo find a better fix
isPassportScene = true;

startActivity(intent);
return false;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package uk.co.jaspalsvoice.jv.activities;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import uk.co.jaspalsvoice.jv.R;

/**
* Created by claudia on 22/04/2017.
*/
public class TermsAndConditionsActivity extends AppCompatActivity {

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_terms_conditions);
}

@Override
protected void onPause() {
super.onPause();
finish();
}
}
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_info_outline_white_24px.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z"
android:fillColor="#FFFFFF"/>
</vector>
40 changes: 24 additions & 16 deletions app/src/main/res/layout/activity_about_me.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,69 +22,77 @@
android:id="@+id/sitting_position"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_horizontal_margin"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:padding="@dimen/margin_small"
app:entries="@array/about_me_sitting_position_item"/>
app:entries="@array/about_me_sitting_position_item"
android:layout_weight="1" />

<uk.co.jaspalsvoice.jv.views.tickbox.TickBoxListCardView
android:elevation="@dimen/elevation"
android:id="@+id/need_to_use"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/activity_horizontal_margin"
android:layout_width="match_parent"
android:padding="@dimen/margin_small"
app:entries="@array/about_me_need_to_use"/>
app:entries="@array/about_me_need_to_use"
android:layout_weight="1" />

<uk.co.jaspalsvoice.jv.views.YesNoCardView
android:elevation="@dimen/elevation"
android:id="@+id/breathing"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/activity_horizontal_margin"
android:layout_width="match_parent"
android:padding="@dimen/margin_small"/>
android:padding="@dimen/margin_small"
android:layout_weight="1" />

<uk.co.jaspalsvoice.jv.views.tickbox.TickBoxListCardView
android:elevation="@dimen/elevation"
android:id="@+id/breathing_when"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/activity_horizontal_margin"
android:layout_width="match_parent"
android:padding="@dimen/margin_small"
app:entries="@array/about_me_breathing_when"/>
app:entries="@array/about_me_breathing_when"
android:layout_weight="1" />

<uk.co.jaspalsvoice.jv.views.tickbox.TickBoxListCardView
android:elevation="@dimen/elevation"
android:id="@+id/sleep_position"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/activity_horizontal_margin"
android:layout_width="match_parent"
android:padding="@dimen/margin_small"
app:entries="@array/about_me_sleep_position"/>
app:entries="@array/about_me_sleep_position"
android:layout_weight="1" />

<uk.co.jaspalsvoice.jv.views.EatingDrinkingCardView
android:elevation="@dimen/elevation"
android:id="@+id/swallowing_difficulties"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/activity_horizontal_margin"
android:layout_width="match_parent"
android:padding="@dimen/margin_small"/>
android:padding="@dimen/margin_small"
android:layout_weight="1" />

<uk.co.jaspalsvoice.jv.views.YesNoCardView
android:elevation="@dimen/elevation"
android:id="@+id/physical_abilities"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/activity_horizontal_margin"
android:layout_width="match_parent"
android:padding="@dimen/margin_small"/>
android:padding="@dimen/margin_small"
android:layout_weight="1" />

<uk.co.jaspalsvoice.jv.views.tickbox.TickBoxListCardView
android:elevation="@dimen/elevation"
android:id="@+id/transfer_to"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/activity_horizontal_margin"
android:layout_width="match_parent"
android:padding="@dimen/margin_small"
app:entries="@array/about_me_transfer_to"/>
app:entries="@array/about_me_transfer_to"
android:layout_weight="1" />

</LinearLayout>
</ScrollView>
19 changes: 19 additions & 0 deletions app/src/main/res/layout/activity_terms_conditions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
>

<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/terms_and_conditions_text"
android:id="@+id/textView"
/>

</ScrollView>
8 changes: 8 additions & 0 deletions app/src/main/res/menu/main_menu.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<item
android:id="@+id/menu_app_info"
android:title="@string/terms_and_conditions"
android:icon="@drawable/ic_info_outline_white_24px"
app:showAsAction="ifRoom"/>

<item
android:id="@+id/menu_text_share"
android:title="@string/share"
Expand All @@ -12,4 +19,5 @@
android:title="@string/text_size"
android:icon="@drawable/ic_format_size_white_24dp"
app:showAsAction="ifRoom"/>

</menu>
36 changes: 36 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,40 @@
<string name="edit_button">Edit</string>

<string name="medi_records">Medical\nRecords</string>

<string name="terms_and_conditions">App information</string>
<string name="terms_and_conditions_text">
Medivoice is developed and owned by Jaspal’s Voice Limited for further information please go to www.Jaspalsvoice.co.uk
\n\n
Medivoice was developed following android app development methodology by an ISO9000-2001 certified company.
\n\n
We endeavour to develop this app so it is intuitive to use and is error free. If you have any comments or feedback please email [email protected]. We aim to respond within 3 days.
\n\n
Medivoice was tested and validated by patients with neurological conditions eg Parkinsons, MND as well as carers, GPs, disease support groups, consultants and speech and language therapists.
\n\n
Testimonials by the professionals :-
\n\n
“Hi Susan, everyone who has seen it is impressed. I also showed it to a patient who was having difficulty with existing methods.” Professor Ammar Al-Chalabi, Professor of Neurology Kings College London.
\n\n
“Your communication app is inspiring” Jan Clarke, MND Clinical Nurse Specialist
\n\n
“Medivoice can make a difference in people’s lives”, Helen Paterson, Speech and Language Therapist
\n\n
“Medivoice saves me time and provides the information I need accurately and quickly”, Dr Harpreet Aurora, GP
\n\n
<u>Glossary of terms</u>
\n\n
Blood pressure – Two numbers indicating heart performance e.g. 120/80
\n Blood Glucose – One number that measures the amount of sugar in the blood. Ideal range 70-100 mg/dL
\n Environmental allergy – An adverse reaction to the environment e.g. cat or pollen
\n Food allergy – An adverse reaction to food e.g. Peanuts
\n Hepatic dosage – maximum dosage limit for patients with liver problems
\n Medical allergy – An adverse reaction to medication– e.g. Penicillin,
\n NHS number – a ten digit number assigned to users of the NHS system
\n Renal dosage - maximum dosage limit for patients with kidney problems
\n\n
Jaspal’s Voice takes no responsibility or liability for social media content generated via the Medivoice app.


</string>
</resources>

0 comments on commit 030367b

Please sign in to comment.