Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2847e3c authored by Wenyi Wang's avatar Wenyi Wang Committed by android-build-merger
Browse files

Merge "Add account type icon to account info header and change style of...

Merge "Add account type icon to account info header and change style of "Saving to"" into ub-contactsdialer-a-dev
am: b708f0ad

* commit 'b708f0ad':
  Add account type icon to account info header and change style of "Saving to"
parents a4100041 b708f0ad
Loading
Loading
Loading
Loading
+13 −3
Original line number Original line Diff line number Diff line
@@ -25,12 +25,22 @@
    android:focusable="true"
    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
    <LinearLayout
        android:id="@+id/account_info"
        android:layout_height="wrap_content"
        android:layout_height="wrap_content"
        android:layout_width="0dp"
        android:layout_width="match_parent"
        android:layout_weight="1"
        android:layout_weight="1"
        android:paddingBottom="24dp"
        android:paddingBottom="@dimen/editor_account_header_expandable_top_bottom_padding"
        android:paddingTop="24dp"
        android:paddingTop="@dimen/editor_account_header_expandable_top_bottom_padding"
        android:orientation="vertical"
        android:orientation="vertical"
        >
        >


+14 −1
Original line number Original line Diff line number Diff line
@@ -40,8 +40,9 @@
        android:layout_weight="1"
        android:layout_weight="1"
        android:layout_gravity="center_vertical"
        android:layout_gravity="center_vertical"
        android:orientation="vertical"
        android:orientation="vertical"
        android:layout_marginStart="4dp"
        android:layout_marginEnd="48dp"
        android:layout_marginEnd="48dp"
        style="@android:style/Widget.Material.Spinner.Underlined">
        >


        <TextView
        <TextView
            android:id="@+id/account_type_selector"
            android:id="@+id/account_type_selector"
@@ -65,4 +66,16 @@


    </LinearLayout>
    </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>
</LinearLayout>
 No newline at end of file
+7 −0
Original line number Original line Diff line number Diff line
@@ -108,6 +108,12 @@
    <!-- Top margin for the first field of the compact contact editor -->
    <!-- Top margin for the first field of the compact contact editor -->
    <dimen name="editor_compact_first_field_padding">10dp</dimen>
    <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 -->
    <!-- Width and height of the expanded contact photo on the contact detail page -->
    <dimen name="detail_contact_photo_expanded_size">400dip</dimen>
    <dimen name="detail_contact_photo_expanded_size">400dip</dimen>


@@ -278,4 +284,5 @@


    <!-- Top margin for "Saving to" account header text field. -->
    <!-- Top margin for "Saving to" account header text field. -->
    <dimen name="compact_editor_account_header_top_margin">3dp</dimen>
    <dimen name="compact_editor_account_header_top_margin">3dp</dimen>

</resources>
</resources>
+1 −1
Original line number Original line Diff line number Diff line
@@ -852,7 +852,7 @@ public class CompactRawContactsEditorView extends LinearLayout implements View.O
                EditorUiUtils.getAccountInfoContentDescription(
                EditorUiUtils.getAccountInfoContentDescription(
                        accountInfo.first, selectorTitle));
                        accountInfo.first, selectorTitle));


        mAccountSelector.setOnClickListener(new View.OnClickListener() {
        mAccountSelectorContainer.setOnClickListener(new View.OnClickListener() {
            @Override
            @Override
            public void onClick(View v) {
            public void onClick(View v) {
                final ListPopupWindow popup = new ListPopupWindow(getContext(), null);
                final ListPopupWindow popup = new ListPopupWindow(getContext(), null);
+17 −0
Original line number Original line Diff line number Diff line
@@ -31,6 +31,8 @@ import android.util.Pair;
import android.view.LayoutInflater;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.TextView;


import com.android.contacts.GroupMetaDataLoader;
import com.android.contacts.GroupMetaDataLoader;
@@ -77,6 +79,7 @@ public class RawContactEditorView extends BaseRawContactEditorView {
    private View mAccountHeader;
    private View mAccountHeader;
    private TextView mAccountHeaderTypeTextView;
    private TextView mAccountHeaderTypeTextView;
    private TextView mAccountHeaderNameTextView;
    private TextView mAccountHeaderNameTextView;
    private ImageView mAccountIconImageView;


    private long mRawContactId = -1;
    private long mRawContactId = -1;
    private boolean mAutoAddToDefaultGroup = true;
    private boolean mAutoAddToDefaultGroup = true;
@@ -140,6 +143,17 @@ public class RawContactEditorView extends BaseRawContactEditorView {
        mAccountHeader = findViewById(R.id.account_header_container);
        mAccountHeader = findViewById(R.id.account_header_container);
        mAccountHeaderTypeTextView = (TextView) findViewById(R.id.account_type);
        mAccountHeaderTypeTextView = (TextView) findViewById(R.id.account_type);
        mAccountHeaderNameTextView = (TextView) findViewById(R.id.account_name);
        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);
        mAccountSelector = findViewById(R.id.account_selector_container);
        mAccountSelectorTypeTextView = (TextView) findViewById(R.id.account_type_selector);
        mAccountSelectorTypeTextView = (TextView) findViewById(R.id.account_type_selector);
@@ -212,6 +226,9 @@ public class RawContactEditorView extends BaseRawContactEditorView {
        mAccountHeader.setVisibility(mAccountSelector.getVisibility() == View.GONE
        mAccountHeader.setVisibility(mAccountSelector.getVisibility() == View.GONE
                ? View.VISIBLE : View.GONE);
                ? View.VISIBLE : View.GONE);


        mAccountIconImageView.setImageDrawable(state.getRawContactAccountType(getContext())
                .getDisplayIcon(getContext()));

        // Show photo editor when supported
        // Show photo editor when supported
        RawContactModifier.ensureKindExists(state, type, Photo.CONTENT_ITEM_TYPE);
        RawContactModifier.ensureKindExists(state, type, Photo.CONTENT_ITEM_TYPE);
        setHasPhotoEditor((type.getKindForMimetype(Photo.CONTENT_ITEM_TYPE) != null));
        setHasPhotoEditor((type.getKindForMimetype(Photo.CONTENT_ITEM_TYPE) != null));
Loading