Merge "Tweak test size annotations." into ub-contactsdialer-g-dev
diff --git a/res/layout/quickcontact_expanding_entry_card_button.xml b/res/layout/quickcontact_expanding_entry_card_button.xml
index b198b06..5ab6189 100644
--- a/res/layout/quickcontact_expanding_entry_card_button.xml
+++ b/res/layout/quickcontact_expanding_entry_card_button.xml
@@ -37,8 +37,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/expanding_entry_card_item_padding_start"
android:paddingBottom="@dimen/expanding_entry_card_button_padding_vertical"
- android:paddingTop="@dimen/expanding_entry_card_button_padding_vertical"
- android:layout_weight="0" />
+ android:paddingTop="@dimen/expanding_entry_card_button_padding_vertical"/>
<TextView
android:id="@+id/text"
@@ -46,22 +45,10 @@
android:layout_height="wrap_content"
android:paddingStart="@dimen/expanding_entry_card_item_image_spacing"
android:gravity="center_vertical"
- android:layout_weight="0"
android:paddingBottom="@dimen/expanding_entry_card_button_padding_vertical"
android:paddingTop="@dimen/expanding_entry_card_button_padding_vertical"
android:textColor="@color/expanding_entry_card_button_text_color"
android:textSize="@dimen/expanding_entry_card_title_text_size" />
-
- <LinearLayout
- android:id="@+id/badge_container"
- android:gravity="end"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginRight="11dp"
- android:layout_marginTop="@dimen/expanding_entry_card_button_padding_vertical"
- android:layout_weight="1"
- android:alpha=".3"
- android:orientation="horizontal" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index d355021..f3e73ff 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -214,7 +214,6 @@
<dimen name="expanding_entry_card_item_icon_margin_right">12dp</dimen>
<dimen name="expanding_entry_card_item_header_only_margin_top">6dp</dimen>
- <dimen name="expanding_entry_card_badge_separator_margin">8dp</dimen>
<dimen name="expanding_entry_card_card_corner_radius">2dp</dimen>
<dimen name="expanding_entry_card_header_margin_bottom">2dp</dimen>
<!-- The top margin when the sub header and text views are both gone -->
diff --git a/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java b/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java
index 018f468..d7efaf4 100644
--- a/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java
+++ b/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java
@@ -264,9 +264,6 @@
private boolean mIsAlwaysExpanded;
/** The ViewGroup to run the expand/collapse animation on */
private ViewGroup mAnimationViewGroup;
- private LinearLayout mBadgeContainer;
- private final List<ImageView> mBadges;
- private final List<Integer> mBadgeIds;
private final int mDividerLineHeightPixels;
/**
* List to hold the separators. This saves us from reconstructing every expand/collapse and
@@ -304,12 +301,8 @@
mExpandCollapseTextView = (TextView) mExpandCollapseButton.findViewById(R.id.text);
mExpandCollapseArrow = (ImageView) mExpandCollapseButton.findViewById(R.id.arrow);
mExpandCollapseButton.setOnClickListener(mExpandCollapseButtonListener);
- mBadgeContainer = (LinearLayout) mExpandCollapseButton.findViewById(R.id.badge_container);
mDividerLineHeightPixels = getResources()
.getDimensionPixelSize(R.dimen.divider_line_height);
-
- mBadges = new ArrayList<ImageView>();
- mBadgeIds = new ArrayList<Integer>();
}
/**
@@ -773,49 +766,9 @@
animator.setDuration(duration);
animator.start();
}
- updateBadges();
-
mExpandCollapseTextView.setText(buttonText);
}
- private void updateBadges() {
- if (mIsExpanded) {
- mBadgeContainer.removeAllViews();
- } else {
- int numberOfMimeTypesShown = mCollapsedEntriesCount;
-
- // Inflate badges if not yet created
- if (mBadges.size() < mEntries.size() - numberOfMimeTypesShown) {
- for (int i = numberOfMimeTypesShown; i < mEntries.size(); i++) {
- Drawable badgeDrawable = mEntries.get(i).get(0).getIcon();
- int badgeResourceId = mEntries.get(i).get(0).getIconResourceId();
- // Do not add the same badge twice
- if (badgeResourceId != 0 && mBadgeIds.contains(badgeResourceId)) {
- continue;
- }
- if (badgeDrawable != null) {
- ImageView badgeView = new ImageView(getContext());
- LinearLayout.LayoutParams badgeViewParams = new LinearLayout.LayoutParams(
- (int) getResources().getDimension(
- R.dimen.expanding_entry_card_item_icon_width),
- (int) getResources().getDimension(
- R.dimen.expanding_entry_card_item_icon_height));
- badgeViewParams.setMarginEnd((int) getResources().getDimension(
- R.dimen.expanding_entry_card_badge_separator_margin));
- badgeView.setLayoutParams(badgeViewParams);
- badgeView.setImageDrawable(badgeDrawable);
- mBadges.add(badgeView);
- mBadgeIds.add(badgeResourceId);
- }
- }
- }
- mBadgeContainer.removeAllViews();
- for (ImageView badge : mBadges) {
- mBadgeContainer.addView(badge);
- }
- }
- }
-
private void expand() {
ChangeBounds boundsTransition = new ChangeBounds();
boundsTransition.setDuration(DURATION_EXPAND_ANIMATION_CHANGE_BOUNDS);