Loading res/layout/editor_account_header_expandable.xml +13 −3 Original line number Diff line number Diff line Loading @@ -25,12 +25,22 @@ android:focusable="true" > <!-- TODO: consider making this a new style, like EditKindIconStyle --> <ImageView android:id="@android:id/icon" android:layout_width="@dimen/editor_kind_icon_size" android:layout_height="@dimen/editor_kind_icon_size" android:layout_marginEnd="28dp" android:layout_gravity="center_vertical" /> <LinearLayout android:id="@+id/account_info" android:layout_height="wrap_content" android:layout_width="0dp" android:layout_width="match_parent" android:layout_weight="1" android:paddingBottom="24dp" android:paddingTop="24dp" android:paddingBottom="@dimen/editor_account_header_expandable_top_bottom_padding" android:paddingTop="@dimen/editor_account_header_expandable_top_bottom_padding" android:orientation="vertical" > Loading res/layout/editor_account_selector.xml +14 −1 Original line number Diff line number Diff line Loading @@ -40,8 +40,9 @@ android:layout_weight="1" android:layout_gravity="center_vertical" android:orientation="vertical" android:layout_marginStart="4dp" android:layout_marginEnd="48dp" style="@android:style/Widget.Material.Spinner.Underlined"> > <TextView android:id="@+id/account_type_selector" Loading @@ -65,4 +66,16 @@ </LinearLayout> <ImageView android:src="@drawable/ic_menu_expander_minimized_holo_light" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical|end" android:layout_alignParentEnd="true" android:paddingStart="@dimen/editor_round_button_padding_left" android:paddingEnd="@dimen/editor_round_button_padding_right" android:paddingTop="@dimen/editor_round_button_padding_top" android:paddingBottom="@dimen/editor_round_button_padding_bottom"/> </LinearLayout> No newline at end of file res/values/dimens.xml +7 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,12 @@ <!-- Top margin for the first field of the compact contact editor --> <dimen name="editor_compact_first_field_padding">10dp</dimen> <!-- Top and bottom padding for the two text views in editor account header expandable --> <dimen name="editor_account_header_expandable_top_bottom_padding">24dp</dimen> <!-- left padding for the two text views in editor account header expandable --> <dimen name="editor_account_header_expandable_left_padding">4dp</dimen> <!-- Width and height of the expanded contact photo on the contact detail page --> <dimen name="detail_contact_photo_expanded_size">400dip</dimen> Loading Loading @@ -278,4 +284,5 @@ <!-- Top margin for "Saving to" account header text field. --> <dimen name="compact_editor_account_header_top_margin">3dp</dimen> </resources> src/com/android/contacts/editor/CompactRawContactsEditorView.java +1 −1 Original line number Diff line number Diff line Loading @@ -852,7 +852,7 @@ public class CompactRawContactsEditorView extends LinearLayout implements View.O EditorUiUtils.getAccountInfoContentDescription( accountInfo.first, selectorTitle)); mAccountSelector.setOnClickListener(new View.OnClickListener() { mAccountSelectorContainer.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { final ListPopupWindow popup = new ListPopupWindow(getContext(), null); Loading src/com/android/contacts/editor/RawContactEditorView.java +17 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ import android.util.Pair; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.android.contacts.GroupMetaDataLoader; Loading Loading @@ -77,6 +79,7 @@ public class RawContactEditorView extends BaseRawContactEditorView { private View mAccountHeader; private TextView mAccountHeaderTypeTextView; private TextView mAccountHeaderNameTextView; private ImageView mAccountIconImageView; private long mRawContactId = -1; private boolean mAutoAddToDefaultGroup = true; Loading Loading @@ -140,6 +143,17 @@ public class RawContactEditorView extends BaseRawContactEditorView { mAccountHeader = findViewById(R.id.account_header_container); mAccountHeaderTypeTextView = (TextView) findViewById(R.id.account_type); mAccountHeaderNameTextView = (TextView) findViewById(R.id.account_name); mAccountIconImageView = (ImageView) findViewById(android.R.id.icon); // The same header is used by both full editor and read-only editor view. The header is // left-aligned with read-only editor view but is not aligned well with full editor. So we // need to shift the text in the header a little bit for full editor. LinearLayout accountInfoView = (LinearLayout) findViewById(R.id.account_info); final int topBottomPaddingDp = (int) getResources().getDimension(R.dimen .editor_account_header_expandable_top_bottom_padding); final int leftPaddingDp = (int) getResources().getDimension(R.dimen .editor_account_header_expandable_left_padding); accountInfoView.setPadding(leftPaddingDp, topBottomPaddingDp, 0, topBottomPaddingDp); mAccountSelector = findViewById(R.id.account_selector_container); mAccountSelectorTypeTextView = (TextView) findViewById(R.id.account_type_selector); Loading Loading @@ -212,6 +226,9 @@ public class RawContactEditorView extends BaseRawContactEditorView { mAccountHeader.setVisibility(mAccountSelector.getVisibility() == View.GONE ? View.VISIBLE : View.GONE); mAccountIconImageView.setImageDrawable(state.getRawContactAccountType(getContext()) .getDisplayIcon(getContext())); // Show photo editor when supported RawContactModifier.ensureKindExists(state, type, Photo.CONTENT_ITEM_TYPE); setHasPhotoEditor((type.getKindForMimetype(Photo.CONTENT_ITEM_TYPE) != null)); Loading Loading
res/layout/editor_account_header_expandable.xml +13 −3 Original line number Diff line number Diff line Loading @@ -25,12 +25,22 @@ android:focusable="true" > <!-- TODO: consider making this a new style, like EditKindIconStyle --> <ImageView android:id="@android:id/icon" android:layout_width="@dimen/editor_kind_icon_size" android:layout_height="@dimen/editor_kind_icon_size" android:layout_marginEnd="28dp" android:layout_gravity="center_vertical" /> <LinearLayout android:id="@+id/account_info" android:layout_height="wrap_content" android:layout_width="0dp" android:layout_width="match_parent" android:layout_weight="1" android:paddingBottom="24dp" android:paddingTop="24dp" android:paddingBottom="@dimen/editor_account_header_expandable_top_bottom_padding" android:paddingTop="@dimen/editor_account_header_expandable_top_bottom_padding" android:orientation="vertical" > Loading
res/layout/editor_account_selector.xml +14 −1 Original line number Diff line number Diff line Loading @@ -40,8 +40,9 @@ android:layout_weight="1" android:layout_gravity="center_vertical" android:orientation="vertical" android:layout_marginStart="4dp" android:layout_marginEnd="48dp" style="@android:style/Widget.Material.Spinner.Underlined"> > <TextView android:id="@+id/account_type_selector" Loading @@ -65,4 +66,16 @@ </LinearLayout> <ImageView android:src="@drawable/ic_menu_expander_minimized_holo_light" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical|end" android:layout_alignParentEnd="true" android:paddingStart="@dimen/editor_round_button_padding_left" android:paddingEnd="@dimen/editor_round_button_padding_right" android:paddingTop="@dimen/editor_round_button_padding_top" android:paddingBottom="@dimen/editor_round_button_padding_bottom"/> </LinearLayout> No newline at end of file
res/values/dimens.xml +7 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,12 @@ <!-- Top margin for the first field of the compact contact editor --> <dimen name="editor_compact_first_field_padding">10dp</dimen> <!-- Top and bottom padding for the two text views in editor account header expandable --> <dimen name="editor_account_header_expandable_top_bottom_padding">24dp</dimen> <!-- left padding for the two text views in editor account header expandable --> <dimen name="editor_account_header_expandable_left_padding">4dp</dimen> <!-- Width and height of the expanded contact photo on the contact detail page --> <dimen name="detail_contact_photo_expanded_size">400dip</dimen> Loading Loading @@ -278,4 +284,5 @@ <!-- Top margin for "Saving to" account header text field. --> <dimen name="compact_editor_account_header_top_margin">3dp</dimen> </resources>
src/com/android/contacts/editor/CompactRawContactsEditorView.java +1 −1 Original line number Diff line number Diff line Loading @@ -852,7 +852,7 @@ public class CompactRawContactsEditorView extends LinearLayout implements View.O EditorUiUtils.getAccountInfoContentDescription( accountInfo.first, selectorTitle)); mAccountSelector.setOnClickListener(new View.OnClickListener() { mAccountSelectorContainer.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { final ListPopupWindow popup = new ListPopupWindow(getContext(), null); Loading
src/com/android/contacts/editor/RawContactEditorView.java +17 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ import android.util.Pair; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.android.contacts.GroupMetaDataLoader; Loading Loading @@ -77,6 +79,7 @@ public class RawContactEditorView extends BaseRawContactEditorView { private View mAccountHeader; private TextView mAccountHeaderTypeTextView; private TextView mAccountHeaderNameTextView; private ImageView mAccountIconImageView; private long mRawContactId = -1; private boolean mAutoAddToDefaultGroup = true; Loading Loading @@ -140,6 +143,17 @@ public class RawContactEditorView extends BaseRawContactEditorView { mAccountHeader = findViewById(R.id.account_header_container); mAccountHeaderTypeTextView = (TextView) findViewById(R.id.account_type); mAccountHeaderNameTextView = (TextView) findViewById(R.id.account_name); mAccountIconImageView = (ImageView) findViewById(android.R.id.icon); // The same header is used by both full editor and read-only editor view. The header is // left-aligned with read-only editor view but is not aligned well with full editor. So we // need to shift the text in the header a little bit for full editor. LinearLayout accountInfoView = (LinearLayout) findViewById(R.id.account_info); final int topBottomPaddingDp = (int) getResources().getDimension(R.dimen .editor_account_header_expandable_top_bottom_padding); final int leftPaddingDp = (int) getResources().getDimension(R.dimen .editor_account_header_expandable_left_padding); accountInfoView.setPadding(leftPaddingDp, topBottomPaddingDp, 0, topBottomPaddingDp); mAccountSelector = findViewById(R.id.account_selector_container); mAccountSelectorTypeTextView = (TextView) findViewById(R.id.account_type_selector); Loading Loading @@ -212,6 +226,9 @@ public class RawContactEditorView extends BaseRawContactEditorView { mAccountHeader.setVisibility(mAccountSelector.getVisibility() == View.GONE ? View.VISIBLE : View.GONE); mAccountIconImageView.setImageDrawable(state.getRawContactAccountType(getContext()) .getDisplayIcon(getContext())); // Show photo editor when supported RawContactModifier.ensureKindExists(state, type, Photo.CONTENT_ITEM_TYPE); setHasPhotoEditor((type.getKindForMimetype(Photo.CONTENT_ITEM_TYPE) != null)); Loading