Loading res/layout/quickcontact_expanding_entry_card_button.xml +1 −14 Original line number Diff line number Diff line Loading @@ -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" Loading @@ -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 res/values/dimens.xml +0 −1 Original line number Diff line number Diff line Loading @@ -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 --> Loading src/com/android/contacts/quickcontact/ExpandingEntryCardView.java +0 −47 Original line number Diff line number Diff line Loading @@ -264,9 +264,6 @@ public class ExpandingEntryCardView extends CardView { 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 Loading Loading @@ -304,12 +301,8 @@ public class ExpandingEntryCardView extends CardView { 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>(); } /** Loading Loading @@ -773,49 +766,9 @@ public class ExpandingEntryCardView extends CardView { 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); Loading Loading
res/layout/quickcontact_expanding_entry_card_button.xml +1 −14 Original line number Diff line number Diff line Loading @@ -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" Loading @@ -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
res/values/dimens.xml +0 −1 Original line number Diff line number Diff line Loading @@ -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 --> Loading
src/com/android/contacts/quickcontact/ExpandingEntryCardView.java +0 −47 Original line number Diff line number Diff line Loading @@ -264,9 +264,6 @@ public class ExpandingEntryCardView extends CardView { 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 Loading Loading @@ -304,12 +301,8 @@ public class ExpandingEntryCardView extends CardView { 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>(); } /** Loading Loading @@ -773,49 +766,9 @@ public class ExpandingEntryCardView extends CardView { 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); Loading