Skip to content

Commit

Permalink
Added NHS/Health Number field on personal detail
Browse files Browse the repository at this point in the history
  • Loading branch information
Aastha Malviya committed Aug 17, 2016
1 parent c341d6a commit e58c75d
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 12 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 1
versionName "1.0.0"
versionCode 2
versionName "1.0.1"
}

signingConfigs {
Expand Down
11 changes: 10 additions & 1 deletion app/src/main/java/uk/co/jaspalsvoice/jv/JvPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class JvPreferences {
private static final String PERSONAL_DETAILS_LIVE_WITH = "pd_live_with";
private static final String PERSONAL_DETAILS_EMAIL = "pd_email";
private static final String PERSONAL_DETAILS_DATE_OF_BIRTH = "pd_dob";
private static final String PERSONAL_DETAILS_NHS = "pd_nhs";
private static final String PERSONAL_DETAILS_MAIN_CARER = "pd_main_carer";
private static final String PERSONAL_DETAILS_CARER_TEL = "pd_carer_tel";
private static final String PERSONAL_DETAILS_NEED_TRANSLATOR = "pd_need_translator";
Expand Down Expand Up @@ -104,6 +105,14 @@ public void setPersonalDetailsDateOfBirth(String dob) {
editor.putString(PERSONAL_DETAILS_DATE_OF_BIRTH, dob).apply();
}

public String getPersonalDetailsNHS() {
return preferences.getString(PERSONAL_DETAILS_NHS, "");
}

public void setPersonalDetailsNHS(String nhs) {
editor.putString(PERSONAL_DETAILS_NHS, nhs).apply();
}

public String getPersonalDetailsMainCarer() {
return preferences.getString(PERSONAL_DETAILS_MAIN_CARER, "");
}
Expand Down Expand Up @@ -355,6 +364,6 @@ public void setFeedingMethod(String feedingMethod) {
}

public String getFeedingMethod() {
return preferences.getString(FEEDING_METHOD, "");
return preferences.getString(FEEDING_METHOD, "");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class PersonalDetailsActivity extends BaseActivity {
EditText lastName;
EditText preferredName;
EditText dob;
EditText nhs;
EditText streetAddress;
EditText townAddress;
EditText state;
Expand Down Expand Up @@ -146,6 +147,7 @@ private void loadData() {
liveWith.setText(preferences.getPersonalDetailsLiveWith());
email.setText(preferences.getPersonalDetailsEmail());
dob.setText(preferences.getPersonalDetailsDateOfBirth());
nhs.setText(preferences.getPersonalDetailsNHS());
mainCarer.setText(preferences.getPersonalDetailsMainCarer());
carerTel.setText(preferences.getPersonalDetailsCarerTel());
homeTelephone.setText(preferences.getPersonalDetailHomeTel());
Expand All @@ -170,6 +172,7 @@ private void saveData() {
preferences.setPersonalDetailsLiveWith(liveWith.getText().toString());
preferences.setPersonalDetailsEmail(email.getText().toString());
preferences.setPersonalDetailsDateOfBirth(dob.getText().toString());
preferences.setPersonalDetailsNHS(nhs.getText().toString());
preferences.setPersonalDetailsMainCarer(mainCarer.getText().toString());
preferences.setPersonalDetailsCarerTel(carerTel.getText().toString());
preferences.setHomeTelephone(homeTelephone.getText().toString());
Expand All @@ -191,13 +194,13 @@ private void saveData() {
private void initSpinners() {

ArrayAdapter<String> genderAdapter = new ArrayAdapter<String>(
this,R.layout.spinner_item,
this, R.layout.spinner_item,
getResources().getStringArray(R.array.gender_spinner));
genderAdapter.setDropDownViewResource(R.layout.spinner_item);
genderSpinner.setAdapter(genderAdapter);

ArrayAdapter<String> adapter = new ArrayAdapter<String>(
this,R.layout.spinner_item,
this, R.layout.spinner_item,
getResources().getStringArray(R.array.yes_no_spinner_item));
adapter.setDropDownViewResource(R.layout.spinner_item);
translatorNeededSpinner.setAdapter(adapter);
Expand All @@ -209,6 +212,7 @@ private void initViews() {
lastName = (EditText) findViewById(R.id.lastNameEdittext);
preferredName = (EditText) findViewById(R.id.preferredNameEdittext);
dob = (EditText) findViewById(R.id.dobEdittext);
nhs = (EditText) findViewById(R.id.nhsEdittext);
streetAddress = (EditText) findViewById(R.id.streetEdittext);
townAddress = (EditText) findViewById(R.id.townEdittext);
state = (EditText) findViewById(R.id.countyEdittext);
Expand Down
27 changes: 20 additions & 7 deletions app/src/main/res/layout/personal_details_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
android:id="@+id/buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:padding="@dimen/margin_small"
android:layout_alignParentBottom="true"
android:visibility="visible">

<Button
Expand All @@ -25,12 +25,11 @@
</LinearLayout>

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/buttons"
>
android:layout_above="@id/buttons">


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
Expand All @@ -54,8 +53,7 @@
<EditText
android:id="@+id/firstNameEdittext"
style="@style/SingleLineEditTextStyle"
android:hint="@string/personal_details_first_name"
/>
android:hint="@string/personal_details_first_name" />

</android.support.design.widget.TextInputLayout>

Expand Down Expand Up @@ -102,6 +100,21 @@

</android.support.design.widget.TextInputLayout>

<android.support.design.widget.TextInputLayout
android:id="@+id/nhsLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
app:hintTextAppearance="@style/StyledTilEditTextFloatingLabel">

<EditText
android:id="@+id/nhsEdittext"
style="@style/SingleLineEditTextStyle"
android:hint="@string/personal_details_nhs"
android:inputType="phone" />

</android.support.design.widget.TextInputLayout>

<android.support.design.widget.TextInputLayout
android:id="@+id/streetLayout"
android:layout_width="match_parent"
Expand Down Expand Up @@ -356,4 +369,4 @@
</android.support.design.widget.TextInputLayout>
</LinearLayout>
</ScrollView>
</RelativeLayout>
</RelativeLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
<string name="personal_details_email">Email</string>
<string name="personal_details_dob">D.O.B</string>
<string name="personal_details_birth">Date Of Birth</string>
<string name="personal_details_nhs">NHS/Health Number</string>
<string name="personal_details_street">Street Address</string>
<string name="personal_details_Town">Town Address</string>
<string name="personal_details_country_state_Province"> Country/State/Province</string>
Expand Down

0 comments on commit e58c75d

Please sign in to comment.