diff options
author | Walter Jang <wjang@google.com> | 2015-03-13 11:07:23 -0700 |
---|---|---|
committer | Walter Jang <wjang@google.com> | 2015-03-16 16:12:40 -0700 |
commit | 261e106d87056d0c9727dd9ae436d5aadadd0762 (patch) | |
tree | 1efea1744bf480bd751f44149dc580b49f427b21 /src/com/android/contacts | |
parent | 3670317c3f02b82b6f139f289281bb981d649a33 (diff) | |
download | packages_apps_Contacts-261e106d87056d0c9727dd9ae436d5aadadd0762.tar.gz packages_apps_Contacts-261e106d87056d0c9727dd9ae436d5aadadd0762.tar.bz2 packages_apps_Contacts-261e106d87056d0c9727dd9ae436d5aadadd0762.zip |
Compact contact editor UI tweaks
* Move delete ActionBar icon option back into the overflow
* Move the "More fields" option back to left alignment and
give it accent color
* Make unfocused fields 25% black
* Layout/padding tweaks
- Remove the 0 bottom padding on names so that all fields
have the same spacing between each other
- Use the min edit height on the "More fields" row
so that the spacing is the same as the other fields.
Bug 19729447
Change-Id: Ia11c74c1b65f96f937d6e51ed143f5f088b41561
Diffstat (limited to 'src/com/android/contacts')
5 files changed, 9 insertions, 30 deletions
diff --git a/src/com/android/contacts/editor/CompactContactEditorFragment.java b/src/com/android/contacts/editor/CompactContactEditorFragment.java index 121fc88b2..e31e0639b 100644 --- a/src/com/android/contacts/editor/CompactContactEditorFragment.java +++ b/src/com/android/contacts/editor/CompactContactEditorFragment.java @@ -116,10 +116,6 @@ public class CompactContactEditorFragment extends ContactEditorBaseFragment impl mPhotoMode = photoMode; } - public void setPhotoMode(int photoMode) { - mPhotoMode = photoMode; - } - @Override public void onClick(View view) { PhotoSourceDialogFragment.show(CompactContactEditorFragment.this, mPhotoMode); diff --git a/src/com/android/contacts/editor/CompactPhotoEditorView.java b/src/com/android/contacts/editor/CompactPhotoEditorView.java index ef0565135..3481a332f 100644 --- a/src/com/android/contacts/editor/CompactPhotoEditorView.java +++ b/src/com/android/contacts/editor/CompactPhotoEditorView.java @@ -72,14 +72,16 @@ public class CompactPhotoEditorView extends LinearLayout implements View.OnClick public CompactPhotoEditorView(Context context, AttributeSet attrs) { super(context, attrs); - - final TypedValue landscapePhotoRatio = new TypedValue(); - getResources().getValue(R.dimen.quickcontact_landscape_photo_ratio, landscapePhotoRatio, - /* resolveRefs =*/ true); - mLandscapePhotoRatio = landscapePhotoRatio.getFloat(); + mLandscapePhotoRatio = getTypedFloat(R.dimen.quickcontact_landscape_photo_ratio); mIsTwoPanel = getResources().getBoolean(R.bool.quickcontact_two_panel); } + private float getTypedFloat(int resourceId) { + final TypedValue typedValue = new TypedValue(); + getResources().getValue(resourceId, typedValue, /* resolveRefs =*/ true); + return typedValue.getFloat(); + } + @Override protected void onFinishInflate() { super.onFinishInflate(); @@ -137,7 +139,6 @@ public class CompactPhotoEditorView extends LinearLayout implements View.OnClick SchedulingUtils.doOnPreDraw(this, /* drawNextFrame =*/ false, new Runnable() { @Override public void run() { - final int photoHeight, photoWidth; if (mIsTwoPanel) { // Make the photo slightly more narrow than it is tall @@ -145,8 +146,8 @@ public class CompactPhotoEditorView extends LinearLayout implements View.OnClick photoWidth = (int) (photoHeight * mLandscapePhotoRatio); } else { // Make the photo a square - photoHeight = getWidth(); - photoWidth = photoHeight; + photoWidth = getWidth(); + photoHeight = photoWidth; } final ViewGroup.LayoutParams layoutParams = getLayoutParams(); layoutParams.height = photoHeight; diff --git a/src/com/android/contacts/editor/ContactEditorBaseFragment.java b/src/com/android/contacts/editor/ContactEditorBaseFragment.java index 075aca30d..618772fbf 100644 --- a/src/com/android/contacts/editor/ContactEditorBaseFragment.java +++ b/src/com/android/contacts/editor/ContactEditorBaseFragment.java @@ -728,8 +728,6 @@ abstract public class ContactEditorBaseFragment extends Fragment implements final MenuItem sendToVoiceMailMenu = menu.findItem(R.id.menu_send_to_voicemail); final MenuItem ringToneMenu = menu.findItem(R.id.menu_set_ringtone); final MenuItem deleteMenu = menu.findItem(R.id.menu_delete); - deleteMenu.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); - deleteMenu.setIcon(R.drawable.ic_delete_white_24dp); // Set visibility of menus doneMenu.setVisible(false); diff --git a/src/com/android/contacts/editor/PhoneticNameEditorView.java b/src/com/android/contacts/editor/PhoneticNameEditorView.java index e64568721..420575cbd 100644 --- a/src/com/android/contacts/editor/PhoneticNameEditorView.java +++ b/src/com/android/contacts/editor/PhoneticNameEditorView.java @@ -151,12 +151,4 @@ public class PhoneticNameEditorView extends TextFieldsEditorView { return !TextUtils.isEmpty(family) || !TextUtils.isEmpty(middle) || !TextUtils.isEmpty(given); } - - /** {@inheritDoc} */ - @Override - protected void onFinishInflate() { - super.onFinishInflate(); - // Remove padding below this view. - setPadding(getPaddingLeft(), getPaddingTop(), getPaddingRight(), 0); - } } diff --git a/src/com/android/contacts/editor/StructuredNameEditorView.java b/src/com/android/contacts/editor/StructuredNameEditorView.java index 82d6324f1..0f98f53a4 100644 --- a/src/com/android/contacts/editor/StructuredNameEditorView.java +++ b/src/com/android/contacts/editor/StructuredNameEditorView.java @@ -287,12 +287,4 @@ public class StructuredNameEditorView extends TextFieldsEditorView { return 0; } } - - /** {@inheritDoc} */ - @Override - protected void onFinishInflate() { - super.onFinishInflate(); - // Remove padding below this view. - setPadding(getPaddingLeft(), getPaddingTop(), getPaddingRight(), 0); - } } |