From a5fd4d95805281c4d326062eedfd8079368ede55 Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Tue, 10 Jul 2018 18:41:45 +0000 Subject: Revert "UI refresh for call log items." This reverts commit 9c952d8f2688350f06d65df7852756ab05b6fdab. Change-Id: I3b2f23826c34ecdb16e786c5dd92f13ed97d88e7 --- .../app/calllog/CallLogListItemViewHolder.java | 23 +- .../dialer/app/res/layout/call_log_fragment.xml | 2 + .../dialer/app/res/layout/call_log_list_item.xml | 240 +++++++++++---------- java/com/android/dialer/app/res/values/dimens.xml | 9 +- .../dialer/calllogutils/CallTypeIconsView.java | 20 +- .../dialer/theme/common/res/values/dimens.xml | 2 + .../dialer/theme/common/res/values/styles.xml | 11 +- 7 files changed, 142 insertions(+), 165 deletions(-) diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java index c95334695..e044460c5 100644 --- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java @@ -46,7 +46,6 @@ import android.view.ContextMenu; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; -import android.view.ViewGroup; import android.view.ViewStub; import android.widget.ImageButton; import android.widget.ImageView; @@ -365,8 +364,6 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder PhoneCallDetailsHelper phoneCallDetailsHelper = new PhoneCallDetailsHelper(context, resources, callLogCache); - CardView cardView = new CardView(context); - cardView.setLayoutParams(new ViewGroup.MarginLayoutParams(0, 0)); CallLogListItemViewHolder viewHolder = new CallLogListItemViewHolder( context, @@ -381,7 +378,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder new DialerQuickContactBadge(context), new View(context), PhoneCallDetailsViews.createForTest(context), - cardView, + new CardView(context), new TextView(context), new ImageView(context)); viewHolder.detailsButtonView = new TextView(context); @@ -892,30 +889,12 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder bindActionButtons(); actionsView.setVisibility(View.VISIBLE); actionsView.setAlpha(1.0f); - ViewGroup.MarginLayoutParams layoutParams = - (ViewGroup.MarginLayoutParams) callLogEntryView.getLayoutParams(); - layoutParams.bottomMargin = - context - .getResources() - .getDimensionPixelSize(R.dimen.call_log_card_margin_bottom_expanded); - callLogEntryView.setLayoutParams(layoutParams); - callLogEntryView.setCardElevation( - context.getResources().getDimension(R.dimen.call_log_card_elevation_expanded)); } else { // When recycling a view, it is possible the actionsView ViewStub was previously // inflated so we should hide it in this case. if (actionsView != null) { actionsView.setVisibility(View.GONE); } - ViewGroup.MarginLayoutParams layoutParams = - (ViewGroup.MarginLayoutParams) callLogEntryView.getLayoutParams(); - layoutParams.bottomMargin = - context - .getResources() - .getDimensionPixelSize(R.dimen.call_log_card_margin_bottom_collapsed); - callLogEntryView.setLayoutParams(layoutParams); - callLogEntryView.setCardElevation( - context.getResources().getDimension(R.dimen.call_log_card_elevation_collapsed)); } updatePrimaryActionButton(show); diff --git a/java/com/android/dialer/app/res/layout/call_log_fragment.xml b/java/com/android/dialer/app/res/layout/call_log_fragment.xml index 5ceff2eba..bf91a3a07 100644 --- a/java/com/android/dialer/app/res/layout/call_log_fragment.xml +++ b/java/com/android/dialer/app/res/layout/call_log_fragment.xml @@ -62,6 +62,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingBottom="@dimen/floating_action_button_list_bottom_padding" + android:paddingStart="@dimen/call_log_horizontal_margin" + android:paddingEnd="@dimen/call_log_horizontal_margin" android:clipToPadding="false"/> + android:id="@+id/call_log_list_item" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + android:id="@+id/call_log_day_group_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="start" + android:layout_marginStart="@dimen/call_log_start_margin" + android:layout_marginEnd="@dimen/call_log_outer_margin" + android:paddingTop="@dimen/call_log_day_group_padding_top" + android:paddingBottom="@dimen/call_log_day_group_padding_bottom" + style="@style/Dialer.TextAppearance.OVERLINE.Ellipsize"/> + android:id="@+id/call_log_row" + style="@style/CallLogCardStyle"> + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + android:id="@+id/primary_action_view" + android:background="?android:attr/selectableItemBackground" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingStart="@dimen/call_log_start_margin" + android:paddingEnd="@dimen/call_log_outer_margin" + android:paddingTop="@dimen/call_log_vertical_padding" + android:paddingBottom="@dimen/call_log_vertical_padding" + android:orientation="horizontal" + android:gravity="center_vertical" + android:focusable="true" + android:nextFocusRight="@+id/call_back_action" + android:nextFocusLeft="@+id/quick_contact_photo"> + android:paddingTop="2dp" + android:nextFocusRight="@id/primary_action_view" + android:focusable="true"/> + android:visibility="gone" + android:src="@drawable/ic_check_mark_48dp" /> + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="vertical" + android:gravity="center_vertical" + android:layout_marginStart="@dimen/call_log_list_item_info_margin_start"> + android:id="@+id/name" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/call_log_name_margin_bottom" + android:layout_marginEnd="@dimen/call_log_icon_margin" + style="@style/Dialer.TextAppearance.Primary.Ellipsize"/> + android:id="@+id/call_type" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal"> + android:id="@+id/call_type_icons" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="@dimen/call_log_icon_margin" + android:layout_gravity="center_vertical"/> + android:id="@+id/work_profile_icon" + android:src="@drawable/ic_work_profile" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="@dimen/call_log_icon_margin" + android:scaleType="center" + android:visibility="gone"/> + android:id="@+id/call_location_and_date" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="@dimen/call_log_icon_margin" + android:layout_gravity="center_vertical" + style="Dialer.TextAppearance.Secondary.Ellipsize"/> + android:id="@+id/call_account_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="@dimen/call_log_call_account_margin_bottom" + android:layout_marginEnd="@dimen/call_log_icon_margin" + android:visibility="gone" + style="Dialer.TextAppearance.Secondary2.Ellipsize"/> + android:id="@+id/transcription" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="@dimen/call_log_icon_margin" + android:visibility="gone" + android:orientation="vertical"> + android:id="@+id/voicemail_transcription" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:focusable="true" + android:nextFocusDown="@+id/voicemail_transcription_branding" + android:textIsSelectable="true" + style="Dialer.TextAppearance.Secondary2"/> + android:id="@+id/voicemail_transcription_branding" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:focusable="true" + android:nextFocusUp="@id/voicemail_transcription" + android:nextFocusDown="@+id/voicemail_transcription_rating" + android:paddingTop="2dp" + style="Dialer.TextAppearance.Secondary2"/> + android:orientation="horizontal"> @@ -212,25 +214,25 @@ + android:id="@+id/primary_action_button" + android:layout_width="@dimen/call_log_list_item_primary_action_dimen" + android:layout_height="@dimen/call_log_list_item_primary_action_dimen" + android:layout_gravity="center_vertical" + android:background="?android:attr/selectableItemBackgroundBorderless" + android:scaleType="center" + android:tint="?colorIcon" + android:visibility="gone"/> + android:id="@+id/call_log_entry_actions_stub" + android:inflatedId="@+id/call_log_entry_actions" + android:layout="@layout/call_log_list_item_actions" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom"/> diff --git a/java/com/android/dialer/app/res/values/dimens.xml b/java/com/android/dialer/app/res/values/dimens.xml index 7a1f574ae..fdbcac93a 100644 --- a/java/com/android/dialer/app/res/values/dimens.xml +++ b/java/com/android/dialer/app/res/values/dimens.xml @@ -29,12 +29,9 @@ 18dp - 16dp - 16dp - 6dp - 0dp - 10dp - 4dp + 8dp + 8dp + 8dp 2dp 2dp 8dp diff --git a/java/com/android/dialer/calllogutils/CallTypeIconsView.java b/java/com/android/dialer/calllogutils/CallTypeIconsView.java index e268bb896..19c30c575 100644 --- a/java/com/android/dialer/calllogutils/CallTypeIconsView.java +++ b/java/com/android/dialer/calllogutils/CallTypeIconsView.java @@ -290,56 +290,56 @@ public class CallTypeIconsView extends View { int iconId = R.drawable.quantum_ic_call_received_white_24; Drawable drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); incoming = drawable.mutate(); - incoming.setColorFilter(r.getColor(R.color.dialer_call_green), PorterDuff.Mode.SRC_IN); + incoming.setColorFilter(r.getColor(R.color.dialer_call_green), PorterDuff.Mode.MULTIPLY); // Create a rotated instance of the call arrow for outgoing calls. iconId = R.drawable.quantum_ic_call_made_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); outgoing = drawable.mutate(); - outgoing.setColorFilter(r.getColor(R.color.dialer_call_green), PorterDuff.Mode.SRC_IN); + outgoing.setColorFilter(r.getColor(R.color.dialer_call_green), PorterDuff.Mode.MULTIPLY); // Need to make a copy of the arrow drawable, otherwise the same instance colored // above will be recolored here. iconId = R.drawable.quantum_ic_call_missed_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); missed = drawable.mutate(); - missed.setColorFilter(r.getColor(R.color.dialer_red), PorterDuff.Mode.SRC_IN); + missed.setColorFilter(r.getColor(R.color.dialer_red), PorterDuff.Mode.MULTIPLY); Theme theme = ThemeComponent.get(context).theme(); iconId = R.drawable.quantum_ic_voicemail_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); voicemail = drawable.mutate(); - voicemail.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.SRC_IN); + voicemail.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.MULTIPLY); iconId = R.drawable.quantum_ic_block_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); blocked = drawable.mutate(); - blocked.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.SRC_IN); + blocked.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.MULTIPLY); iconId = R.drawable.quantum_ic_videocam_vd_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); videoCall = drawable.mutate(); - videoCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.SRC_IN); + videoCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.MULTIPLY); iconId = R.drawable.quantum_ic_hd_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); hdCall = drawable.mutate(); - hdCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.SRC_IN); + hdCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.MULTIPLY); iconId = R.drawable.quantum_ic_signal_wifi_4_bar_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); wifiCall = drawable.mutate(); - wifiCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.SRC_IN); + wifiCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.MULTIPLY); iconId = R.drawable.quantum_ic_language_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); assistedDialedCall = drawable.mutate(); - assistedDialedCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.SRC_IN); + assistedDialedCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.MULTIPLY); iconId = R.drawable.quantum_ic_rtt_vd_theme_24; drawable = largeIcons ? r.getDrawable(iconId, null) : getScaledBitmap(context, iconId); rttCall = drawable.mutate(); - rttCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.SRC_IN); + rttCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.MULTIPLY); iconMargin = largeIcons ? 0 : r.getDimensionPixelSize(R.dimen.call_log_icon_margin); } diff --git a/java/com/android/dialer/theme/common/res/values/dimens.xml b/java/com/android/dialer/theme/common/res/values/dimens.xml index fbc386ce3..88b8a0423 100644 --- a/java/com/android/dialer/theme/common/res/values/dimens.xml +++ b/java/com/android/dialer/theme/common/res/values/dimens.xml @@ -25,6 +25,8 @@ 14sp 48dp + 15dp + 9dp diff --git a/java/com/android/dialer/theme/common/res/values/styles.xml b/java/com/android/dialer/theme/common/res/values/styles.xml index 5db08f49a..ac23bdf98 100644 --- a/java/com/android/dialer/theme/common/res/values/styles.xml +++ b/java/com/android/dialer/theme/common/res/values/styles.xml @@ -20,14 +20,9 @@ @@ -45,4 +40,4 @@ - + \ No newline at end of file -- cgit v1.2.3