diff options
7 files changed, 165 insertions, 142 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java index e044460c5..c95334695 100644 --- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java @@ -46,6 +46,7 @@ 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; @@ -364,6 +365,8 @@ 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, @@ -378,7 +381,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder new DialerQuickContactBadge(context), new View(context), PhoneCallDetailsViews.createForTest(context), - new CardView(context), + cardView, new TextView(context), new ImageView(context)); viewHolder.detailsButtonView = new TextView(context); @@ -889,12 +892,30 @@ 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 bf91a3a07..5ceff2eba 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,8 +62,6 @@ 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"/> <com.android.dialer.widget.EmptyContentView diff --git a/java/com/android/dialer/app/res/layout/call_log_list_item.xml b/java/com/android/dialer/app/res/layout/call_log_list_item.xml index c9c1a6739..5fbdf080b 100644 --- a/java/com/android/dialer/app/res/layout/call_log_list_item.xml +++ b/java/com/android/dialer/app/res/layout/call_log_list_item.xml @@ -15,48 +15,47 @@ --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - 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_list_item" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> <!-- Day group heading. Used to show a "today", "yesterday", "last week" or "other" heading above a group of call log entries. --> <TextView - 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_day_group_label" + style="@style/Dialer.TextAppearance.OVERLINE.Ellipsize" + android:layout_width="wrap_content" + android:layout_height="48dp" + android:layout_marginStart="@dimen/call_log_start_margin" + android:layout_marginEnd="@dimen/call_log_outer_margin" + android:layout_gravity="start" + android:gravity="center_vertical"/> <android.support.v7.widget.CardView - android:id="@+id/call_log_row" - style="@style/CallLogCardStyle"> + android:id="@+id/call_log_row" + style="@style/CallLogCardStyle"> <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical"> + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> <!-- Primary area containing the contact badge and caller information --> <LinearLayout - 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:id="@+id/primary_action_view" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingTop="@dimen/call_log_vertical_padding" + android:paddingBottom="@dimen/call_log_vertical_padding" + android:paddingStart="@dimen/call_log_start_margin" + android:paddingEnd="@dimen/call_log_outer_margin" + android:background="?android:attr/selectableItemBackground" + android:focusable="true" + android:gravity="center_vertical" + android:nextFocusLeft="@+id/quick_contact_photo" + android:nextFocusRight="@+id/call_back_action" + android:orientation="horizontal"> <FrameLayout android:layout_width="wrap_content" @@ -68,104 +67,103 @@ android:id="@+id/quick_contact_photo" android:layout_width="@dimen/contact_photo_size" android:layout_height="@dimen/contact_photo_size" - android:paddingTop="2dp" - android:nextFocusRight="@id/primary_action_view" - android:focusable="true"/> + android:focusable="true" + android:nextFocusRight="@id/primary_action_view"/> <ImageView android:id="@+id/quick_contact_checkbox" - android:scaleType="fitCenter" android:layout_width="@dimen/contact_photo_size" android:layout_height="@dimen/contact_photo_size" - android:visibility="gone" - android:src="@drawable/ic_check_mark_48dp" /> + android:scaleType="fitCenter" + android:src="@drawable/ic_check_mark_48dp" + android:visibility="gone"/> </FrameLayout> <LinearLayout - 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:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:layout_marginStart="@dimen/call_log_list_item_info_margin_start" + android:gravity="center_vertical" + android:orientation="vertical"> <com.android.dialer.widget.BidiTextView - 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/name" + style="@style/Dialer.TextAppearance.Primary.Ellipsize" + 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"/> <LinearLayout - android:id="@+id/call_type" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:orientation="horizontal"> - - <com.android.dialer.calllogutils.CallTypeIconsView - android:id="@+id/call_type_icons" + android:id="@+id/call_type" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginEnd="@dimen/call_log_icon_margin" - android:layout_gravity="center_vertical"/> + android:orientation="horizontal"> + + <com.android.dialer.calllogutils.CallTypeIconsView + 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"/> <ImageView - 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/work_profile_icon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="@dimen/call_log_icon_margin" + android:scaleType="center" + android:src="@drawable/ic_work_profile" + android:visibility="gone"/> <TextView - 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_location_and_date" + style="Dialer.TextAppearance.Secondary.Ellipsize" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="@dimen/call_log_icon_margin" + android:layout_gravity="center_vertical"/> </LinearLayout> <TextView - 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/call_account_label" + style="Dialer.TextAppearance.Secondary2.Ellipsize" + 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"/> <LinearLayout - 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/transcription" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="@dimen/call_log_icon_margin" + android:orientation="vertical" + android:visibility="gone"> <TextView - 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" + style="Dialer.TextAppearance.Secondary2" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:focusable="true" + android:nextFocusDown="@+id/voicemail_transcription_branding" + android:textIsSelectable="true"/> <TextView - 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:id="@+id/voicemail_transcription_branding" + style="Dialer.TextAppearance.Secondary2" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:paddingTop="2dp" + android:focusable="true" + android:nextFocusDown="@+id/voicemail_transcription_rating" + android:nextFocusUp="@id/voicemail_transcription"/> <LinearLayout android:id="@+id/voicemail_transcription_rating" @@ -173,38 +171,38 @@ android:layout_height="wrap_content" android:layout_marginTop="@dimen/call_log_icon_margin" android:layout_gravity="center_vertical" - android:visibility="gone" android:paddingTop="2dp" - android:orientation="horizontal"> + android:orientation="horizontal" + android:visibility="gone"> <TextView - style="@style/TranscriptionQualityRating" android:id="@+id/voicemail_transcription_rating_text" + style="@style/TranscriptionQualityRating" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" - android:gravity="start|center_vertical" android:focusable="true" + android:gravity="start|center_vertical" android:text="@string/voicemail_transcription_rating"/> <ImageView - style="@style/TranscriptionQualityRatingIcon" android:id="@+id/voicemail_transcription_rating_good" + style="@style/TranscriptionQualityRatingIcon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/description_rating_good" - android:gravity="end|center_vertical" android:focusable="true" + android:gravity="end|center_vertical" android:src="@drawable/quantum_ic_thumb_up_grey600_24"/> <ImageView - style="@style/TranscriptionQualityRatingIcon" android:id="@+id/voicemail_transcription_rating_bad" + style="@style/TranscriptionQualityRatingIcon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/description_rating_bad" - android:gravity="end|center_vertical" android:focusable="true" + android:gravity="end|center_vertical" android:src="@drawable/quantum_ic_thumb_down_grey600_24"/> </LinearLayout> @@ -214,25 +212,25 @@ </LinearLayout> <ImageView - 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/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"/> </LinearLayout> <!-- Viewstub with additional expandable actions for a call log entry --> <ViewStub - 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"/> + android:id="@+id/call_log_entry_actions_stub" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + android:inflatedId="@+id/call_log_entry_actions" + android:layout="@layout/call_log_list_item_actions"/> </LinearLayout> diff --git a/java/com/android/dialer/app/res/values/dimens.xml b/java/com/android/dialer/app/res/values/dimens.xml index fdbcac93a..7a1f574ae 100644 --- a/java/com/android/dialer/app/res/values/dimens.xml +++ b/java/com/android/dialer/app/res/values/dimens.xml @@ -29,9 +29,12 @@ <dimen name="select_all_text_left_padding">18dp</dimen> <!-- Call Log --> - <dimen name="call_log_horizontal_margin">8dp</dimen> - <dimen name="call_log_outer_margin">8dp</dimen> - <dimen name="call_log_start_margin">8dp</dimen> + <dimen name="call_log_outer_margin">16dp</dimen> + <dimen name="call_log_start_margin">16dp</dimen> + <dimen name="call_log_card_elevation_expanded">6dp</dimen> + <dimen name="call_log_card_elevation_collapsed">0dp</dimen> + <dimen name="call_log_card_margin_bottom_expanded">10dp</dimen> + <dimen name="call_log_card_margin_bottom_collapsed">4dp</dimen> <dimen name="call_log_name_margin_bottom">2dp</dimen> <dimen name="call_log_call_account_margin_bottom">2dp</dimen> <dimen name="call_log_vertical_padding">8dp</dimen> diff --git a/java/com/android/dialer/calllogutils/CallTypeIconsView.java b/java/com/android/dialer/calllogutils/CallTypeIconsView.java index 19c30c575..e268bb896 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.MULTIPLY); + incoming.setColorFilter(r.getColor(R.color.dialer_call_green), PorterDuff.Mode.SRC_IN); // 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.MULTIPLY); + outgoing.setColorFilter(r.getColor(R.color.dialer_call_green), PorterDuff.Mode.SRC_IN); // 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.MULTIPLY); + missed.setColorFilter(r.getColor(R.color.dialer_red), PorterDuff.Mode.SRC_IN); 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.MULTIPLY); + voicemail.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.SRC_IN); 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.MULTIPLY); + blocked.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.SRC_IN); 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.MULTIPLY); + videoCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.SRC_IN); 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.MULTIPLY); + hdCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.SRC_IN); 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.MULTIPLY); + wifiCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.SRC_IN); 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.MULTIPLY); + assistedDialedCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.SRC_IN); 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.MULTIPLY); + rttCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.SRC_IN); 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 88b8a0423..fbc386ce3 100644 --- a/java/com/android/dialer/theme/common/res/values/dimens.xml +++ b/java/com/android/dialer/theme/common/res/values/dimens.xml @@ -25,8 +25,6 @@ <dimen name="call_log_voicemail_transcription_text_size">14sp</dimen> <!-- Height of the call log actions section for each call log entry --> <dimen name="call_log_action_height">48dp</dimen> - <dimen name="call_log_day_group_padding_top">15dp</dimen> - <dimen name="call_log_day_group_padding_bottom">9dp</dimen> <!-- Height of the actionBar - this is 8dps bigger than the platform standard to give more room to the search box--> 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 ac23bdf98..5db08f49a 100644 --- a/java/com/android/dialer/theme/common/res/values/styles.xml +++ b/java/com/android/dialer/theme/common/res/values/styles.xml @@ -20,9 +20,14 @@ <style name="CallLogCardStyle" parent="CardView"> <item name="android:layout_width">match_parent</item> <item name="android:layout_height">wrap_content</item> - <item name="android:layout_margin">4dp</item> + <item name="android:layout_marginTop">4dp</item> + <item name="android:layout_marginBottom">4dp</item> + <item name="android:layout_marginStart">8dp</item> + <item name="android:layout_marginEnd">8dp</item> <item name="android:baselineAligned">false</item> - <item name="cardCornerRadius">2dp</item> + <item name="cardElevation">0dp</item> + <item name="cardMaxElevation">6dp</item> + <item name="cardCornerRadius">8dp</item> <item name="cardBackgroundColor">?android:attr/colorBackgroundFloating</item> </style> @@ -40,4 +45,4 @@ <style name="BottomSheetStyle" parent="Widget.Design.BottomSheet.Modal"> <item name="android:background">@drawable/bottom_sheet_background</item> </style> -</resources>
\ No newline at end of file +</resources> |