diff options
author | Walter Jang <wjang@google.com> | 2015-05-27 11:00:55 -0700 |
---|---|---|
committer | Walter Jang <wjang@google.com> | 2015-06-01 17:27:03 -0700 |
commit | 3593f2379784e2d89dd6c2430f8c2b944483a1f8 (patch) | |
tree | 808a012cf63262b5484508613929ab7c2e4c2ffd /src | |
parent | 403743a0694aae952f3fd00235b7929dde3e1eca (diff) | |
download | packages_apps_Contacts-3593f2379784e2d89dd6c2430f8c2b944483a1f8.tar.gz packages_apps_Contacts-3593f2379784e2d89dd6c2430f8c2b944483a1f8.tar.bz2 packages_apps_Contacts-3593f2379784e2d89dd6c2430f8c2b944483a1f8.zip |
Only use one hint color on contact editors
Also, use the current 25% of black color which
already follows the material guideline.
Screenshots go/b21442589
Bug 21442589
Change-Id: I82c837fd9856c2165d3264a581165eb32702d807
Diffstat (limited to 'src')
3 files changed, 3 insertions, 73 deletions
diff --git a/src/com/android/contacts/editor/ContactEditorFragment.java b/src/com/android/contacts/editor/ContactEditorFragment.java index e9b371503..458e32554 100644 --- a/src/com/android/contacts/editor/ContactEditorFragment.java +++ b/src/com/android/contacts/editor/ContactEditorFragment.java @@ -269,10 +269,6 @@ public class ContactEditorFragment extends ContactEditorBaseFragment implements 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 class ContactEditorFragment extends ContactEditorBaseFragment implements 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 @@ public class ContactEditorFragment extends ContactEditorBaseFragment implements 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 @@ public class ContactEditorFragment extends ContactEditorBaseFragment implements } /** - * 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 cf94d8f6a..e2724a193 100644 --- a/src/com/android/contacts/editor/LabeledEditorView.java +++ b/src/com/android/contacts/editor/LabeledEditorView.java @@ -577,14 +577,12 @@ public abstract class LabeledEditorView extends LinearLayout implements Editor, 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 @@ public abstract class LabeledEditorView extends LinearLayout implements Editor, // 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 93454344d..fe476ed01 100644 --- a/src/com/android/contacts/editor/TextFieldsEditorView.java +++ b/src/com/android/contacts/editor/TextFieldsEditorView.java @@ -59,7 +59,6 @@ public class TextFieldsEditorView extends LabeledEditorView { private boolean mHasShortAndLongForms; private int mMinFieldHeight; private int mPreviousViewHeight; - private int mHintTextColor; private int mHintTextColorUnfocused; public TextFieldsEditorView(Context context) { @@ -85,7 +84,6 @@ public class TextFieldsEditorView extends LabeledEditorView { 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 @@ public class TextFieldsEditorView extends LabeledEditorView { 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 @@ public class TextFieldsEditorView extends LabeledEditorView { }; /** - * 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) { |