diff options
70 files changed, 646 insertions, 566 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"/> <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 5fbdf080b..c9c1a6739 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,47 +15,48 @@ --> <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" - 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: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.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: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"> + 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"> <FrameLayout android:layout_width="wrap_content" @@ -67,103 +68,104 @@ android:id="@+id/quick_contact_photo" android:layout_width="@dimen/contact_photo_size" android:layout_height="@dimen/contact_photo_size" - android:focusable="true" - android:nextFocusRight="@id/primary_action_view"/> + android:paddingTop="2dp" + android:nextFocusRight="@id/primary_action_view" + android:focusable="true"/> <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:scaleType="fitCenter" - android:src="@drawable/ic_check_mark_48dp" - android:visibility="gone"/> + android:visibility="gone" + android:src="@drawable/ic_check_mark_48dp" /> </FrameLayout> <LinearLayout - 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"> + 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"> <com.android.dialer.widget.BidiTextView - 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"/> + 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"/> <LinearLayout - android:id="@+id/call_type" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:orientation="horizontal"> + 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: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/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: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"/> + 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"/> <TextView - 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"/> + 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"/> </LinearLayout> <TextView - 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"/> + 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"/> <LinearLayout - 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"> + 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"> <TextView - 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"/> + 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"/> <TextView - 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"/> + 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"/> <LinearLayout android:id="@+id/voicemail_transcription_rating" @@ -171,38 +173,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:visibility="gone"> + android:orientation="horizontal"> <TextView - android:id="@+id/voicemail_transcription_rating_text" style="@style/TranscriptionQualityRating" + android:id="@+id/voicemail_transcription_rating_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" - android:focusable="true" android:gravity="start|center_vertical" + android:focusable="true" android:text="@string/voicemail_transcription_rating"/> <ImageView - android:id="@+id/voicemail_transcription_rating_good" style="@style/TranscriptionQualityRatingIcon" + android:id="@+id/voicemail_transcription_rating_good" android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/description_rating_good" - android:focusable="true" android:gravity="end|center_vertical" + android:focusable="true" android:src="@drawable/quantum_ic_thumb_up_grey600_24"/> <ImageView - android:id="@+id/voicemail_transcription_rating_bad" style="@style/TranscriptionQualityRatingIcon" + android:id="@+id/voicemail_transcription_rating_bad" android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/description_rating_bad" - android:focusable="true" android:gravity="end|center_vertical" + android:focusable="true" android:src="@drawable/quantum_ic_thumb_down_grey600_24"/> </LinearLayout> @@ -212,25 +214,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: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"/> + 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"/> </LinearLayout> 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 @@ <dimen name="select_all_text_left_padding">18dp</dimen> <!-- Call Log --> - <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_horizontal_margin">8dp</dimen> + <dimen name="call_log_outer_margin">8dp</dimen> + <dimen name="call_log_start_margin">8dp</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 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/contactsfragment/res/layout/add_contact_row.xml b/java/com/android/dialer/contactsfragment/res/layout/add_contact_row.xml index d2905e523..be4ee0853 100644 --- a/java/com/android/dialer/contactsfragment/res/layout/add_contact_row.xml +++ b/java/com/android/dialer/contactsfragment/res/layout/add_contact_row.xml @@ -45,6 +45,5 @@ android:paddingEnd="@dimen/text_padding_end" android:gravity="center_vertical" android:text="@string/all_contacts_empty_add_contact_action" - android:textColor="?android:attr/colorPrimary" - style="@style/Dialer.TextAppearance.Primary2"/> + style="@style/Dialer.TextAppearance.Primary"/> </LinearLayout> diff --git a/java/com/android/dialer/contactsfragment/res/layout/contact_row.xml b/java/com/android/dialer/contactsfragment/res/layout/contact_row.xml index 209acb00e..3309ab474 100644 --- a/java/com/android/dialer/contactsfragment/res/layout/contact_row.xml +++ b/java/com/android/dialer/contactsfragment/res/layout/contact_row.xml @@ -47,7 +47,11 @@ android:layout_height="match_parent" android:paddingStart="@dimen/text_padding_start" android:paddingEnd="@dimen/text_padding_end" + android:maxLines="1" + android:ellipsize="end" android:gravity="center_vertical" - style="@style/Dialer.TextAppearance.Primary.Ellipsize"/> + android:textSize="@dimen/text_size" + android:textColor="?android:attr/textColorPrimary" + android:fontFamily="sans-serif"/> </LinearLayout> </FrameLayout>
\ No newline at end of file diff --git a/java/com/android/dialer/main/impl/bottomnav/BottomNavItem.java b/java/com/android/dialer/main/impl/bottomnav/BottomNavItem.java index 48cfc8160..4794b8823 100644 --- a/java/com/android/dialer/main/impl/bottomnav/BottomNavItem.java +++ b/java/com/android/dialer/main/impl/bottomnav/BottomNavItem.java @@ -20,18 +20,20 @@ import android.content.Context; import android.content.res.ColorStateList; import android.support.annotation.DrawableRes; import android.support.annotation.Nullable; +import android.support.annotation.Px; import android.support.annotation.StringRes; import android.util.AttributeSet; import android.view.View; +import android.widget.FrameLayout; import android.widget.ImageView; -import android.widget.RelativeLayout; +import android.widget.LinearLayout; import android.widget.TextView; import com.android.dialer.common.Assert; import com.android.dialer.configprovider.ConfigProviderComponent; import com.android.dialer.theme.base.ThemeComponent; /** Navigation item in a bottom nav. */ -final class BottomNavItem extends RelativeLayout { +final class BottomNavItem extends LinearLayout { private ImageView image; private TextView text; @@ -55,7 +57,7 @@ final class BottomNavItem extends RelativeLayout { int colorId = selected ? ThemeComponent.get(getContext()).theme().getColorPrimary() - : ThemeComponent.get(getContext()).theme().getColorIcon(); + : ThemeComponent.get(getContext()).theme().getTextColorSecondary(); image.setImageTintList(ColorStateList.valueOf(colorId)); text.setTextColor(colorId); } @@ -85,6 +87,20 @@ final class BottomNavItem extends RelativeLayout { } notificationBadge.setVisibility(View.VISIBLE); notificationBadge.setText(countString); + + @Px int margin; + if (countString.length() == 1) { + margin = getContext().getResources().getDimensionPixelSize(R.dimen.badge_margin_length_1); + } else if (countString.length() == 2) { + margin = getContext().getResources().getDimensionPixelSize(R.dimen.badge_margin_length_2); + } else { + margin = getContext().getResources().getDimensionPixelSize(R.dimen.badge_margin_length_3); + } + + FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) image.getLayoutParams(); + params.setMarginStart(margin); + params.setMarginEnd(margin); + image.setLayoutParams(params); } } } diff --git a/java/com/android/dialer/main/impl/bottomnav/res/drawable/notification_badge.xml b/java/com/android/dialer/main/impl/bottomnav/res/drawable/notification_badge.xml index e02d7c441..65bc8f9b4 100644 --- a/java/com/android/dialer/main/impl/bottomnav/res/drawable/notification_badge.xml +++ b/java/com/android/dialer/main/impl/bottomnav/res/drawable/notification_badge.xml @@ -16,6 +16,8 @@ --> <shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="oval"> - <solid android:color="@color/dialer_red"/> + android:shape="rectangle"> + <solid android:color="?android:attr/colorPrimary"/> + <corners android:radius="20dp"/> + <stroke android:color="?android:attr/colorBackgroundFloating" android:width="2dp"/> </shape>
\ No newline at end of file diff --git a/java/com/android/dialer/main/impl/bottomnav/res/layout/bottom_nav_item.xml b/java/com/android/dialer/main/impl/bottomnav/res/layout/bottom_nav_item.xml index 8c0705fe0..02874a9d8 100644 --- a/java/com/android/dialer/main/impl/bottomnav/res/layout/bottom_nav_item.xml +++ b/java/com/android/dialer/main/impl/bottomnav/res/layout/bottom_nav_item.xml @@ -16,41 +16,49 @@ --> <com.android.dialer.main.impl.bottomnav.BottomNavItem xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="?android:attr/selectableItemBackgroundBorderless" + android:minWidth="80dp" android:minHeight="56dp" - android:minWidth="80dp"> + android:gravity="center" + android:background="?android:attr/selectableItemBackgroundBorderless"> - <ImageView - android:id="@+id/bottom_nav_item_image" - android:layout_width="24dp" - android:layout_height="24dp" - android:layout_marginTop="8dp" - android:layout_alignParentTop="true" - android:layout_centerHorizontal="true"/> + <FrameLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content"> + + <ImageView + android:id="@+id/bottom_nav_item_image" + android:layout_width="24dp" + android:layout_height="24dp" + android:layout_marginTop="8dp"/> + + <TextView + android:id="@+id/notification_badge" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="top|end" + android:layout_marginTop="2dp" + android:paddingStart="6dp" + android:paddingEnd="6dp" + android:paddingBottom="1dp" + android:minHeight="20dp" + android:minWidth="20dp" + android:gravity="center" + android:textSize="12sp" + android:textColor="?android:attr/textColorPrimaryInverse" + android:background="@drawable/notification_badge" + android:fontFamily="sans-serif-medium" + android:visibility="invisible"/> + </FrameLayout> - <TextView - android:id="@+id/notification_badge" - style="@style/Dialer.TextAppearance.OVERLINE" - android:layout_width="16dp" - android:layout_height="16dp" - android:layout_marginTop="2dp" - android:layout_marginStart="-8dp" - android:layout_alignParentTop="true" - android:layout_toEndOf="@id/bottom_nav_item_image" - android:background="@drawable/notification_badge" - android:gravity="center" - android:textColor="?android:attr/colorBackgroundFloating" - android:textSize="11dp" - android:visibility="invisible"/> <TextView android:id="@+id/bottom_nav_item_text" - style="@style/Dialer.TextAppearance.SubHeader2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="8dp" - android:layout_below="@id/bottom_nav_item_image" - android:layout_centerHorizontal="true" - android:gravity="center_horizontal"/> + android:gravity="center_horizontal" + android:textSize="12sp" + style="@style/Dialer.TextAppearance.Secondary"/> </com.android.dialer.main.impl.bottomnav.BottomNavItem>
\ No newline at end of file diff --git a/java/com/android/dialer/theme/hidden/res/color/dialer_icon_color.xml b/java/com/android/dialer/main/impl/bottomnav/res/values/dimens.xml index 594f82969..8fd376bda 100644 --- a/java/com/android/dialer/theme/hidden/res/color/dialer_icon_color.xml +++ b/java/com/android/dialer/main/impl/bottomnav/res/values/dimens.xml @@ -14,9 +14,8 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License --> - -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:color="@android:color/white" android:state_checked="true"/> - <item android:color="@color/google_grey_400" android:state_enabled="false"/> - <item android:color="@color/google_grey_700"/> -</selector> +<resources> + <dimen name="badge_margin_length_1">10dp</dimen> + <dimen name="badge_margin_length_2">14dp</dimen> + <dimen name="badge_margin_length_3">22dp</dimen> +</resources>
\ No newline at end of file diff --git a/java/com/android/dialer/main/impl/res/layout/main_activity.xml b/java/com/android/dialer/main/impl/res/layout/main_activity.xml index 5fd9bed7b..25db63773 100644 --- a/java/com/android/dialer/main/impl/res/layout/main_activity.xml +++ b/java/com/android/dialer/main/impl/res/layout/main_activity.xml @@ -58,7 +58,7 @@ android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_margin="24dp" + android:layout_margin="16dp" android:layout_gravity="end|bottom" android:src="@drawable/quantum_ic_dialpad_white_24" android:contentDescription="@string/dialpad_button_content_description" diff --git a/java/com/android/dialer/main/impl/toolbar/res/drawable/search_bar_background_rounded_corners.xml b/java/com/android/dialer/main/impl/toolbar/res/drawable/search_bar_background_rounded_corners.xml index 491d5d716..88f5a04ca 100644 --- a/java/com/android/dialer/main/impl/toolbar/res/drawable/search_bar_background_rounded_corners.xml +++ b/java/com/android/dialer/main/impl/toolbar/res/drawable/search_bar_background_rounded_corners.xml @@ -17,5 +17,5 @@ <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="?android:attr/colorBackgroundFloating"/> - <corners android:radius="8dp"/> + <corners android:radius="2dp"/> </shape> diff --git a/java/com/android/dialer/main/impl/toolbar/res/layout/expanded_search_bar.xml b/java/com/android/dialer/main/impl/toolbar/res/layout/expanded_search_bar.xml index 9ae884d8b..e5b72f233 100644 --- a/java/com/android/dialer/main/impl/toolbar/res/layout/expanded_search_bar.xml +++ b/java/com/android/dialer/main/impl/toolbar/res/layout/expanded_search_bar.xml @@ -29,7 +29,7 @@ android:background="?attr/selectableItemBackgroundBorderless" android:contentDescription="@string/action_menu_back_from_search" android:src="@drawable/quantum_ic_arrow_back_vd_theme_24" - android:tint="?colorIcon"/> + android:tint="?android:attr/colorPrimary"/> <EditText android:id="@+id/search_view" @@ -45,9 +45,10 @@ android:inputType="textFilter" android:maxLines="1" android:hint="@string/dialer_hint_find_contact" + android:textColor="?android:attr/textColorSecondary" android:textColorHint="?android:attr/textColorHint" android:textCursorDrawable="@drawable/custom_cursor" - style="@style/Dialer.TextAppearance.Primary"/> + android:textSize="16sp"/> <ImageView android:id="@+id/search_clear_button" diff --git a/java/com/android/dialer/main/impl/toolbar/res/layout/toolbar_layout.xml b/java/com/android/dialer/main/impl/toolbar/res/layout/toolbar_layout.xml index 187ece9bb..049cf2ef5 100644 --- a/java/com/android/dialer/main/impl/toolbar/res/layout/toolbar_layout.xml +++ b/java/com/android/dialer/main/impl/toolbar/res/layout/toolbar_layout.xml @@ -18,7 +18,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="@dimen/expanded_search_bar_height" - android:background="?android:attr/colorBackground" + android:background="?android:attr/colorPrimary" app:contentInsetEnd="0dp" app:contentInsetStart="0dp"> <FrameLayout @@ -61,8 +61,8 @@ android:layout_toEndOf="@+id/search_magnifying_glass" android:layout_toStartOf="@+id/voice_search_button" android:text="@string/dialer_hint_find_contact" - android:textColor="?android:attr/textColorHint" - style="@style/Dialer.TextAppearance.Primary"/> + android:textSize="16dp" + style="@style/Dialer.TextAppearance.Secondary"/> <ImageView android:id="@+id/voice_search_button" diff --git a/java/com/android/dialer/searchfragment/common/res/layout/search_contact_row.xml b/java/com/android/dialer/searchfragment/common/res/layout/search_contact_row.xml index 08d2baade..4f8e305fe 100644 --- a/java/com/android/dialer/searchfragment/common/res/layout/search_contact_row.xml +++ b/java/com/android/dialer/searchfragment/common/res/layout/search_contact_row.xml @@ -19,8 +19,8 @@ android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="@dimen/search_row_height" - android:paddingStart="16dp" - android:paddingEnd="16dp" + android:paddingStart="8dp" + android:paddingEnd="8dp" android:background="?android:attr/selectableItemBackground"> <QuickContactBadge @@ -44,6 +44,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_vertical|start" + android:fontFamily="sans-serif" style="@style/Dialer.TextAppearance.Primary"/> <com.android.dialer.widget.BidiTextView @@ -51,6 +52,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_vertical|start" + android:fontFamily="sans-serif" style="@style/Dialer.TextAppearance.Secondary"/> </LinearLayout> diff --git a/java/com/android/dialer/searchfragment/list/res/layout/header_layout.xml b/java/com/android/dialer/searchfragment/list/res/layout/header_layout.xml index 16f3701c6..ff59206ad 100644 --- a/java/com/android/dialer/searchfragment/list/res/layout/header_layout.xml +++ b/java/com/android/dialer/searchfragment/list/res/layout/header_layout.xml @@ -27,5 +27,5 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" - style="@style/Dialer.TextAppearance.OVERLINE.Ellipsize"/> + style="@style/Dialer.TextAppearance.Secondary.Ellipsize"/> </FrameLayout> diff --git a/java/com/android/dialer/theme/base/Theme.java b/java/com/android/dialer/theme/base/Theme.java index 3356a018c..6e0d20a7a 100644 --- a/java/com/android/dialer/theme/base/Theme.java +++ b/java/com/android/dialer/theme/base/Theme.java @@ -17,7 +17,6 @@ package com.android.dialer.theme.base; import android.content.Context; -import android.content.res.ColorStateList; import android.support.annotation.ColorInt; import android.support.annotation.IntDef; import android.support.annotation.StyleRes; @@ -44,9 +43,6 @@ public interface Theme { @StyleRes int getApplicationThemeRes(); - @StyleRes - int getBottomSheetStyleRes(); - Context getThemedContext(Context context); LayoutInflater getThemedLayoutInflator(LayoutInflater inflater); @@ -54,8 +50,6 @@ public interface Theme { @ColorInt int getColorIcon(); - ColorStateList getColorIconStateList(); - @ColorInt int getColorIconSecondary(); diff --git a/java/com/android/dialer/theme/base/impl/AospThemeImpl.java b/java/com/android/dialer/theme/base/impl/AospThemeImpl.java index cd1e16684..c8f20c731 100644 --- a/java/com/android/dialer/theme/base/impl/AospThemeImpl.java +++ b/java/com/android/dialer/theme/base/impl/AospThemeImpl.java @@ -17,7 +17,6 @@ package com.android.dialer.theme.base.impl; import android.content.Context; -import android.content.res.ColorStateList; import android.content.res.TypedArray; import android.support.annotation.ColorInt; import android.support.annotation.StyleRes; @@ -34,7 +33,6 @@ import javax.inject.Singleton; public class AospThemeImpl implements Theme { private int colorIcon = -1; - private final ColorStateList colorIconStateList; private int colorIconSecondary = -1; private int colorPrimary = -1; private int colorPrimaryDark = -1; @@ -82,7 +80,6 @@ public class AospThemeImpl implements Theme { colorBackground = array.getColor(/* index= */ 7, /* defValue= */ -1); colorBackgroundFloating = array.getColor(/* index= */ 8, /* defValue= */ -1); colorIcon = array.getColor(/* index= */ 9, /* defValue= */ -1); - colorIconStateList = array.getColorStateList(/* index= */ 9); colorIconSecondary = array.getColor(/* index= */ 10, /* defValue= */ -1); colorTextOnUnthemedDarkBackground = array.getColor(/* index= */ 11, /* defValue= */ -1); colorIconOnUnthemedDarkBackground = array.getColor(/* index= */ 12, /* defValue= */ -1); @@ -102,25 +99,10 @@ public class AospThemeImpl implements Theme { @Override public @StyleRes int getApplicationThemeRes() { switch (getTheme()) { - case LIGHT: - case LIGHT_M2: - return R.style.Dialer_ThemeBase_NoActionBar; case DARK: return R.style.Dialer_Dark_ThemeBase_NoActionBar; - case UNKNOWN: - default: - throw Assert.createIllegalStateFailException("Theme hasn't been set yet."); - } - } - - @Override - public @StyleRes int getBottomSheetStyleRes() { - switch (getTheme()) { case LIGHT: - case LIGHT_M2: - return R.style.DialerBottomSheetDialogStyle_Light; - case DARK: - return R.style.DialerBottomSheetDialogStyle_Dark; + return R.style.Dialer_ThemeBase_NoActionBar; case UNKNOWN: default: throw Assert.createIllegalStateFailException("Theme hasn't been set yet."); @@ -144,12 +126,6 @@ public class AospThemeImpl implements Theme { } @Override - public ColorStateList getColorIconStateList() { - Assert.checkArgument(colorIconStateList != null); - return colorIconStateList; - } - - @Override public @ColorInt int getColorIconSecondary() { Assert.checkArgument(colorIconSecondary != -1); return colorIconSecondary; diff --git a/java/com/android/dialer/theme/base/res/values/theme_dialer_dark.xml b/java/com/android/dialer/theme/base/res/values/theme_dialer_dark.xml index 282ddfebb..142bb897b 100644 --- a/java/com/android/dialer/theme/base/res/values/theme_dialer_dark.xml +++ b/java/com/android/dialer/theme/base/res/values/theme_dialer_dark.xml @@ -32,8 +32,6 @@ <!-- Activities and Applications should inherit from one of the themes above. --> <style name="Dialer.Dark.ThemeBase"> - <item name="android:statusBarColor">@color/google_grey_900</item> - <!-- These values should be used to color all backgrounds. --> <item name="android:colorBackground">@color/google_grey_900</item> <item name="android:colorBackgroundFloating">@color/google_grey_800</item> @@ -51,8 +49,8 @@ <item name="colorPrimary">@color/dialer_dark_theme_color</item> <item name="android:colorPrimaryDark">@color/dialer_dark_theme_color_dark</item> <item name="colorPrimaryDark">@color/dialer_dark_theme_color_dark</item> - <item name="android:colorAccent">@color/dialer_dark_theme_color</item> - <item name="colorAccent">@color/dialer_dark_theme_color</item> + <item name="android:colorAccent">@color/dialer_dark_secondary_color</item> + <item name="colorAccent">@color/dialer_dark_secondary_color</item> <!-- Used to automatically style check/selected checkbox, switches and radio buttons --> <item name="colorControlActivated">?android:attr/colorPrimary</item> @@ -64,10 +62,4 @@ <item name="colorIconOnUnthemedDarkBackground">@android:color/white</item> <item name="colorPrimary20pct">@color/dialer_dark_theme_color_20pct</item> </style> - - <style name="DialerBottomSheetDialogStyle.Dark"> - <item name="android:textColorPrimary">@color/dialer_dark_primary_text_color</item> - <item name="android:colorBackgroundFloating">@color/google_grey_800</item> - </style> - -</resources> +</resources>
\ No newline at end of file diff --git a/java/com/android/dialer/theme/base/res/values/theme_dialer_light.xml b/java/com/android/dialer/theme/base/res/values/theme_dialer_light.xml index b0428ee46..db06df4bd 100644 --- a/java/com/android/dialer/theme/base/res/values/theme_dialer_light.xml +++ b/java/com/android/dialer/theme/base/res/values/theme_dialer_light.xml @@ -38,11 +38,8 @@ <!-- Activities and Applications should inherit from one of the themes above. --> <style name="Dialer.ThemeBase"> - <item name="android:windowLightStatusBar">true</item> - <item name="android:statusBarColor">@android:color/white</item> - <!-- These values should be used to color all backgrounds. --> - <item name="android:colorBackground">@android:color/white</item> + <item name="android:colorBackground">@color/dialer_background_color</item> <item name="android:colorBackgroundFloating">@android:color/white</item> <!-- These values should be used to set text color. --> @@ -57,14 +54,14 @@ <item name="colorPrimary">@color/dialer_theme_color</item> <item name="android:colorPrimaryDark">@color/dialer_theme_color_dark</item> <item name="colorPrimaryDark">@color/dialer_theme_color_dark</item> - <item name="android:colorAccent">@color/dialer_theme_color</item> - <item name="colorAccent">@color/dialer_theme_color</item> + <item name="android:colorAccent">@color/dialer_secondary_color</item> + <item name="colorAccent">@color/dialer_secondary_color</item> <!-- Used to automatically style check/selected checkbox, switches and radio buttons --> <item name="colorControlActivated">?android:attr/colorPrimary</item> <!-- Dialer specific attributes. --> - <item name="colorIcon">@color/dialer_icon_color</item> + <item name="colorIcon">@color/google_grey_700</item> <item name="colorIconSecondary">@color/google_grey_400</item> <item name="colorTextOnUnthemedDarkBackground">@android:color/white</item> <item name="colorIconOnUnthemedDarkBackground">@android:color/white</item> @@ -84,11 +81,6 @@ <item name="android:windowAnimationStyle">@android:style/Animation</item> </style> - <style name="DialerBottomSheetDialogStyle.Light"> - <item name="android:textColorPrimary">@color/dialer_primary_text_color</item> - <item name="android:colorBackgroundFloating">@android:color/white</item> - </style> - <!-- Deprecated: Use Toolbar instead of ActionBar. --> <!-- Used to style all Dialer's action bars. Every actionbar is awarded this for free if the parent activity's theme extends from Dialer.ThemeBase.ActionBar or doesn't specify a theme. --> diff --git a/java/com/android/dialer/theme/common/res/values/colors.xml b/java/com/android/dialer/theme/common/res/values/colors.xml index 0af550fce..1831862b1 100644 --- a/java/com/android/dialer/theme/common/res/values/colors.xml +++ b/java/com/android/dialer/theme/common/res/values/colors.xml @@ -16,9 +16,9 @@ --> <!-- The colors in this file aren't configured at the theme level. --> <resources> - <color name="dialer_call_green">#34A853</color> - <color name="dialer_end_call_button_color">#D93025</color> - <color name="dialer_divider_line_color">#DADCE0</color> + <color name="dialer_call_green">#00C853</color> + <color name="dialer_end_call_button_color">#BD2A2A</color> + <color name="dialer_divider_line_color">#D8D8D8</color> <color name="dialer_link_color">#2A56C6</color> <color name="dialer_snackbar_action_text_color">#4285F4</color> @@ -27,8 +27,8 @@ <color name="notification_action_dismiss">#A52714</color> <color name="notification_action_answer_video">#097138</color> - <color name="dialer_red">#EA4335</color> + <color name="dialer_red">#C53929</color> <!-- Legacy --> <color name="blue_grey_100">#CFD8DC</color> -</resources> +</resources>
\ No newline at end of file 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 @@ <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 5db08f49a..2c6446ca1 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 @@ <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_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:layout_margin">4dp</item> <item name="android:baselineAligned">false</item> - <item name="cardElevation">0dp</item> - <item name="cardMaxElevation">6dp</item> - <item name="cardCornerRadius">8dp</item> + <item name="cardCornerRadius">2dp</item> <item name="cardBackgroundColor">?android:attr/colorBackgroundFloating</item> </style> @@ -36,13 +31,4 @@ <item name="android:layout_marginStart">20dp</item> <item name="android:paddingLeft">12dp</item> </style> - - <style name="DialerBottomSheetDialogStyle" parent="Theme.Design.BottomSheetDialog"> - <item name="android:windowBackground">@android:color/transparent</item> - <item name="bottomSheetStyle">@style/BottomSheetStyle</item> - </style> - - <style name="BottomSheetStyle" parent="Widget.Design.BottomSheet.Modal"> - <item name="android:background">@drawable/bottom_sheet_background</item> - </style> -</resources> +</resources>
\ No newline at end of file diff --git a/java/com/android/dialer/theme/common/res/values/text_styles.xml b/java/com/android/dialer/theme/common/res/values/text_styles.xml index 1f2d6c728..def5862d4 100644 --- a/java/com/android/dialer/theme/common/res/values/text_styles.xml +++ b/java/com/android/dialer/theme/common/res/values/text_styles.xml @@ -33,13 +33,7 @@ <style name="Dialer.TextAppearance.SubHeader" parent="TextAppearance.AppCompat"> <item name="android:textColor">?android:attr/textColorPrimary</item> - <item name="android:textSize">14sp</item> - <item name="android:fontFamily">sans-serif-medium</item> - </style> - - <style name="Dialer.TextAppearance.SubHeader2" parent="TextAppearance.AppCompat"> - <item name="android:textColor">?android:attr/textColorSecondary</item> - <item name="android:textSize">14sp</item> + <item name="android:textSize">16sp</item> <item name="android:fontFamily">sans-serif-medium</item> </style> @@ -49,12 +43,6 @@ <item name="android:fontFamily">sans-serif-regular</item> </style> - <style name="Dialer.TextAppearance.Primary2" parent="TextAppearance.AppCompat"> - <item name="android:textColor">?android:attr/textColorPrimary</item> - <item name="android:textSize">16sp</item> - <item name="android:fontFamily">sans-serif-regular</item> - </style> - <style name="Dialer.TextAppearance.Secondary" parent="TextAppearance.AppCompat"> <item name="android:textColor">?android:attr/textColorSecondary</item> <item name="android:textSize">14sp</item> @@ -93,11 +81,6 @@ <item name="android:maxLines">1</item> </style> - <style name="Dialer.TextAppearance.Primary2.Ellipsize"> - <item name="android:ellipsize">end</item> - <item name="android:maxLines">1</item> - </style> - <style name="Dialer.TextAppearance.Secondary.Ellipsize"> <item name="android:ellipsize">end</item> <item name="android:maxLines">1</item> diff --git a/java/com/android/dialer/theme/hidden/res/color/dialer_dark_primary_text_color.xml b/java/com/android/dialer/theme/hidden/res/color/dialer_dark_primary_text_color.xml index f14537cd5..703e40bed 100644 --- a/java/com/android/dialer/theme/hidden/res/color/dialer_dark_primary_text_color.xml +++ b/java/com/android/dialer/theme/hidden/res/color/dialer_dark_primary_text_color.xml @@ -17,5 +17,5 @@ <!-- Primary text color in the Phone app --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" android:color="@color/google_grey_700"/> - <item android:color="@color/google_grey_100"/> + <item android:color="@color/google_grey_400"/> </selector> diff --git a/java/com/android/dialer/theme/hidden/res/color/dialer_dark_secondary_text_color.xml b/java/com/android/dialer/theme/hidden/res/color/dialer_dark_secondary_text_color.xml index b94388a75..486669f91 100644 --- a/java/com/android/dialer/theme/hidden/res/color/dialer_dark_secondary_text_color.xml +++ b/java/com/android/dialer/theme/hidden/res/color/dialer_dark_secondary_text_color.xml @@ -17,5 +17,5 @@ <!-- Secondary text color in the Phone app --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" android:color="@color/google_grey_700"/> - <item android:color="@color/google_grey_400"/> + <item android:color="@color/google_grey_300"/> </selector> diff --git a/java/com/android/dialer/theme/hidden/res/values/colors_dialer_dark.xml b/java/com/android/dialer/theme/hidden/res/values/colors_dialer_dark.xml index 41c5fd1c5..e48474e9f 100644 --- a/java/com/android/dialer/theme/hidden/res/values/colors_dialer_dark.xml +++ b/java/com/android/dialer/theme/hidden/res/values/colors_dialer_dark.xml @@ -18,4 +18,5 @@ <color name="dialer_dark_theme_color">#5195EA</color> <color name="dialer_dark_theme_color_20pct">#335195EA</color> <color name="dialer_dark_theme_color_dark">#2374CE</color> + <color name="dialer_dark_secondary_color">#5195EA</color> </resources> diff --git a/java/com/android/dialer/theme/hidden/res/values/colors_dialer_light.xml b/java/com/android/dialer/theme/hidden/res/values/colors_dialer_light.xml index ec2f2629e..988aad78f 100644 --- a/java/com/android/dialer/theme/hidden/res/values/colors_dialer_light.xml +++ b/java/com/android/dialer/theme/hidden/res/values/colors_dialer_light.xml @@ -15,7 +15,9 @@ --> <resources> <!-- Essential theme colors --> - <color name="dialer_theme_color">@color/google_blue_600</color> + <color name="dialer_theme_color">#2A56C6</color> <color name="dialer_theme_color_20pct">#332A56C6</color> <color name="dialer_theme_color_dark">#1C3AA9</color> + <color name="dialer_secondary_color">#F50057</color> + <color name="dialer_background_color">#FAFAFA</color> </resources> diff --git a/java/com/android/dialer/theme/hidden/res/values/styles.xml b/java/com/android/dialer/theme/hidden/res/values/styles.xml index 454384892..44a35f8a2 100644 --- a/java/com/android/dialer/theme/hidden/res/values/styles.xml +++ b/java/com/android/dialer/theme/hidden/res/values/styles.xml @@ -51,6 +51,7 @@ <!-- Used to style all Dialer's AlertDialogs. Every button is awarded this for free if the parent activity's theme extends from Dialer.ThemeBase(.NoActionBar) or doesn't specify a theme. --> <style name="AlertDialogTheme" parent="Theme.AppCompat.Light.Dialog.Alert"> + <item name="android:textColorPrimary">@color/dialer_primary_text_color</item> <!-- TODO(a bug): figure out why ?android:attr/colorPrimary doesn't work here --> <item name="android:colorAccent">@color/dialer_theme_color</item> <item name="colorAccent">@color/dialer_theme_color</item> diff --git a/java/com/android/incallui/AnswerScreenPresenter.java b/java/com/android/incallui/AnswerScreenPresenter.java index 35290dee9..8b789f317 100644 --- a/java/com/android/incallui/AnswerScreenPresenter.java +++ b/java/com/android/incallui/AnswerScreenPresenter.java @@ -18,6 +18,7 @@ package com.android.incallui; import android.content.Context; import android.os.SystemClock; +import android.support.annotation.FloatRange; import android.support.annotation.NonNull; import android.support.v4.os.UserManagerCompat; import android.telecom.VideoProfile; @@ -215,6 +216,14 @@ public class AnswerScreenPresenter } } + @Override + public void updateWindowBackgroundColor(@FloatRange(from = -1f, to = 1.0f) float progress) { + InCallActivity activity = (InCallActivity) answerScreen.getAnswerScreenFragment().getActivity(); + if (activity != null) { + activity.updateWindowBackgroundColor(progress); + } + } + private class AnswerOnDisconnected implements DialerCallListener { private final DialerCall disconnectingCall; diff --git a/java/com/android/incallui/AnswerScreenPresenterStub.java b/java/com/android/incallui/AnswerScreenPresenterStub.java index a96fee392..e85fdaa37 100644 --- a/java/com/android/incallui/AnswerScreenPresenterStub.java +++ b/java/com/android/incallui/AnswerScreenPresenterStub.java @@ -16,6 +16,7 @@ package com.android.incallui; +import android.support.annotation.FloatRange; import com.android.incallui.answer.protocol.AnswerScreenDelegate; import com.android.incallui.incalluilock.InCallUiLock; @@ -49,6 +50,9 @@ public class AnswerScreenPresenterStub implements AnswerScreenDelegate { public void onAnswerAndReleaseButtonDisabled() {} @Override + public void updateWindowBackgroundColor(@FloatRange(from = -1f, to = 1.0f) float progress) {} + + @Override public boolean isActionTimeout() { return false; } diff --git a/java/com/android/incallui/CallButtonPresenter.java b/java/com/android/incallui/CallButtonPresenter.java index be803430b..7d12d5281 100644 --- a/java/com/android/incallui/CallButtonPresenter.java +++ b/java/com/android/incallui/CallButtonPresenter.java @@ -427,6 +427,11 @@ public class CallButtonPresenter return; } + if (call != null) { + inCallButtonUi.updateInCallButtonUiColors( + InCallPresenter.getInstance().getThemeColorManager().getSecondaryColor()); + } + final boolean isEnabled = state.isConnectingOrConnected() && !state.isIncoming() && call != null; inCallButtonUi.setEnabled(isEnabled); diff --git a/java/com/android/incallui/InCallActivity.java b/java/com/android/incallui/InCallActivity.java index fa4a06ecf..3ff1d269d 100644 --- a/java/com/android/incallui/InCallActivity.java +++ b/java/com/android/incallui/InCallActivity.java @@ -25,8 +25,12 @@ import android.app.KeyguardManager; import android.content.Context; import android.content.Intent; import android.content.res.Configuration; +import android.graphics.drawable.GradientDrawable; +import android.graphics.drawable.GradientDrawable.Orientation; import android.os.Bundle; import android.os.Trace; +import android.support.annotation.ColorInt; +import android.support.annotation.FloatRange; import android.support.annotation.IntDef; import android.support.annotation.NonNull; import android.support.annotation.Nullable; @@ -36,6 +40,7 @@ import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.support.v4.content.res.ResourcesCompat; +import android.support.v4.graphics.ColorUtils; import android.telecom.Call; import android.telecom.CallAudioState; import android.telecom.PhoneAccountHandle; @@ -132,6 +137,7 @@ public class InCallActivity extends TransactionSafeFragmentActivity private Animation dialpadSlideInAnimation; private Animation dialpadSlideOutAnimation; private Dialog errorDialog; + private GradientDrawable backgroundDrawable; private InCallOrientationEventListener inCallOrientationEventListener; private View pseudoBlackScreenOverlay; private SelectPhoneAccountDialogFragment selectPhoneAccountDialogFragment; @@ -150,6 +156,7 @@ public class InCallActivity extends TransactionSafeFragmentActivity private boolean isVisible; private boolean needDismissPendingDialogs; private boolean touchDownWhenPseudoScreenOff; + private int[] backgroundDrawableColors; @DialpadRequestType private int showDialpadRequest = DIALPAD_REQUEST_NONE; private SpeakEasyCallManager speakEasyCallManager; private DialogFragment rttRequestDialogFragment; @@ -867,6 +874,11 @@ public class InCallActivity extends TransactionSafeFragmentActivity public void onForegroundCallChanged(DialerCall newForegroundCall) { updateTaskDescription(); + + if (newForegroundCall == null || !didShowAnswerScreen) { + LogUtil.v("InCallActivity.onForegroundCallChanged", "resetting background color"); + updateWindowBackgroundColor(0 /* progress */); + } } private void updateTaskDescription() { @@ -880,6 +892,58 @@ public class InCallActivity extends TransactionSafeFragmentActivity getResources().getString(R.string.notification_ongoing_call), null /* icon */, color)); } + public void updateWindowBackgroundColor(@FloatRange(from = -1f, to = 1.0f) float progress) { + ThemeColorManager themeColorManager = InCallPresenter.getInstance().getThemeColorManager(); + @ColorInt int top; + @ColorInt int middle; + @ColorInt int bottom; + @ColorInt int gray = 0x66000000; + + if (isInMultiWindowMode()) { + top = themeColorManager.getBackgroundColorSolid(); + middle = themeColorManager.getBackgroundColorSolid(); + bottom = themeColorManager.getBackgroundColorSolid(); + } else { + top = themeColorManager.getBackgroundColorTop(); + middle = themeColorManager.getBackgroundColorMiddle(); + bottom = themeColorManager.getBackgroundColorBottom(); + } + + if (progress < 0) { + float correctedProgress = Math.abs(progress); + top = ColorUtils.blendARGB(top, gray, correctedProgress); + middle = ColorUtils.blendARGB(middle, gray, correctedProgress); + bottom = ColorUtils.blendARGB(bottom, gray, correctedProgress); + } + + boolean backgroundDirty = false; + if (backgroundDrawable == null) { + backgroundDrawableColors = new int[] {top, middle, bottom}; + backgroundDrawable = new GradientDrawable(Orientation.TOP_BOTTOM, backgroundDrawableColors); + backgroundDirty = true; + } else { + if (backgroundDrawableColors[0] != top) { + backgroundDrawableColors[0] = top; + backgroundDirty = true; + } + if (backgroundDrawableColors[1] != middle) { + backgroundDrawableColors[1] = middle; + backgroundDirty = true; + } + if (backgroundDrawableColors[2] != bottom) { + backgroundDrawableColors[2] = bottom; + backgroundDirty = true; + } + if (backgroundDirty) { + backgroundDrawable.setColors(backgroundDrawableColors); + } + } + + if (backgroundDirty) { + getWindow().setBackgroundDrawable(backgroundDrawable); + } + } + public boolean isVisible() { return isVisible; } diff --git a/java/com/android/incallui/StatusBarNotifier.java b/java/com/android/incallui/StatusBarNotifier.java index 439f6cf66..8316d76ee 100644 --- a/java/com/android/incallui/StatusBarNotifier.java +++ b/java/com/android/incallui/StatusBarNotifier.java @@ -93,8 +93,8 @@ import com.android.incallui.ringtone.InCallTonePlayer; import com.android.incallui.ringtone.ToneGeneratorFactory; import com.android.incallui.speakeasy.SpeakEasyComponent; import com.android.incallui.videotech.utils.SessionModificationState; +import com.google.common.base.Optional; import java.util.Objects; -import java.util.Optional; /** This class adds Notifications to the status bar for the in-call experience. */ public class StatusBarNotifier diff --git a/java/com/android/incallui/ThemeColorManager.java b/java/com/android/incallui/ThemeColorManager.java index 967fae9ff..1d4c287be 100644 --- a/java/com/android/incallui/ThemeColorManager.java +++ b/java/com/android/incallui/ThemeColorManager.java @@ -17,8 +17,10 @@ package com.android.incallui; import android.content.Context; +import android.graphics.Color; import android.support.annotation.ColorInt; import android.support.annotation.Nullable; +import android.support.v4.graphics.ColorUtils; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import android.telecom.TelecomManager; @@ -34,6 +36,10 @@ public class ThemeColorManager { private final MaterialColorMapUtils colorMap; @ColorInt private int primaryColor; @ColorInt private int secondaryColor; + @ColorInt private int backgroundColorTop; + @ColorInt private int backgroundColorMiddle; + @ColorInt private int backgroundColorBottom; + @ColorInt private int backgroundColorSolid; /** * If there is no actual call currently in the call list, this will be used as a fallback to @@ -51,21 +57,38 @@ public class ThemeColorManager { public void onForegroundCallChanged(Context context, @Nullable DialerCall newForegroundCall) { if (newForegroundCall == null) { - updateThemeColors(getHighlightColor(context, pendingPhoneAccountHandle), false); + updateThemeColors(context, getHighlightColor(context, pendingPhoneAccountHandle), false); } else { updateThemeColors( + context, getHighlightColor(context, newForegroundCall.getAccountHandle()), newForegroundCall.isSpam()); } } - private void updateThemeColors(@ColorInt int highlightColor, boolean isSpam) { + private void updateThemeColors(Context context, @ColorInt int highlightColor, boolean isSpam) { MaterialPalette palette; if (isSpam) { palette = colorMap.calculatePrimaryAndSecondaryColor(R.color.incall_call_spam_background_color); + backgroundColorTop = context.getColor(R.color.incall_background_gradient_spam_top); + backgroundColorMiddle = context.getColor(R.color.incall_background_gradient_spam_middle); + backgroundColorBottom = context.getColor(R.color.incall_background_gradient_spam_bottom); + backgroundColorSolid = context.getColor(R.color.incall_background_multiwindow_spam); } else { palette = colorMap.calculatePrimaryAndSecondaryColor(highlightColor); + backgroundColorTop = context.getColor(R.color.incall_background_gradient_top); + backgroundColorMiddle = context.getColor(R.color.incall_background_gradient_middle); + backgroundColorBottom = context.getColor(R.color.incall_background_gradient_bottom); + backgroundColorSolid = context.getColor(R.color.incall_background_multiwindow); + if (highlightColor != PhoneAccount.NO_HIGHLIGHT_COLOR) { + // The default background gradient has a subtle alpha. We grab that alpha and apply it to + // the phone account color. + backgroundColorTop = applyAlpha(palette.mPrimaryColor, backgroundColorTop); + backgroundColorMiddle = applyAlpha(palette.mPrimaryColor, backgroundColorMiddle); + backgroundColorBottom = applyAlpha(palette.mPrimaryColor, backgroundColorBottom); + backgroundColorSolid = applyAlpha(palette.mPrimaryColor, backgroundColorSolid); + } } primaryColor = palette.mPrimaryColor; @@ -92,4 +115,29 @@ public class ThemeColorManager { public int getSecondaryColor() { return secondaryColor; } + + @ColorInt + public int getBackgroundColorTop() { + return backgroundColorTop; + } + + @ColorInt + public int getBackgroundColorMiddle() { + return backgroundColorMiddle; + } + + @ColorInt + public int getBackgroundColorBottom() { + return backgroundColorBottom; + } + + @ColorInt + public int getBackgroundColorSolid() { + return backgroundColorSolid; + } + + @ColorInt + private static int applyAlpha(@ColorInt int color, @ColorInt int sourceColorWithAlpha) { + return ColorUtils.setAlphaComponent(color, Color.alpha(sourceColorWithAlpha)); + } } diff --git a/java/com/android/incallui/answer/impl/AnswerFragment.java b/java/com/android/incallui/answer/impl/AnswerFragment.java index 8bfdcbaf6..8d8b08791 100644 --- a/java/com/android/incallui/answer/impl/AnswerFragment.java +++ b/java/com/android/incallui/answer/impl/AnswerFragment.java @@ -50,12 +50,11 @@ import android.view.accessibility.AccessibilityNodeInfo; import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction; import android.widget.ImageView; import android.widget.LinearLayout; -import android.widget.TextView; import com.android.dialer.common.Assert; import com.android.dialer.common.FragmentUtils; import com.android.dialer.common.LogUtil; import com.android.dialer.common.MathUtil; -import com.android.dialer.logging.DialerImpression.Type; +import com.android.dialer.logging.DialerImpression; import com.android.dialer.logging.Logger; import com.android.dialer.multimedia.MultimediaData; import com.android.dialer.telecom.TelecomUtil; @@ -84,15 +83,15 @@ import com.android.incallui.incalluilock.InCallUiLock; import com.android.incallui.maps.MapsComponent; import com.android.incallui.sessiondata.AvatarPresenter; import com.android.incallui.sessiondata.MultimediaFragment; -import com.android.incallui.sessiondata.MultimediaFragment.Holder; +import com.android.incallui.speakeasy.Annotations.SpeakEasyChipResourceId; import com.android.incallui.speakeasy.SpeakEasyComponent; import com.android.incallui.util.AccessibilityUtil; import com.android.incallui.video.protocol.VideoCallScreen; import com.android.incallui.videotech.utils.VideoUtils; +import com.google.common.base.Optional; import java.util.ArrayList; import java.util.List; import java.util.Objects; -import java.util.Optional; /** The new version of the incoming call screen. */ @SuppressLint("ClickableViewAccessibility") @@ -102,7 +101,7 @@ public class AnswerFragment extends Fragment SmsSheetHolder, CreateCustomSmsHolder, AnswerMethodHolder, - Holder { + MultimediaFragment.Holder { @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) static final String ARG_CALL_ID = "call_id"; @@ -433,11 +432,6 @@ public class AnswerFragment extends Fragment secondaryButton.setFocusable(AccessibilityUtil.isAccessibilityEnabled(getContext())); secondaryButton.setAccessibilityDelegate(accessibilityDelegate); - // TODO(wangqi): Remove this when all secondary behavior is migrated to chip button. - if (secondaryBehavior.equals(SecondaryBehavior.REJECT_WITH_SMS)) { - secondaryButton.setVisibility(View.INVISIBLE); - } - if (isVideoUpgradeRequest()) { secondaryButton.setVisibility(View.INVISIBLE); } else if (isVideoCall()) { @@ -467,39 +461,26 @@ public class AnswerFragment extends Fragment }); } - private void addSecondaryActionChip( - @DrawableRes int iconRes, @StringRes int textRes, OnClickListener onClickListener) { - LinearLayout button = - (LinearLayout) - getLayoutInflater().inflate(R.layout.secondary_action_chip, chipContainer, false); - - ImageView icon = button.findViewById(R.id.secondary_action_icon); - icon.setImageResource(iconRes); - TextView text = button.findViewById(R.id.secondary_action_text); - text.setText(textRes); - button.setOnClickListener(onClickListener); - chipContainer.addView(button); - } - /** Initialize chip buttons */ private void initChips() { - if (allowSpeakEasy()) { - Optional<Integer> speakEasyIconOptional = - SpeakEasyComponent.get(getContext()).speakEasyIconResource(); - Optional<Integer> speakEasyTextOptional = - SpeakEasyComponent.get(getContext()).speakEasyTextResource(); - if (speakEasyIconOptional.isPresent() && speakEasyTextOptional.isPresent()) { - addSecondaryActionChip( - speakEasyIconOptional.get(), speakEasyTextOptional.get(), this::performSpeakEasy); - } + + if (!allowSpeakEasy()) { + chipContainer.setVisibility(View.GONE); + return; } - if (!isVideoCall() && !isVideoUpgradeRequest()) { - addSecondaryActionChip( - R.drawable.quantum_ic_message_white_24, - R.string.call_incoming_reply_with_sms, - v -> performSecondaryButtonAction()); + chipContainer.setVisibility(View.VISIBLE); + + @SpeakEasyChipResourceId + Optional<Integer> chipLayoutOptional = SpeakEasyComponent.get(getContext()).speakEasyChip(); + if (chipLayoutOptional.isPresent()) { + + LinearLayout chipLayout = + (LinearLayout) getLayoutInflater().inflate(chipLayoutOptional.get(), null); + + chipLayout.setOnClickListener(this::performSpeakEasy); + + chipContainer.addView(chipLayout); } - chipContainer.setVisibility(chipContainer.getChildCount() > 0 ? View.VISIBLE : View.GONE); } @Override @@ -899,6 +880,8 @@ public class AnswerFragment extends Fragment if (primaryCallState != null) { contactGridManager.setCallState(primaryCallState); } + + restoreBackgroundMaskColor(); } @Override @@ -917,6 +900,12 @@ public class AnswerFragment extends Fragment @Override public void onAnswerProgressUpdate(@FloatRange(from = -1f, to = 1f) float answerProgress) { + // Don't fade the window background for call waiting or video upgrades. Fading the background + // shows the system wallpaper which looks bad because on reject we switch to another call. + if (primaryCallState.state() == DialerCallState.INCOMING && !isVideoCall()) { + answerScreenDelegate.updateWindowBackgroundColor(answerProgress); + } + // Fade and scale contact name and video call text float startDelay = .25f; // Header progress is zero over positiveAdjustedProgress = [0, startDelay], @@ -945,6 +934,7 @@ public class AnswerFragment extends Fragment @Override public void resetAnswerProgress() { affordanceHolderLayout.reset(true); + restoreBackgroundMaskColor(); } private void animateEntry(@NonNull View rootView) { @@ -1005,13 +995,18 @@ public class AnswerFragment extends Fragment "AnswerFragment.rejectCall", "Null context when rejecting call. Logger call was skipped"); } else { - Logger.get(context).logImpression(Type.REJECT_INCOMING_CALL_FROM_ANSWER_SCREEN); + Logger.get(context) + .logImpression(DialerImpression.Type.REJECT_INCOMING_CALL_FROM_ANSWER_SCREEN); } buttonRejectClicked = true; answerScreenDelegate.onReject(); } } + private void restoreBackgroundMaskColor() { + answerScreenDelegate.updateWindowBackgroundColor(0); + } + private void restoreSwipeHintTexts() { if (getAnswerMethod() != null) { if (allowAnswerAndRelease()) { @@ -1156,7 +1151,7 @@ public class AnswerFragment extends Fragment public void onViewCreated(View view, @Nullable Bundle bundle) { super.onViewCreated(view, bundle); avatarImageView = ((ImageView) view.findViewById(R.id.contactgrid_avatar)); - FragmentUtils.getParentUnsafe(this, Holder.class).updateAvatar(this); + FragmentUtils.getParentUnsafe(this, MultimediaFragment.Holder.class).updateAvatar(this); } @NonNull diff --git a/java/com/android/incallui/answer/impl/SmsBottomSheetFragment.java b/java/com/android/incallui/answer/impl/SmsBottomSheetFragment.java index b06a0c681..6742e4a36 100644 --- a/java/com/android/incallui/answer/impl/SmsBottomSheetFragment.java +++ b/java/com/android/incallui/answer/impl/SmsBottomSheetFragment.java @@ -36,7 +36,6 @@ import android.widget.TextView; import com.android.dialer.common.DpUtil; import com.android.dialer.common.FragmentUtils; import com.android.dialer.common.LogUtil; -import com.android.dialer.theme.base.ThemeComponent; import com.android.incallui.incalluilock.InCallUiLock; import java.util.ArrayList; import java.util.List; @@ -69,8 +68,6 @@ public class SmsBottomSheetFragment extends BottomSheetDialogFragment { } } layout.addView(newTextViewItem(null)); - int paddingVertical = (int) DpUtil.dpToPx(getContext(), 8); - layout.setPadding(0, paddingVertical, 0, paddingVertical); layout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); return layout; } @@ -103,11 +100,11 @@ public class SmsBottomSheetFragment extends BottomSheetDialogFragment { TextView textView = new TextView(context); textView.setText(text == null ? getString(R.string.call_incoming_message_custom) : text); - int paddingHorizontal = (int) DpUtil.dpToPx(context, 24); - int paddingVertical = (int) DpUtil.dpToPx(context, 12); - textView.setPadding(paddingHorizontal, paddingVertical, paddingHorizontal, paddingVertical); + int padding = (int) DpUtil.dpToPx(context, 16); + textView.setPadding(padding, padding, padding, padding); textView.setBackground(background); - textView.setTextAppearance(R.style.Dialer_TextAppearance_Primary2); + textView.setTextColor(context.getColor(R.color.blue_grey_100)); + textView.setTextAppearance(R.style.TextAppearance_AppCompat_Widget_PopupMenu_Large); LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); @@ -127,7 +124,7 @@ public class SmsBottomSheetFragment extends BottomSheetDialogFragment { @Override public int getTheme() { - return ThemeComponent.get(getContext()).theme().getBottomSheetStyleRes(); + return R.style.Theme_Design_Light_BottomSheetDialog; } @Override diff --git a/java/com/android/incallui/answer/impl/answermethod/res/values/styles.xml b/java/com/android/incallui/answer/impl/answermethod/res/values/styles.xml new file mode 100644 index 000000000..fd3ca7ca0 --- /dev/null +++ b/java/com/android/incallui/answer/impl/answermethod/res/values/styles.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <style name="Dialer.Incall.TextAppearance.Hint"> + <item name="android:textSize">14sp</item> + <item name="android:textStyle">italic</item> + </style> +</resources> diff --git a/java/com/android/incallui/answer/impl/res/drawable/secondary_action_chip_background.xml b/java/com/android/incallui/answer/impl/res/drawable/secondary_action_chip_background.xml deleted file mode 100644 index a185ebb3c..000000000 --- a/java/com/android/incallui/answer/impl/res/drawable/secondary_action_chip_background.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2018 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License - --> -<ripple xmlns:android="http://schemas.android.com/apk/res/android" - android:color="@color/dialer_divider_line_color"> - <item> - <shape> - <solid android:color="?android:attr/colorBackgroundFloating"/> - <stroke - android:width="1dp" - android:color="@color/dialer_divider_line_color"/> - <padding - android:bottom="9dp" - android:left="8dp" - android:right="8dp" - android:top="9dp"/> - <corners android:radius="40dp"/> - </shape> - </item> -</ripple> diff --git a/java/com/android/incallui/answer/impl/res/drawable/urgent_call_background.xml b/java/com/android/incallui/answer/impl/res/drawable/urgent_call_background.xml index 769529025..d995980c6 100644 --- a/java/com/android/incallui/answer/impl/res/drawable/urgent_call_background.xml +++ b/java/com/android/incallui/answer/impl/res/drawable/urgent_call_background.xml @@ -18,5 +18,5 @@ <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:radius="24dp"/> - <solid android:color="?android:attr/colorPrimary"/> + <solid android:color="#F50057"/> </shape>
\ No newline at end of file diff --git a/java/com/android/incallui/answer/impl/res/layout/fragment_avatar.xml b/java/com/android/incallui/answer/impl/res/layout/fragment_avatar.xml index 246abc577..f8e48942c 100644 --- a/java/com/android/incallui/answer/impl/res/layout/fragment_avatar.xml +++ b/java/com/android/incallui/answer/impl/res/layout/fragment_avatar.xml @@ -21,4 +21,5 @@ android:id="@id/contactgrid_avatar" android:layout_width="@dimen/answer_avatar_size" android:layout_height="@dimen/answer_avatar_size" - android:layout_gravity="center"/> + android:layout_gravity="center" + android:elevation="@dimen/answer_data_elevation"/> diff --git a/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml b/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml index b5f1e4bb3..1672bf984 100644 --- a/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml +++ b/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml @@ -118,18 +118,22 @@ android:layout_marginStart="24dp" android:layout_marginEnd="24dp"/> + <!-- TODO(a bug): textColorPrimary or textColorPrimaryInverse? --> <TextView android:id="@+id/incall_important_call_badge" - style="@style/Dialer.TextAppearance.SubHeader" + android:textStyle="bold" android:layout_width="wrap_content" - android:layout_height="32dp" + android:layout_height="48dp" android:layout_marginTop="4dp" android:layout_marginBottom="@dimen/answer_importance_margin_bottom" android:background="@drawable/urgent_call_background" + android:elevation="@dimen/answer_data_elevation" android:gravity="center" android:maxLines="1" android:text="@string/call_incoming_important" - android:textColor="?android:attr/colorBackground"/> + android:textAllCaps="true" + android:textColor="?android:attr/colorBackground" + android:textSize="14sp"/> <FrameLayout android:id="@+id/incall_location_holder" @@ -137,7 +141,9 @@ android:layout_height="wrap_content"/> <include - layout="@layout/device_number_row"/> + layout="@layout/device_number_row" + android:layout_width="match_parent" + android:layout_height="wrap_content"/> <FrameLayout android:id="@+id/incall_data_container" diff --git a/java/com/android/incallui/answer/impl/res/layout/secondary_action_chip.xml b/java/com/android/incallui/answer/impl/res/layout/secondary_action_chip.xml deleted file mode 100644 index dd4199b0c..000000000 --- a/java/com/android/incallui/answer/impl/res/layout/secondary_action_chip.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2018 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License - --> -<LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:background="@drawable/secondary_action_chip_background" - android:clickable="true" - android:layout_marginEnd="8dp" - android:orientation="horizontal"> - <ImageView - android:id="@+id/secondary_action_icon" - android:layout_width="20dp" - android:layout_height="20dp" - android:tint="?android:attr/colorPrimary"/> - <TextView - android:id="@+id/secondary_action_text" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginStart="8dp" - android:layout_marginEnd="8dp" - style="@style/Dialer.TextAppearance.SubHeader"/> -</LinearLayout> diff --git a/java/com/android/incallui/answer/impl/res/values/strings.xml b/java/com/android/incallui/answer/impl/res/values/strings.xml index ac56460f1..2bc9ca09f 100644 --- a/java/com/android/incallui/answer/impl/res/values/strings.xml +++ b/java/com/android/incallui/answer/impl/res/values/strings.xml @@ -20,8 +20,6 @@ <string name="call_incoming_default_label_answer_and_release_second">Swipe up to answer and hold ongoing call</string> <string name="call_incoming_default_label_answer_and_release_third">Swipe up to answer and end call on hold</string> <string name="call_incoming_swipe_to_answer_and_release">Swipe from icon to answer and end ongoing call</string> - <!-- Reply with SMS option on incoming call screen. [CHAT LIMIT=20] --> - <string name="call_incoming_reply_with_sms">Reply</string> <string name="call_incoming_message_custom">Write your own…</string> <!-- "Respond via SMS" option that lets you compose a custom response. [CHAR LIMIT=30] --> <string name="call_incoming_respond_via_sms_custom_message">Write your own…</string> diff --git a/java/com/android/incallui/answer/protocol/AnswerScreenDelegate.java b/java/com/android/incallui/answer/protocol/AnswerScreenDelegate.java index db2af9bbb..172d9646a 100644 --- a/java/com/android/incallui/answer/protocol/AnswerScreenDelegate.java +++ b/java/com/android/incallui/answer/protocol/AnswerScreenDelegate.java @@ -16,6 +16,7 @@ package com.android.incallui.answer.protocol; +import android.support.annotation.FloatRange; import com.android.incallui.incalluilock.InCallUiLock; /** Callbacks implemented by the container app for this module. */ @@ -36,6 +37,16 @@ public interface AnswerScreenDelegate { void onAnswerAndReleaseButtonEnabled(); void onAnswerAndReleaseButtonDisabled(); + /** + * Sets the window background color based on foreground call's theme and the given progress. This + * is called from the answer UI to animate the accept and reject action. + * + * <p>When the user is rejecting we animate the background color to a mostly transparent gray. The + * end effect is that the home screen shows through. + * + * @param progress float from -1 to 1. -1 is fully rejected, 1 is fully accepted, and 0 is neutral + */ + void updateWindowBackgroundColor(@FloatRange(from = -1f, to = 1.0f) float progress); /** Returns true if any answer/reject action timed out. */ boolean isActionTimeout(); diff --git a/java/com/android/incallui/calllocation/impl/res/drawable/bg_location_card.xml b/java/com/android/incallui/calllocation/impl/res/drawable/bg_location_card.xml index c0924468c..0bcba95f2 100644 --- a/java/com/android/incallui/calllocation/impl/res/drawable/bg_location_card.xml +++ b/java/com/android/incallui/calllocation/impl/res/drawable/bg_location_card.xml @@ -17,5 +17,5 @@ <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="@color/ripple_material_light"> - <item android:drawable="?android:attr/colorBackgroundFloating"/> + <item android:drawable="@android:color/white"/> </ripple> diff --git a/java/com/android/incallui/calllocation/impl/res/values/styles.xml b/java/com/android/incallui/calllocation/impl/res/values/styles.xml new file mode 100644 index 000000000..45e9c98d4 --- /dev/null +++ b/java/com/android/incallui/calllocation/impl/res/values/styles.xml @@ -0,0 +1,47 @@ +<!-- + ~ Copyright (C) 2018 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> +<resources> + + <style name="LocationAddressTitleTextStyle"> + <item name="android:textSize">14sp</item> + <item name="android:textColor">#dd000000</item> + <item name="android:fontFamily">sans-serif-medium</item> + </style> + + <style name="LocationAddressTextStyle"> + <item name="android:textSize">16sp</item> + <item name="android:textColor">#dd000000</item> + <item name="android:fontFamily">sans-serif</item> + </style> + + <style name="LocationLatLongTextStyle"> + <item name="android:textSize">14sp</item> + <item name="android:textColor">#88000000</item> + <item name="android:fontFamily">sans-serif</item> + </style> + + <style name="LocationLoadingTextStyle"> + <item name="android:textSize">14sp</item> + <item name="android:textColor">#dd000000</item> + <item name="android:fontFamily">sans-serif</item> + </style> + + <style name="LocationErrorTextStyle"> + <item name="android:textSize">14sp</item> + <item name="android:textColor">#dd000000</item> + <item name="android:fontFamily">sans-serif</item> + </style> +</resources> diff --git a/java/com/android/incallui/commontheme/res/drawable/answer_answer_background.xml b/java/com/android/incallui/commontheme/res/drawable/answer_answer_background.xml index bd5d5d389..090506aa6 100644 --- a/java/com/android/incallui/commontheme/res/drawable/answer_answer_background.xml +++ b/java/com/android/incallui/commontheme/res/drawable/answer_answer_background.xml @@ -1,25 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2018 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License - --> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="#80FFFFFF"> <item> <shape android:shape="oval"> - <solid android:color="@color/dialer_call_green"/> + <solid android:color="#09ad00"/> </shape> </item> </ripple> diff --git a/java/com/android/incallui/commontheme/res/drawable/answer_decline_background.xml b/java/com/android/incallui/commontheme/res/drawable/answer_decline_background.xml index 8854de658..abfd56ecf 100644 --- a/java/com/android/incallui/commontheme/res/drawable/answer_decline_background.xml +++ b/java/com/android/incallui/commontheme/res/drawable/answer_decline_background.xml @@ -1,25 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2018 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License - --> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="#80FFFFFF"> <item> <shape android:shape="oval"> - <solid android:color="@color/dialer_end_call_button_color"/> + <solid android:color="#DF0000"/> </shape> </item> </ripple> diff --git a/java/com/android/incallui/commontheme/res/drawable/incall_end_call_background.xml b/java/com/android/incallui/commontheme/res/drawable/incall_end_call_background.xml index 8854de658..3c9f4bc0b 100644 --- a/java/com/android/incallui/commontheme/res/drawable/incall_end_call_background.xml +++ b/java/com/android/incallui/commontheme/res/drawable/incall_end_call_background.xml @@ -1,25 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2018 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License - --> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="#80FFFFFF"> <item> <shape android:shape="oval"> - <solid android:color="@color/dialer_end_call_button_color"/> + <solid android:color="#FFDF0000"/> </shape> </item> </ripple> diff --git a/java/com/android/incallui/commontheme/res/values/styles.xml b/java/com/android/incallui/commontheme/res/values/styles.xml index 0c4c092b9..464eda5bb 100644 --- a/java/com/android/incallui/commontheme/res/values/styles.xml +++ b/java/com/android/incallui/commontheme/res/values/styles.xml @@ -17,31 +17,28 @@ <resources> - <style name="Dialer.Incall.TextAppearance" parent="Dialer.TextAppearance.Header1"> + <style name="Dialer.Incall.TextAppearance" parent="android:TextAppearance.Material"> <item name="android:textColor">?android:attr/textColorSecondary</item> + <item name="android:textSize">18sp</item> </style> - <style name="Dialer.Incall.TextAppearance.Large" parent="Dialer.TextAppearance.Header1"> + <style name="Dialer.Incall.TextAppearance.Large"> + <item name="android:textColor">?android:attr/textColorPrimary</item> <item name="android:textSize">36sp</item> + <item name="android:fontFamily">sans-serif-light</item> </style> <style name="Dialer.Incall.TextAppearance.Label"> - <item name="android:textColor">?android:attr/textColorSecondary</item> + <item name="android:textColor">?android:attr/textColorPrimary</item> <item name="android:textSize">12sp</item> </style> - <style name="Dialer.Incall.TextAppearance.Hint"> - <item name="android:textColor">?android:attr/textColorHint</item> - <item name="android:textSize">14sp</item> - <item name="android:textStyle">italic</item> - </style> - <style name="BottomRowIcon"> <item name="android:layout_height">24dp</item> <item name="android:layout_width">24dp</item> <item name="android:layout_marginEnd">8dp</item> <item name="android:scaleType">fitCenter</item> - <item name="colorControlNormal">?colorIcon</item> + <item name="colorControlNormal">?android:attr/textColorSecondary</item> </style> <style name="Incall.Button.End" parent="android:Widget.Material.Button"> diff --git a/java/com/android/incallui/contactgrid/res/layout/device_number_row.xml b/java/com/android/incallui/contactgrid/res/layout/device_number_row.xml index f4792d8ed..4f8bbad5a 100644 --- a/java/com/android/incallui/contactgrid/res/layout/device_number_row.xml +++ b/java/com/android/incallui/contactgrid/res/layout/device_number_row.xml @@ -19,19 +19,21 @@ android:id="@+id/contactgrid_location_divider" android:layout_width="match_parent" android:layout_height="1dp" - android:background="@color/dialer_divider_line_color" + android:layout_gravity="bottom" + android:background="#D8D8D8" android:visibility="gone"/> <TextView android:id="@+id/contactgrid_device_number_text" - style="@style/Dialer.TextAppearance.Primary2" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="16dp" android:padding="16dp" - android:background="?android:attr/colorBackgroundFloating" - android:elevation="4dp" + android:background="@android:color/white" + android:elevation="2dp" android:gravity="start" android:orientation="vertical" + android:textColor="#DD000000" + android:textSize="16sp" android:visibility="gone"/> </merge>
\ No newline at end of file diff --git a/java/com/android/incallui/contactgrid/res/layout/incall_contactgrid_top_row.xml b/java/com/android/incallui/contactgrid/res/layout/incall_contactgrid_top_row.xml index bc8759ed0..2f9ca3ea8 100644 --- a/java/com/android/incallui/contactgrid/res/layout/incall_contactgrid_top_row.xml +++ b/java/com/android/incallui/contactgrid/res/layout/incall_contactgrid_top_row.xml @@ -15,34 +15,33 @@ ~ limitations under the License --> <LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:gravity="center" - android:orientation="horizontal" - tools:showIn="@layout/incall_contact_grid"> + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="center" + android:orientation="horizontal" + tools:showIn="@layout/incall_contact_grid"> <ImageView - android:id="@id/contactgrid_connection_icon" - android:layout_width="24dp" - android:layout_height="24dp" - android:scaleType="fitCenter" - android:tint="?colorIcon" - tools:src="@android:drawable/sym_def_app_icon" - tools:visibility="visible" - /> + android:id="@id/contactgrid_connection_icon" + android:layout_width="24dp" + android:layout_height="24dp" + android:scaleType="fitCenter" + tools:src="@android:drawable/sym_def_app_icon" + tools:visibility="visible" + /> <Space android:id="@id/contactgrid_top_row_space" - android:layout_width="@dimen/contactgrid_connection_icon_margin_end" android:layout_height="match_parent" - /> + android:layout_width="@dimen/contactgrid_connection_icon_margin_end" + /> <TextView - android:id="@id/contactgrid_status_text" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:ellipsize="marquee" - android:scrollHorizontally="true" - android:singleLine="true" - android:textAppearance="@style/Dialer.Incall.TextAppearance" - tools:text="Captain Holt"/> + android:id="@id/contactgrid_status_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:singleLine="true" + android:ellipsize="marquee" + android:scrollHorizontally="true" + android:textAppearance="@style/Dialer.Incall.TextAppearance" + tools:text="Captain Holt"/> </LinearLayout> diff --git a/java/com/android/incallui/incall/impl/CheckableLabeledButton.java b/java/com/android/incallui/incall/impl/CheckableLabeledButton.java index d4aba4c0b..bfc2781a9 100644 --- a/java/com/android/incallui/incall/impl/CheckableLabeledButton.java +++ b/java/com/android/incallui/incall/impl/CheckableLabeledButton.java @@ -18,11 +18,14 @@ package com.android.incallui.incall.impl; import android.animation.AnimatorInflater; import android.content.Context; +import android.content.res.ColorStateList; import android.content.res.TypedArray; +import android.graphics.Color; import android.graphics.PorterDuff.Mode; import android.graphics.drawable.Drawable; import android.os.Parcel; import android.os.Parcelable; +import android.support.annotation.ColorInt; import android.support.annotation.DrawableRes; import android.support.annotation.StringRes; import android.text.TextUtils.TruncateAt; @@ -33,12 +36,12 @@ import android.widget.Checkable; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; -import com.android.dialer.theme.base.ThemeComponent; /** A button to show on the incall screen */ public class CheckableLabeledButton extends LinearLayout implements Checkable { private static final int[] CHECKED_STATE_SET = {android.R.attr.state_checked}; + private static final float DISABLED_STATE_OPACITY = .3f; private boolean broadcasting; private boolean isChecked; private OnCheckedChangeListener onCheckedChangeListener; @@ -91,7 +94,8 @@ public class CheckableLabeledButton extends LinearLayout implements Checkable { iconView.setPadding(iconPadding, iconPadding, iconPadding, iconPadding); iconView.setImageDrawable(icon); iconView.setImageTintMode(Mode.SRC_IN); - iconView.setImageTintList(ThemeComponent.get(context).theme().getColorIconStateList()); + iconView.setImageTintList( + getResources().getColorStateList(R.color.incall_button_icon, context.getTheme())); iconView.setBackground( getResources().getDrawable(R.drawable.incall_button_background, context.getTheme())); @@ -123,6 +127,20 @@ public class CheckableLabeledButton extends LinearLayout implements Checkable { setOutlineProvider(null); } + @Override + public void refreshDrawableState() { + super.refreshDrawableState(); + iconView.setAlpha(isEnabled() ? 1f : DISABLED_STATE_OPACITY); + labelView.setAlpha(isEnabled() ? 1f : DISABLED_STATE_OPACITY); + } + + public void setCheckedColor(@ColorInt int color) { + iconView.setImageTintList( + new ColorStateList( + new int[][] {new int[] {android.R.attr.state_checked}, new int[] {}}, + new int[] {color, Color.WHITE})); + } + public Drawable getIconDrawable() { return iconView.getDrawable(); } diff --git a/java/com/android/incallui/incall/impl/InCallButtonGridFragment.java b/java/com/android/incallui/incall/impl/InCallButtonGridFragment.java index db0b5b9b8..a0eead128 100644 --- a/java/com/android/incallui/incall/impl/InCallButtonGridFragment.java +++ b/java/com/android/incallui/incall/impl/InCallButtonGridFragment.java @@ -17,6 +17,7 @@ package com.android.incallui.incall.impl; import android.os.Bundle; +import android.support.annotation.ColorInt; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.util.ArraySet; @@ -127,6 +128,12 @@ public class InCallButtonGridFragment extends Fragment { return numVisibleButtons; } + public void updateButtonColor(@ColorInt int color) { + for (CheckableLabeledButton button : buttons) { + button.setCheckedColor(color); + } + } + /** Interface to let the listener know the status of the button grid. */ public interface OnButtonGridCreatedListener { void onButtonGridCreated(InCallButtonGridFragment inCallButtonGridFragment); diff --git a/java/com/android/incallui/incall/impl/InCallFragment.java b/java/com/android/incallui/incall/impl/InCallFragment.java index 6e57058f9..7f20b407f 100644 --- a/java/com/android/incallui/incall/impl/InCallFragment.java +++ b/java/com/android/incallui/incall/impl/InCallFragment.java @@ -23,6 +23,7 @@ import android.content.Context; import android.content.pm.PackageManager; import android.os.Bundle; import android.os.Handler; +import android.support.annotation.ColorInt; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; @@ -495,6 +496,11 @@ public class InCallFragment extends Fragment } @Override + public void updateInCallButtonUiColors(@ColorInt int color) { + inCallButtonGridFragment.updateButtonColor(color); + } + + @Override public Fragment getInCallButtonUiFragment() { return this; } diff --git a/java/com/android/incallui/incall/impl/res/color/incall_button_icon.xml b/java/com/android/incallui/incall/impl/res/color/incall_button_icon.xml index 292d91f9b..000525f5f 100644 --- a/java/com/android/incallui/incall/impl/res/color/incall_button_icon.xml +++ b/java/com/android/incallui/incall/impl/res/color/incall_button_icon.xml @@ -16,6 +16,6 @@ --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:color="?android:attr/colorBackground" android:state_checked="true"/> - <item android:color="?colorIcon"/> + <item android:color="?android:attr/colorPrimaryDark" android:state_checked="true"/> + <item android:color="?android:attr/textColorPrimary"/> </selector> diff --git a/java/com/android/incallui/incall/impl/res/drawable/incall_button_background_checked.xml b/java/com/android/incallui/incall/impl/res/drawable/incall_button_background_checked.xml index 0d8732b4f..73c6947e2 100644 --- a/java/com/android/incallui/incall/impl/res/drawable/incall_button_background_checked.xml +++ b/java/com/android/incallui/incall/impl/res/drawable/incall_button_background_checked.xml @@ -1,20 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2018 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License - --> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> - <solid android:color="?android:attr/textColorSecondary"/> + <solid android:color="@color/incall_button_white"/> </shape> diff --git a/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml b/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml index d200547b0..9cc599dc7 100644 --- a/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml +++ b/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml @@ -41,7 +41,8 @@ android:id="@id/contactgrid_avatar" android:layout_width="@dimen/incall_avatar_size" android:layout_height="@dimen/incall_avatar_size" - android:layout_marginBottom="8dp"/> + android:layout_marginBottom="8dp" + android:elevation="2dp"/> <include layout="@layout/incall_contactgrid_top_row" diff --git a/java/com/android/incallui/incall/protocol/InCallButtonUi.java b/java/com/android/incallui/incall/protocol/InCallButtonUi.java index 17d50bf17..28dd84c42 100644 --- a/java/com/android/incallui/incall/protocol/InCallButtonUi.java +++ b/java/com/android/incallui/incall/protocol/InCallButtonUi.java @@ -16,6 +16,7 @@ package com.android.incallui.incall.protocol; +import android.support.annotation.ColorInt; import android.support.v4.app.Fragment; import android.telecom.CallAudioState; @@ -42,6 +43,8 @@ public interface InCallButtonUi { */ void updateButtonStates(); + void updateInCallButtonUiColors(@ColorInt int color); + Fragment getInCallButtonUiFragment(); void showAudioRouteSelector(); diff --git a/java/com/android/incallui/rtt/impl/RttChatFragment.java b/java/com/android/incallui/rtt/impl/RttChatFragment.java index 73adb9f1c..988f20c2c 100644 --- a/java/com/android/incallui/rtt/impl/RttChatFragment.java +++ b/java/com/android/incallui/rtt/impl/RttChatFragment.java @@ -572,6 +572,9 @@ public class RttChatFragment extends Fragment public void updateButtonStates() {} @Override + public void updateInCallButtonUiColors(int color) {} + + @Override public Fragment getInCallButtonUiFragment() { return this; } diff --git a/java/com/android/incallui/speakeasy/Annotations.java b/java/com/android/incallui/speakeasy/Annotations.java index 0d420a457..c66fe94c3 100644 --- a/java/com/android/incallui/speakeasy/Annotations.java +++ b/java/com/android/incallui/speakeasy/Annotations.java @@ -29,9 +29,9 @@ public final class Annotations { @Qualifier public @interface SpeakEasySettingsObject {} - /** A Speakeasy icon resource */ + /** A Speakeasy chip */ @Qualifier - public @interface SpeakEasyIconResourceId {} + public @interface SpeakEasyChipResourceId {} /** A Speakeasy text resource */ @Qualifier diff --git a/java/com/android/incallui/speakeasy/SpeakEasyComponent.java b/java/com/android/incallui/speakeasy/SpeakEasyComponent.java index 84a21f3d1..422ebd6da 100644 --- a/java/com/android/incallui/speakeasy/SpeakEasyComponent.java +++ b/java/com/android/incallui/speakeasy/SpeakEasyComponent.java @@ -19,19 +19,20 @@ package com.android.incallui.speakeasy; import android.content.Context; import android.preference.PreferenceActivity; import com.android.dialer.inject.HasRootComponent; -import com.android.incallui.speakeasy.Annotations.SpeakEasyIconResourceId; +import com.android.incallui.speakeasy.Annotations.SpeakEasyChipResourceId; import com.android.incallui.speakeasy.Annotations.SpeakEasySettingsActivity; import com.android.incallui.speakeasy.Annotations.SpeakEasySettingsObject; import com.android.incallui.speakeasy.Annotations.SpeakEasyTextResourceId; +import com.google.common.base.Optional; import dagger.Subcomponent; -import java.util.Optional; /** Dagger component to get SpeakEasyCallManager. */ @Subcomponent public abstract class SpeakEasyComponent { public static SpeakEasyComponent get(Context context) { - return ((HasComponent) ((HasRootComponent) context.getApplicationContext()).component()) + return ((SpeakEasyComponent.HasComponent) + ((HasRootComponent) context.getApplicationContext()).component()) .speakEasyComponent(); } @@ -42,7 +43,7 @@ public abstract class SpeakEasyComponent { public abstract @SpeakEasySettingsObject Optional<Object> speakEasySettingsObject(); - public abstract @SpeakEasyIconResourceId Optional<Integer> speakEasyIconResource(); + public abstract @SpeakEasyChipResourceId Optional<Integer> speakEasyChip(); public abstract @SpeakEasyTextResourceId Optional<Integer> speakEasyTextResource(); diff --git a/java/com/android/incallui/speakeasy/StubSpeakEasyModule.java b/java/com/android/incallui/speakeasy/StubSpeakEasyModule.java index 781eee030..5441075ef 100644 --- a/java/com/android/incallui/speakeasy/StubSpeakEasyModule.java +++ b/java/com/android/incallui/speakeasy/StubSpeakEasyModule.java @@ -19,14 +19,14 @@ package com.android.incallui.speakeasy; import android.preference.PreferenceActivity; import com.android.dialer.inject.DialerVariant; import com.android.dialer.inject.InstallIn; -import com.android.incallui.speakeasy.Annotations.SpeakEasyIconResourceId; +import com.android.incallui.speakeasy.Annotations.SpeakEasyChipResourceId; import com.android.incallui.speakeasy.Annotations.SpeakEasySettingsActivity; import com.android.incallui.speakeasy.Annotations.SpeakEasySettingsObject; import com.android.incallui.speakeasy.Annotations.SpeakEasyTextResourceId; +import com.google.common.base.Optional; import dagger.Binds; import dagger.Module; import dagger.Provides; -import java.util.Optional; /** Module which binds {@link SpeakEasyCallManagerStub}. */ @InstallIn(variants = {DialerVariant.DIALER_TEST}) @@ -39,21 +39,21 @@ public abstract class StubSpeakEasyModule { @Provides static @SpeakEasySettingsActivity Optional<PreferenceActivity> provideSpeakEasySettingsActivity() { - return Optional.empty(); + return Optional.absent(); } @Provides static @SpeakEasySettingsObject Optional<Object> provideSpeakEasySettingsObject() { - return Optional.empty(); + return Optional.absent(); } @Provides - static @SpeakEasyIconResourceId Optional<Integer> provideSpeakEasyIconResource() { - return Optional.empty(); + static @SpeakEasyChipResourceId Optional<Integer> provideSpeakEasyChip() { + return Optional.absent(); } @Provides static @SpeakEasyTextResourceId Optional<Integer> provideSpeakEasyTextResource() { - return Optional.empty(); + return Optional.absent(); } } diff --git a/java/com/android/dialer/theme/common/res/drawable/bottom_sheet_background.xml b/java/com/android/incallui/theme/res/drawable/incall_background_gradient.xml index 558277d42..996f17245 100644 --- a/java/com/android/dialer/theme/common/res/drawable/bottom_sheet_background.xml +++ b/java/com/android/incallui/theme/res/drawable/incall_background_gradient.xml @@ -14,10 +14,10 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License --> -<shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle"> - <corners - android:topLeftRadius="8dp" - android:topRightRadius="8dp"/> - <solid android:color="?android:attr/colorBackgroundFloating"/> -</shape>
\ No newline at end of file +<shape xmlns:android="http://schemas.android.com/apk/res/android"> + <gradient + android:angle="270" + android:startColor="@color/incall_background_gradient_top" + android:centerColor="@color/incall_background_gradient_middle" + android:endColor="@color/incall_background_gradient_bottom"/> +</shape> diff --git a/java/com/android/incallui/theme/res/values/colors.xml b/java/com/android/incallui/theme/res/values/colors.xml index 10a19ef50..059fe59a9 100644 --- a/java/com/android/incallui/theme/res/values/colors.xml +++ b/java/com/android/incallui/theme/res/values/colors.xml @@ -52,4 +52,16 @@ <item>#B93221</item> <item>#841F10</item> </array> + + <color name="incall_background_gradient_top">#E91141BB</color> + <color name="incall_background_gradient_middle">#E91141BB</color> + <color name="incall_background_gradient_bottom">#CC229FEB</color> + + <color name="incall_background_multiwindow">#E91141BB</color> + + <color name="incall_background_gradient_spam_top">#E5A30B0B</color> + <color name="incall_background_gradient_spam_middle">#D6C01111</color> + <color name="incall_background_gradient_spam_bottom">#B8E55135</color> + + <color name="incall_background_multiwindow_spam">#E9C22E2E</color> </resources> diff --git a/java/com/android/incallui/theme/res/values/styles.xml b/java/com/android/incallui/theme/res/values/styles.xml index 1291173b5..5b65cc3d9 100644 --- a/java/com/android/incallui/theme/res/values/styles.xml +++ b/java/com/android/incallui/theme/res/values/styles.xml @@ -16,7 +16,11 @@ --> <resources> - <style name="Theme.InCallScreen" parent="@style/Dialer.ThemeBase.NoActionBar"> + <!-- Theme for the InCallActivity activity. Should have a transparent background for the + circular reveal animation for a new outgoing call to work correctly. We don't just use + Theme.Black.NoTitleBar directly, since we want any popups or dialogs from the + InCallActivity to have the correct Material style. --> + <style name="Theme.InCallScreen.Light" parent="@style/Dialer.ThemeBase.NoActionBar"> <item name="android:statusBarColor">@android:color/transparent</item> <item name="android:navigationBarColor">@android:color/transparent</item> <item name="android:windowDrawsSystemBarBackgrounds">true</item> @@ -25,8 +29,25 @@ <item name="dialpad_style">@style/InCallDialpad</item> <item name="android:windowAnimationStyle">@null</item> - <item name="android:windowBackground">?android:attr/colorBackground</item> + <item name="android:windowBackground">@drawable/incall_background_gradient</item> + <item name="android:windowShowWallpaper">true</item> + </style> + + <style name="Theme.InCallScreen" parent="@style/Dialer.Dark.ThemeBase.NoActionBar"> + <item name="android:textColorPrimary">@android:color/white</item> + <item name="android:textColorSecondary">#DDFFFFFF</item> + <item name="android:statusBarColor">@android:color/transparent</item> + <item name="android:navigationBarColor">@android:color/transparent</item> + <item name="android:windowDrawsSystemBarBackgrounds">true</item> + <item name="android:colorPrimaryDark">@color/dialer_theme_color_dark</item> + <item name="colorPrimaryDark">@color/dialer_theme_color_dark</item> + + <item name="dialpad_key_button_touch_tint">?attr/colorPrimary20pct</item> + <item name="dialpad_style">@style/InCallDialpad</item> + <item name="android:windowAnimationStyle">@null</item> + <item name="android:windowBackground">@drawable/incall_background_gradient</item> + <item name="android:windowShowWallpaper">true</item> </style> <style name="Theme.InCallScreen.ManageConference" parent="Dialer.ThemeBase.ActionBar"> diff --git a/java/com/android/incallui/video/impl/SurfaceViewVideoCallFragment.java b/java/com/android/incallui/video/impl/SurfaceViewVideoCallFragment.java index 994363ab4..f270edab9 100644 --- a/java/com/android/incallui/video/impl/SurfaceViewVideoCallFragment.java +++ b/java/com/android/incallui/video/impl/SurfaceViewVideoCallFragment.java @@ -22,6 +22,7 @@ import android.content.pm.PackageManager; import android.graphics.Point; import android.graphics.drawable.Animatable; import android.os.Bundle; +import android.support.annotation.ColorInt; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; @@ -804,6 +805,9 @@ public class SurfaceViewVideoCallFragment extends Fragment } @Override + public void updateInCallButtonUiColors(@ColorInt int color) {} + + @Override public Fragment getInCallButtonUiFragment() { return this; } diff --git a/java/com/android/incallui/video/impl/VideoCallFragment.java b/java/com/android/incallui/video/impl/VideoCallFragment.java index 82226f375..11b80ceb9 100644 --- a/java/com/android/incallui/video/impl/VideoCallFragment.java +++ b/java/com/android/incallui/video/impl/VideoCallFragment.java @@ -30,6 +30,7 @@ import android.renderscript.Allocation; import android.renderscript.Element; import android.renderscript.RenderScript; import android.renderscript.ScriptIntrinsicBlur; +import android.support.annotation.ColorInt; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; @@ -871,6 +872,9 @@ public class VideoCallFragment extends Fragment } @Override + public void updateInCallButtonUiColors(@ColorInt int color) {} + + @Override public Fragment getInCallButtonUiFragment() { return this; } |