Bring action bar up to spec (E1)

* Show title "Edit Label" when editing a label.
* Change "Label name" to "Label" in editor and in group name edit dialog.

Bug 29831679
Fixes 29981743

Change-Id: I4bbd1185045d902831b7dbefc381ef6fcb92cdf4
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 5c9be9f..3555325 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -441,8 +441,8 @@
     <!-- Title for the update label dialog. CHAR LIMIT=40] -->
     <string name="group_name_dialog_update_title">Rename label</string>
 
-    <!-- Hint for the label name input field on the insert and update label dialogs [CHAR LIMIT=30] -->
-    <string name="group_name_dialog_hint">Label name</string>
+    <!-- Hint for the label name input field on the insert and update label dialogs [CHAR LIMIT=15] -->
+    <string name="group_name_dialog_hint">Label</string>
 
     <!-- Generic action string for starting an audio chat. Used by AccessibilityService to announce the purpose of the view. [CHAR LIMIT=NONE] -->
     <string name="audio_chat">Voice chat</string>
@@ -510,7 +510,7 @@
     <string name="event_edit_field_hint_text">Date</string>
 
     <!-- The button to add an label field to a contact in the Raw Contact Editor [CHAR LIMIT=15] -->
-    <string name="group_edit_field_hint_text">Label name</string>
+    <string name="group_edit_field_hint_text">Label</string>
 
     <!-- Button used for changing a photo in the Raw Contact Editor [CHAR LIMIT=15] -->
     <string name="change_photo">Change</string>
@@ -652,8 +652,8 @@
     <!-- Label to instruct the user to type in a contact's name to add the contact as a member of the current group. [CHAR LIMIT=64] -->
     <string name="enter_contact_name">Search contacts</string>
 
-    <!-- Hint text in the label name box in the edit label view. [CHAR LIMIT=20]-->
-    <string name="group_name_hint">Label\'s name</string>
+    <!-- Title of edit label view  [CHAR LIMIT=20]-->
+    <string name="title_edit_group">Edit Label</string>
 
     <!-- Header label in the contact editor for a profile that is local to the device only (and not associated with any account) [CHAR LIMIT=25] -->
     <string name="local_profile_title">My local profile</string>
diff --git a/src/com/android/contacts/activities/ActionBarAdapter.java b/src/com/android/contacts/activities/ActionBarAdapter.java
index 3723d52..669735c 100644
--- a/src/com/android/contacts/activities/ActionBarAdapter.java
+++ b/src/com/android/contacts/activities/ActionBarAdapter.java
@@ -21,7 +21,6 @@
 import android.content.Context;
 import android.content.SharedPreferences;
 import android.content.res.TypedArray;
-import android.graphics.Color;
 import android.os.Bundle;
 import android.preference.PreferenceManager;
 import android.support.v4.content.ContextCompat;
@@ -509,6 +508,13 @@
         textView.setText(String.valueOf(selectionCount));
     }
 
+    public void setActionBarTitle(String title) {
+        final TextView textView =
+                (TextView) mSelectionContainer.findViewById(R.id.selection_count_text);
+        textView.setVisibility(View.VISIBLE);
+        textView.setText(title);
+    }
+
     private void updateStatusBarColor() {
         if (!CompatUtils.isLollipopCompatible()) {
             return; // we can't change the status bar color prior to Lollipop
diff --git a/src/com/android/contacts/activities/GroupMembersActivity.java b/src/com/android/contacts/activities/GroupMembersActivity.java
index b75295d..4d58033 100644
--- a/src/com/android/contacts/activities/GroupMembersActivity.java
+++ b/src/com/android/contacts/activities/GroupMembersActivity.java
@@ -498,6 +498,7 @@
                 if (mMembersFragment != null) {
                     if (mIsEditMode) {
                         mMembersFragment.displayDeleteButtons(true);
+                        mActionBarAdapter.setActionBarTitle(getString(R.string.title_edit_group));
                     } else {
                         mMembersFragment.displayCheckBoxes(true);
                     }
@@ -545,7 +546,11 @@
 
     @Override
     public void onSelectedContactIdsChanged() {
-        mActionBarAdapter.setSelectionCount(mMembersFragment.getSelectedContactIds().size());
+        if (mIsEditMode) {
+            mActionBarAdapter.setActionBarTitle(getString(R.string.title_edit_group));
+        } else {
+            mActionBarAdapter.setSelectionCount(mMembersFragment.getSelectedContactIds().size());
+        }
     }
 
     @Override