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

Commit 4b943553 authored by Paul Soulos's avatar Paul Soulos
Browse files

Fixes some entry layouts

Moves text over to match up with "See all"/"See less" and adds top margin when only header text is visible.

Bug: 16326938
Change-Id: Ib9171ba8c27ffccfc5eb3c1e023e827e8e71e7fe
parent 891bd2ba
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -171,7 +171,7 @@
    <dimen name="expanding_entry_card_item_padding_end">20dp</dimen>
    <dimen name="expanding_entry_card_item_padding_top">16dp</dimen>
    <dimen name="expanding_entry_card_item_padding_bottom">16dp</dimen>
    <dimen name="expanding_entry_card_item_image_spacing">16dp</dimen>
    <dimen name="expanding_entry_card_item_image_spacing">20dp</dimen>

    <!-- Dimensions for a button in ExpandingEntryCardView -->
    <dimen name="expanding_entry_card_button_padding_start">20dp</dimen>
+11 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.android.contacts.R;
@@ -508,6 +509,16 @@ public class ExpandingEntryCardView extends LinearLayout {
            view.setTag(entry.getIntent());
        }

        // If only the header is visible, add a top margin to match icon's top margin
        if (header.getVisibility() == View.VISIBLE && subHeader.getVisibility() == View.GONE &&
                text.getVisibility() == View.GONE) {
            RelativeLayout.LayoutParams headerLayoutParams =
                    (RelativeLayout.LayoutParams) header.getLayoutParams();
            headerLayoutParams.topMargin = (int) (getResources().getDimension(
                    R.dimen.expanding_entry_card_item_icon_margin_top));
            header.setLayoutParams(headerLayoutParams);
        }

        final ImageView alternateIcon = (ImageView) view.findViewById(R.id.icon_alternate);
        if (entry.getAlternateIcon() != null && entry.getAlternateIntent() != null) {
            alternateIcon.setImageDrawable(entry.getAlternateIcon());