Merge "Only use one hint color on contact editors" into mnc-dev
diff --git a/src/com/android/contacts/editor/ContactEditorFragment.java b/src/com/android/contacts/editor/ContactEditorFragment.java
index e9b3715..458e325 100644
--- a/src/com/android/contacts/editor/ContactEditorFragment.java
+++ b/src/com/android/contacts/editor/ContactEditorFragment.java
@@ -269,10 +269,6 @@
                         if (activity.isFinishing()) {
                             return;
                         }
-                        if (request == EditorListener.EDITOR_FOCUS_CHANGED) {
-                            adjustNameFieldsHintDarkness(rawContactEditor);
-                            return;
-                        }
                         if (!isEditingUserProfile()) {
                             if (request == EditorListener.FIELD_CHANGED) {
                                 if (!nameValuesDelta.isSuperPrimary()) {
@@ -294,23 +290,6 @@
                     public void onDeleteRequested(Editor removedEditor) {
                     }
                 };
-                final EditorListener otherNamesListener = new EditorListener() {
-
-                    @Override
-                    public void onRequest(int request) {
-                        // Make sure the activity is running
-                        if (activity.isFinishing()) {
-                            return;
-                        }
-                        if (request == EditorListener.EDITOR_FOCUS_CHANGED) {
-                            adjustNameFieldsHintDarkness(rawContactEditor);
-                        }
-                    }
-
-                    @Override
-                    public void onDeleteRequested(Editor removedEditor) {
-                    }
-                };
 
                 final StructuredNameEditorView nameEditor = rawContactEditor.getNameEditor();
                 if (mRequestFocus) {
@@ -322,22 +301,13 @@
                     nameEditor.setDisplayName(mDefaultDisplayName);
                 }
 
-                final TextFieldsEditorView phoneticNameEditor =
-                        rawContactEditor.getPhoneticNameEditor();
-                phoneticNameEditor.setEditorListener(otherNamesListener);
                 rawContactEditor.setAutoAddToDefaultGroup(mAutoAddToDefaultGroup);
 
-                final TextFieldsEditorView nickNameEditor =
-                        rawContactEditor.getNickNameEditor();
-                nickNameEditor.setEditorListener(otherNamesListener);
-
                 if (isAggregationSuggestionRawContactId(rawContactId)) {
                     acquireAggregationSuggestions(activity,
                             rawContactEditor.getNameEditor().getRawContactId(),
                             rawContactEditor.getNameEditor().getValues());
                 }
-
-                adjustNameFieldsHintDarkness(rawContactEditor);
             }
         }
 
@@ -427,23 +397,6 @@
     }
 
     /**
-     * Adjust how dark the hint text should be on all the names' text fields.
-     *
-     * @param rawContactEditor editor to update
-     */
-    private void adjustNameFieldsHintDarkness(RawContactEditorView rawContactEditor) {
-        // Check whether fields contain focus by calling findFocus() instead of hasFocus().
-        // The hasFocus() value is not necessarily up to date.
-        final boolean nameFieldsAreNotFocused
-                = rawContactEditor.getNameEditor().findFocus() == null
-                && rawContactEditor.getPhoneticNameEditor().findFocus() == null
-                && rawContactEditor.getNickNameEditor().findFocus() == null;
-        rawContactEditor.getNameEditor().setHintColorDark(!nameFieldsAreNotFocused);
-        rawContactEditor.getPhoneticNameEditor().setHintColorDark(!nameFieldsAreNotFocused);
-        rawContactEditor.getNickNameEditor().setHintColorDark(!nameFieldsAreNotFocused);
-    }
-
-    /**
      * Update the values in {@link #mExpandedEditors}.
      */
     private void updatedExpandedEditorsMap() {
diff --git a/src/com/android/contacts/editor/LabeledEditorView.java b/src/com/android/contacts/editor/LabeledEditorView.java
index cf94d8f..e2724a1 100644
--- a/src/com/android/contacts/editor/LabeledEditorView.java
+++ b/src/com/android/contacts/editor/LabeledEditorView.java
@@ -577,14 +577,12 @@
         private boolean mHasCustomSelection;
         private int mTextColorHintUnfocused;
         private int mTextColorDark;
-        private int mTextColorSecondary;
 
         public EditTypeAdapter(Context context) {
             super(context, 0);
             mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
             mTextColorHintUnfocused = context.getResources().getColor(
                     R.color.editor_disabled_text_color);
-            mTextColorSecondary = context.getResources().getColor(R.color.secondary_text_color);
             mTextColorDark = context.getResources().getColor(R.color.primary_text_color);
 
 
@@ -617,8 +615,6 @@
             // color.
             if (!LabeledEditorView.this.isEmpty()) {
                 view.setTextColor(mTextColorDark);
-            } else if (LabeledEditorView.this.hasFocus()) {
-                view.setTextColor(mTextColorSecondary);
             } else {
                 view.setTextColor(mTextColorHintUnfocused);
             }
diff --git a/src/com/android/contacts/editor/TextFieldsEditorView.java b/src/com/android/contacts/editor/TextFieldsEditorView.java
index 9345434..fe476ed 100644
--- a/src/com/android/contacts/editor/TextFieldsEditorView.java
+++ b/src/com/android/contacts/editor/TextFieldsEditorView.java
@@ -59,7 +59,6 @@
     private boolean mHasShortAndLongForms;
     private int mMinFieldHeight;
     private int mPreviousViewHeight;
-    private int mHintTextColor;
     private int mHintTextColorUnfocused;
 
     public TextFieldsEditorView(Context context) {
@@ -85,7 +84,6 @@
         mMinFieldHeight = getContext().getResources().getDimensionPixelSize(
                 R.dimen.editor_min_line_item_height);
         mFields = (ViewGroup) findViewById(R.id.editors);
-        mHintTextColor = getResources().getColor(R.color.secondary_text_color);
         mHintTextColorUnfocused = getResources().getColor(R.color.editor_disabled_text_color);
         mExpansionView = (ImageView) findViewById(R.id.expansion_view);
         mExpansionViewContainer = findViewById(R.id.expansion_view_container);
@@ -151,13 +149,12 @@
     private OnFocusChangeListener mTextFocusChangeListener = new OnFocusChangeListener() {
         @Override
         public void onFocusChange(View v, boolean hasFocus) {
-            // Check whether this field contains focus by calling findFocus() instead of
-            // hasFocus(). The hasFocus() value is not necessarily up to date.
-            final boolean foundFocus = TextFieldsEditorView.this.findFocus() != null;
-            setHintColorDark(foundFocus);
             if (getEditorListener() != null) {
                 getEditorListener().onRequest(EditorListener.EDITOR_FOCUS_CHANGED);
             }
+            // Check whether this field contains focus by calling findFocus() instead of
+            // hasFocus(). The hasFocus() value is not necessarily up to date.
+            final boolean foundFocus = TextFieldsEditorView.this.findFocus() != null;
             if (foundFocus && !isTypeVisible()) {
                 // We just got focus and the types are not visible
                 showType();
@@ -171,22 +168,6 @@
     };
 
     /**
-     * Set the hint color. If {@param isHintDark} is TRUE, then the hint color is set to a
-     * a darker color.
-     */
-    public void setHintColorDark(boolean isHintDark) {
-        if (mFieldEditTexts != null) {
-            for (EditText text : mFieldEditTexts) {
-                if (isHintDark) {
-                    text.setHintTextColor(mHintTextColor);
-                } else {
-                    text.setHintTextColor(mHintTextColorUnfocused);
-                }
-            }
-        }
-    }
-
-    /**
      * Creates or removes the type/label button. Doesn't do anything if already correctly configured
      */
     private void setupExpansionView(boolean shouldExist, boolean collapsed) {