Quantized edit fragment
Switched edit fragment's view to use the PeopleTheme.
After this, the default padding inside EditText changed. I set the
padding back to Holo padding.
Change-Id: Ic7ad33f4c0e6d75e6c173cc7c1689fb4651f959a
diff --git a/res/layout/editor_custom_action_bar.xml b/res/layout/editor_custom_action_bar.xml
index e8d9287..af7b738 100644
--- a/res/layout/editor_custom_action_bar.xml
+++ b/res/layout/editor_custom_action_bar.xml
@@ -54,7 +54,7 @@
android:layout_marginRight="20dip"
android:layout_marginEnd="20dip"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="@color/people_app_theme_color"
+ android:textColor="@color/actionbar_text_color"
android:text="@string/menu_done"
style="@android:style/Widget.Holo.ActionBar.TabText" />
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index f20ff91..7ac0502 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -40,6 +40,12 @@
<!-- Minimum height of a row in the Editor -->
<dimen name="editor_min_line_item_height">48dip</dimen>
+ <!-- Top padding of an EditText in the Editor -->
+ <dimen name="editor_text_field_top_padding">8dip</dimen>
+
+ <!-- Bottom padding of an EditText in the Editor -->
+ <dimen name="editor_text_field_bottom_padding">7dip</dimen>
+
<!-- Right padding of a field in the Editor -->
<dimen name="editor_field_right_padding">4dip</dimen>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 3584722..624d78a 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -26,15 +26,7 @@
<item name="android:listViewStyle">@style/ListViewStyle</item>
</style>
- <style name="EditorActivityTheme" parent="@android:style/Theme.Holo.Light">
- <item name="android:actionBarStyle">@style/ContactsActionBarStyle</item>
- <item name="android:homeAsUpIndicator">@drawable/ic_menu_back</item>
- <item name="android:actionOverflowButtonStyle">@style/ContactsActionBarOverflow</item>
- <item name="android:actionBarItemBackground">@drawable/action_bar_item_background</item>
- <item name="android:actionBarWidgetTheme">@style/ContactsActionBarTheme</item>
- <item name="android:windowContentOverlay">@null</item>
- <item name="android:textColorPrimary">@color/primary_text_color</item>
- <item name="android:textColorSecondary">@color/secondary_text_color</item>
+ <style name="EditorActivityTheme" parent="@style/PeopleTheme">
<item name="android:listViewStyle">@style/ListViewStyle</item>
</style>
diff --git a/src/com/android/contacts/editor/TextFieldsEditorView.java b/src/com/android/contacts/editor/TextFieldsEditorView.java
index 85cbac8..e658f53 100644
--- a/src/com/android/contacts/editor/TextFieldsEditorView.java
+++ b/src/com/android/contacts/editor/TextFieldsEditorView.java
@@ -58,6 +58,8 @@
private boolean mHideOptional = true;
private boolean mHasShortAndLongForms;
private int mMinFieldHeight;
+ private int mEditTextTopPadding;
+ private int mEditTextBottomPadding;
private int mPreviousViewHeight;
public TextFieldsEditorView(Context context) {
@@ -82,6 +84,10 @@
mMinFieldHeight = mContext.getResources().getDimensionPixelSize(
R.dimen.editor_min_line_item_height);
+ mEditTextBottomPadding = mContext.getResources().getDimensionPixelSize(
+ R.dimen.editor_text_field_bottom_padding);
+ mEditTextTopPadding = mContext.getResources().getDimensionPixelSize(
+ R.dimen.editor_text_field_top_padding);
mFields = (ViewGroup) findViewById(R.id.editors);
mExpansionView = (ImageView) findViewById(R.id.expansion_view);
mExpansionViewContainer = findViewById(R.id.expansion_view_container);
@@ -196,7 +202,7 @@
final EditField field = kind.fieldList.get(index);
final EditText fieldView = new EditText(mContext);
fieldView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,
- field.isMultiLine() ? LayoutParams.WRAP_CONTENT : mMinFieldHeight));
+ LayoutParams.WRAP_CONTENT));
// Set either a minimum line requirement or a minimum height (because {@link TextView}
// only takes one or the other at a single time).
if (field.minLines != 0) {
@@ -205,6 +211,9 @@
fieldView.setMinHeight(mMinFieldHeight);
}
fieldView.setTextAppearance(getContext(), android.R.style.TextAppearance_Medium);
+ fieldView.setPadding(fieldView.getPaddingLeft(), mEditTextTopPadding,
+ fieldView.getPaddingRight(), mEditTextBottomPadding);
+ fieldView.setHintTextColor(R.color.secondary_text_color);
fieldView.setGravity(Gravity.TOP);
mFieldEditTexts[index] = fieldView;
fieldView.setId(vig.getId(state, kind, entry, index));