summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormariagpuyol <mariagpuyol@google.com>2016-09-05 11:56:17 -0700
committermariagpuyol <mariagpuyol@google.com>2016-09-05 12:03:33 -0700
commit9d4ff9c4b1a14e9a37ba87e98289009d6538c05c (patch)
treed0d1169d1679369e0db8d28dc862b0e2ef6f37c2
parentb0d66140141e69bc706646087ce51c18ba799ea4 (diff)
downloadEmergencyInfo-9d4ff9c4b1a14e9a37ba87e98289009d6538c05c.tar.gz
Add extra string to empty state
Bug:30927743 Change-Id: Id598557fa19fc3f74274394e3e03a2fb59c5e1d3
-rw-r--r--res/layout/view_activity_layout.xml38
-rw-r--r--res/values/strings.xml4
-rw-r--r--src/com/android/emergency/view/ViewInfoActivity.java4
-rw-r--r--tests/src/com/android/emergency/view/ViewInfoActivityTest.java7
4 files changed, 38 insertions, 15 deletions
diff --git a/res/layout/view_activity_layout.xml b/res/layout/view_activity_layout.xml
index d68ecf46..db326094 100644
--- a/res/layout/view_activity_layout.xml
+++ b/res/layout/view_activity_layout.xml
@@ -50,19 +50,39 @@
android:layout_height="match_parent"
android:elevation="@dimen/tab_elevation">
- <TextView
- android:id="@+id/no_info_text_view"
+ <LinearLayout
+ android:id="@+id/no_info"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_marginStart="16dp"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
android:layout_marginEnd="16dp"
- android:gravity="center"
- android:text="@string/no_info_provided"
- android:textColor="#9E9E9E"
- android:textSize="16sp" />
+ android:layout_marginStart="16dp"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/no_info_text_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center"
+ android:text="@string/no_info_provided"
+ android:textColor="#61000000"
+ android:textSize="16sp" />
+
+ <TextView
+ android:id="@+id/tap"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_below="@id/no_info_text_view"
+ android:layout_marginTop="20dp"
+ android:gravity="center"
+ android:lineSpacingMultiplier="1.21905"
+ android:text="@string/tap_pencil"
+ android:textColor="#61000000"
+ android:textSize="14sp" />
+ </LinearLayout>
<include
android:id="@+id/tabs"
layout="@layout/tabs" />
</ViewFlipper>
-</LinearLayout> \ No newline at end of file
+</LinearLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index ef034839..297a5ada 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -198,7 +198,9 @@
<!-- Label for button in confirmation dialog when the user clicks on emergency information [CHAR LIMIT=15] -->
<string name="emergency_info_continue">Continue</string>
<!-- Message shown when no emergency information has been provided by the user [CHAR LIMIT=NONE] -->
- <string name="no_info_provided">No emergency information provided</string>
+ <string name="no_info_provided">No information about the phone\'s owner</string>
+ <!-- Extra message to indicate to the user that they can add emergency information [CHAR LIMIT=NONE] -->
+ <string name="tap_pencil">If this is your phone, tap the pencil icon to add information that will be displayed here in case of emergency</string>
<!-- Label for action item on the menu of the editing screen [CHAR LIMIT=15] -->
<string name="clear_all">Clear all</string>
<!-- Label for button of dialog shown to clear all information and contacts [CHAR LIMIT=15] -->
diff --git a/src/com/android/emergency/view/ViewInfoActivity.java b/src/com/android/emergency/view/ViewInfoActivity.java
index 639c283b..6d7c1569 100644
--- a/src/com/android/emergency/view/ViewInfoActivity.java
+++ b/src/com/android/emergency/view/ViewInfoActivity.java
@@ -88,7 +88,7 @@ public class ViewInfoActivity extends EmergencyTabActivity {
// Show a TextView with "No information provided" if there are no fragments.
if (getNumberFragments() == 0) {
mViewFlipper.setDisplayedChild(
- mViewFlipper.indexOfChild(findViewById(R.id.no_info_text_view)));
+ mViewFlipper.indexOfChild(findViewById(R.id.no_info)));
} else {
mViewFlipper.setDisplayedChild(mViewFlipper.indexOfChild(findViewById(R.id.tabs)));
}
@@ -135,4 +135,4 @@ public class ViewInfoActivity extends EmergencyTabActivity {
}
return fragments;
}
-} \ No newline at end of file
+}
diff --git a/tests/src/com/android/emergency/view/ViewInfoActivityTest.java b/tests/src/com/android/emergency/view/ViewInfoActivityTest.java
index 3c5b2f10..42df43d3 100644
--- a/tests/src/com/android/emergency/view/ViewInfoActivityTest.java
+++ b/tests/src/com/android/emergency/view/ViewInfoActivityTest.java
@@ -60,9 +60,9 @@ public class ViewInfoActivityTest extends ActivityInstrumentationTestCase2<ViewI
super.setUp();
mPersonalCard = (LinearLayout) getActivity().findViewById(R.id.name_and_dob_linear_layout);
mPersonalCardLargeItem = (TextView) getActivity().findViewById(R.id.personal_card_large);
- mViewFlipper = (ViewFlipper) getActivity().findViewById(R.id.view_flipper);
+ mViewFlipper = (ViewFlipper) getActivity().findViewById(R.id.view_flipper);
mNoInfoIndex = mViewFlipper
- .indexOfChild(getActivity().findViewById(R.id.no_info_text_view));
+ .indexOfChild(getActivity().findViewById(R.id.no_info));
mTabsIndex = mViewFlipper.indexOfChild(getActivity().findViewById(R.id.tabs));
PreferenceManager.getDefaultSharedPreferences(getActivity()).edit().clear().commit();
@@ -98,7 +98,7 @@ public class ViewInfoActivityTest extends ActivityInstrumentationTestCase2<ViewI
assertEquals(0, mFragments.size());
assertEquals(View.GONE, getActivity().getTabLayout().getVisibility());
assertEquals(View.VISIBLE,
- getActivity().findViewById(R.id.no_info_text_view).getVisibility());
+ getActivity().findViewById(R.id.no_info).getVisibility());
assertEquals(mNoInfoIndex, mViewFlipper.getDisplayedChild());
assertEquals(View.VISIBLE, mPersonalCardLargeItem.getVisibility());
assertEquals(name, mPersonalCardLargeItem.getText());
@@ -229,3 +229,4 @@ public class ViewInfoActivityTest extends ActivityInstrumentationTestCase2<ViewI
getInstrumentation().waitForIdleSync();
}
}
+