From f15cc627264fbde09dd40c359fbb68ee0303d3be Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Tue, 10 Jul 2018 18:41:51 +0000 Subject: Revert "UI Refresh for contacts." This reverts commit f65163bd216775476df124e07c276a9b0bceba42. Change-Id: Id7798160a67bf6f128336bea586b1216fc483552 --- .../android/dialer/contactsfragment/res/layout/add_contact_row.xml | 3 +-- java/com/android/dialer/contactsfragment/res/layout/contact_row.xml | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'java') 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"/> 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"/> \ No newline at end of file -- cgit v1.2.3 From a5fd4d95805281c4d326062eedfd8079368ede55 Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Tue, 10 Jul 2018 18:41:45 +0000 Subject: Revert "UI refresh for call log items." This reverts commit 9c952d8f2688350f06d65df7852756ab05b6fdab. Change-Id: I3b2f23826c34ecdb16e786c5dd92f13ed97d88e7 --- .../app/calllog/CallLogListItemViewHolder.java | 23 +- .../dialer/app/res/layout/call_log_fragment.xml | 2 + .../dialer/app/res/layout/call_log_list_item.xml | 240 +++++++++++---------- java/com/android/dialer/app/res/values/dimens.xml | 9 +- .../dialer/calllogutils/CallTypeIconsView.java | 20 +- .../dialer/theme/common/res/values/dimens.xml | 2 + .../dialer/theme/common/res/values/styles.xml | 11 +- 7 files changed, 142 insertions(+), 165 deletions(-) (limited to 'java') diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java index c95334695..e044460c5 100644 --- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java @@ -46,7 +46,6 @@ import android.view.ContextMenu; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; -import android.view.ViewGroup; import android.view.ViewStub; import android.widget.ImageButton; import android.widget.ImageView; @@ -365,8 +364,6 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder PhoneCallDetailsHelper phoneCallDetailsHelper = new PhoneCallDetailsHelper(context, resources, callLogCache); - CardView cardView = new CardView(context); - cardView.setLayoutParams(new ViewGroup.MarginLayoutParams(0, 0)); CallLogListItemViewHolder viewHolder = new CallLogListItemViewHolder( context, @@ -381,7 +378,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder new DialerQuickContactBadge(context), new View(context), PhoneCallDetailsViews.createForTest(context), - cardView, + new CardView(context), new TextView(context), new ImageView(context)); viewHolder.detailsButtonView = new TextView(context); @@ -892,30 +889,12 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder bindActionButtons(); actionsView.setVisibility(View.VISIBLE); actionsView.setAlpha(1.0f); - ViewGroup.MarginLayoutParams layoutParams = - (ViewGroup.MarginLayoutParams) callLogEntryView.getLayoutParams(); - layoutParams.bottomMargin = - context - .getResources() - .getDimensionPixelSize(R.dimen.call_log_card_margin_bottom_expanded); - callLogEntryView.setLayoutParams(layoutParams); - callLogEntryView.setCardElevation( - context.getResources().getDimension(R.dimen.call_log_card_elevation_expanded)); } else { // When recycling a view, it is possible the actionsView ViewStub was previously // inflated so we should hide it in this case. if (actionsView != null) { actionsView.setVisibility(View.GONE); } - ViewGroup.MarginLayoutParams layoutParams = - (ViewGroup.MarginLayoutParams) callLogEntryView.getLayoutParams(); - layoutParams.bottomMargin = - context - .getResources() - .getDimensionPixelSize(R.dimen.call_log_card_margin_bottom_collapsed); - callLogEntryView.setLayoutParams(layoutParams); - callLogEntryView.setCardElevation( - context.getResources().getDimension(R.dimen.call_log_card_elevation_collapsed)); } updatePrimaryActionButton(show); diff --git a/java/com/android/dialer/app/res/layout/call_log_fragment.xml b/java/com/android/dialer/app/res/layout/call_log_fragment.xml index 5ceff2eba..bf91a3a07 100644 --- a/java/com/android/dialer/app/res/layout/call_log_fragment.xml +++ b/java/com/android/dialer/app/res/layout/call_log_fragment.xml @@ -62,6 +62,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingBottom="@dimen/floating_action_button_list_bottom_padding" + android:paddingStart="@dimen/call_log_horizontal_margin" + android:paddingEnd="@dimen/call_log_horizontal_margin" android:clipToPadding="false"/> + android:id="@+id/call_log_list_item" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + android:id="@+id/call_log_day_group_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="start" + android:layout_marginStart="@dimen/call_log_start_margin" + android:layout_marginEnd="@dimen/call_log_outer_margin" + android:paddingTop="@dimen/call_log_day_group_padding_top" + android:paddingBottom="@dimen/call_log_day_group_padding_bottom" + style="@style/Dialer.TextAppearance.OVERLINE.Ellipsize"/> + android:id="@+id/call_log_row" + style="@style/CallLogCardStyle"> + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + android:id="@+id/primary_action_view" + android:background="?android:attr/selectableItemBackground" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingStart="@dimen/call_log_start_margin" + android:paddingEnd="@dimen/call_log_outer_margin" + android:paddingTop="@dimen/call_log_vertical_padding" + android:paddingBottom="@dimen/call_log_vertical_padding" + android:orientation="horizontal" + android:gravity="center_vertical" + android:focusable="true" + android:nextFocusRight="@+id/call_back_action" + android:nextFocusLeft="@+id/quick_contact_photo"> + android:paddingTop="2dp" + android:nextFocusRight="@id/primary_action_view" + android:focusable="true"/> + android:visibility="gone" + android:src="@drawable/ic_check_mark_48dp" /> + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:orientation="vertical" + android:gravity="center_vertical" + android:layout_marginStart="@dimen/call_log_list_item_info_margin_start"> + android:id="@+id/name" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/call_log_name_margin_bottom" + android:layout_marginEnd="@dimen/call_log_icon_margin" + style="@style/Dialer.TextAppearance.Primary.Ellipsize"/> + android:id="@+id/call_type" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal"> + android:id="@+id/call_type_icons" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="@dimen/call_log_icon_margin" + android:layout_gravity="center_vertical"/> + android:id="@+id/work_profile_icon" + android:src="@drawable/ic_work_profile" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="@dimen/call_log_icon_margin" + android:scaleType="center" + android:visibility="gone"/> + android:id="@+id/call_location_and_date" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="@dimen/call_log_icon_margin" + android:layout_gravity="center_vertical" + style="Dialer.TextAppearance.Secondary.Ellipsize"/> + android:id="@+id/call_account_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="@dimen/call_log_call_account_margin_bottom" + android:layout_marginEnd="@dimen/call_log_icon_margin" + android:visibility="gone" + style="Dialer.TextAppearance.Secondary2.Ellipsize"/> + android:id="@+id/transcription" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="@dimen/call_log_icon_margin" + android:visibility="gone" + android:orientation="vertical"> + android:id="@+id/voicemail_transcription" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:focusable="true" + android:nextFocusDown="@+id/voicemail_transcription_branding" + android:textIsSelectable="true" + style="Dialer.TextAppearance.Secondary2"/> + android:id="@+id/voicemail_transcription_branding" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:focusable="true" + android:nextFocusUp="@id/voicemail_transcription" + android:nextFocusDown="@+id/voicemail_transcription_rating" + android:paddingTop="2dp" + style="Dialer.TextAppearance.Secondary2"/> + android:orientation="horizontal"> @@ -212,25 +214,25 @@ + android:id="@+id/primary_action_button" + android:layout_width="@dimen/call_log_list_item_primary_action_dimen" + android:layout_height="@dimen/call_log_list_item_primary_action_dimen" + android:layout_gravity="center_vertical" + android:background="?android:attr/selectableItemBackgroundBorderless" + android:scaleType="center" + android:tint="?colorIcon" + android:visibility="gone"/> + android:id="@+id/call_log_entry_actions_stub" + android:inflatedId="@+id/call_log_entry_actions" + android:layout="@layout/call_log_list_item_actions" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom"/> diff --git a/java/com/android/dialer/app/res/values/dimens.xml b/java/com/android/dialer/app/res/values/dimens.xml index 7a1f574ae..fdbcac93a 100644 --- a/java/com/android/dialer/app/res/values/dimens.xml +++ b/java/com/android/dialer/app/res/values/dimens.xml @@ -29,12 +29,9 @@ 18dp - 16dp - 16dp - 6dp - 0dp - 10dp - 4dp + 8dp + 8dp + 8dp 2dp 2dp 8dp diff --git a/java/com/android/dialer/calllogutils/CallTypeIconsView.java b/java/com/android/dialer/calllogutils/CallTypeIconsView.java index e268bb896..19c30c575 100644 --- a/java/com/android/dialer/calllogutils/CallTypeIconsView.java +++ b/java/com/android/dialer/calllogutils/CallTypeIconsView.java @@ -290,56 +290,56 @@ public class CallTypeIconsView extends View { int iconId = R.drawable.quantum_ic_call_received_white_24; Drawable drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); incoming = drawable.mutate(); - incoming.setColorFilter(r.getColor(R.color.dialer_call_green), PorterDuff.Mode.SRC_IN); + incoming.setColorFilter(r.getColor(R.color.dialer_call_green), PorterDuff.Mode.MULTIPLY); // Create a rotated instance of the call arrow for outgoing calls. iconId = R.drawable.quantum_ic_call_made_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); outgoing = drawable.mutate(); - outgoing.setColorFilter(r.getColor(R.color.dialer_call_green), PorterDuff.Mode.SRC_IN); + outgoing.setColorFilter(r.getColor(R.color.dialer_call_green), PorterDuff.Mode.MULTIPLY); // Need to make a copy of the arrow drawable, otherwise the same instance colored // above will be recolored here. iconId = R.drawable.quantum_ic_call_missed_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); missed = drawable.mutate(); - missed.setColorFilter(r.getColor(R.color.dialer_red), PorterDuff.Mode.SRC_IN); + missed.setColorFilter(r.getColor(R.color.dialer_red), PorterDuff.Mode.MULTIPLY); Theme theme = ThemeComponent.get(context).theme(); iconId = R.drawable.quantum_ic_voicemail_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); voicemail = drawable.mutate(); - voicemail.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.SRC_IN); + voicemail.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.MULTIPLY); iconId = R.drawable.quantum_ic_block_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); blocked = drawable.mutate(); - blocked.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.SRC_IN); + blocked.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.MULTIPLY); iconId = R.drawable.quantum_ic_videocam_vd_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); videoCall = drawable.mutate(); - videoCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.SRC_IN); + videoCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.MULTIPLY); iconId = R.drawable.quantum_ic_hd_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); hdCall = drawable.mutate(); - hdCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.SRC_IN); + hdCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.MULTIPLY); iconId = R.drawable.quantum_ic_signal_wifi_4_bar_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); wifiCall = drawable.mutate(); - wifiCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.SRC_IN); + wifiCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.MULTIPLY); iconId = R.drawable.quantum_ic_language_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); assistedDialedCall = drawable.mutate(); - assistedDialedCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.SRC_IN); + assistedDialedCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.MULTIPLY); iconId = R.drawable.quantum_ic_rtt_vd_theme_24; drawable = largeIcons ? r.getDrawable(iconId, null) : getScaledBitmap(context, iconId); rttCall = drawable.mutate(); - rttCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.SRC_IN); + rttCall.setColorFilter(theme.getColorIcon(), PorterDuff.Mode.MULTIPLY); iconMargin = largeIcons ? 0 : r.getDimensionPixelSize(R.dimen.call_log_icon_margin); } diff --git a/java/com/android/dialer/theme/common/res/values/dimens.xml b/java/com/android/dialer/theme/common/res/values/dimens.xml index fbc386ce3..88b8a0423 100644 --- a/java/com/android/dialer/theme/common/res/values/dimens.xml +++ b/java/com/android/dialer/theme/common/res/values/dimens.xml @@ -25,6 +25,8 @@ 14sp 48dp + 15dp + 9dp diff --git a/java/com/android/dialer/theme/common/res/values/styles.xml b/java/com/android/dialer/theme/common/res/values/styles.xml index 5db08f49a..ac23bdf98 100644 --- a/java/com/android/dialer/theme/common/res/values/styles.xml +++ b/java/com/android/dialer/theme/common/res/values/styles.xml @@ -20,14 +20,9 @@ @@ -45,4 +40,4 @@ - + \ No newline at end of file -- cgit v1.2.3 From 31666e420ceab82b7f1cde0da01bbdf8a16f0a34 Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Tue, 10 Jul 2018 18:41:39 +0000 Subject: Revert "UI refresh for reply with sms bottom sheet." This reverts commit 27d7f0a5a307c15dee5a048ec36ca256fa90d1bd. Change-Id: I492d6039813499517ca2243b0e04bfea3d957233 --- java/com/android/dialer/theme/base/Theme.java | 3 --- .../dialer/theme/base/impl/AospThemeImpl.java | 17 +--------------- .../theme/base/res/values/theme_dialer_dark.xml | 8 +------- .../theme/base/res/values/theme_dialer_light.xml | 5 ----- .../res/drawable/bottom_sheet_background.xml | 23 ---------------------- .../dialer/theme/common/res/values/styles.xml | 9 --------- .../answer/impl/SmsBottomSheetFragment.java | 13 +++++------- 7 files changed, 7 insertions(+), 71 deletions(-) delete mode 100644 java/com/android/dialer/theme/common/res/drawable/bottom_sheet_background.xml (limited to 'java') diff --git a/java/com/android/dialer/theme/base/Theme.java b/java/com/android/dialer/theme/base/Theme.java index 3356a018c..2a9975b4b 100644 --- a/java/com/android/dialer/theme/base/Theme.java +++ b/java/com/android/dialer/theme/base/Theme.java @@ -44,9 +44,6 @@ public interface Theme { @StyleRes int getApplicationThemeRes(); - @StyleRes - int getBottomSheetStyleRes(); - Context getThemedContext(Context context); LayoutInflater getThemedLayoutInflator(LayoutInflater inflater); diff --git a/java/com/android/dialer/theme/base/impl/AospThemeImpl.java b/java/com/android/dialer/theme/base/impl/AospThemeImpl.java index cd1e16684..35dcef27c 100644 --- a/java/com/android/dialer/theme/base/impl/AospThemeImpl.java +++ b/java/com/android/dialer/theme/base/impl/AospThemeImpl.java @@ -102,25 +102,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."); 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..d2cc0fc9c 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 @@ -64,10 +64,4 @@ @android:color/white @color/dialer_dark_theme_color_20pct - - - - + \ 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..69ecba41e 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 @@ -84,11 +84,6 @@ @android:style/Animation - - diff --git a/java/com/android/dialer/theme/common/res/drawable/bottom_sheet_background.xml b/java/com/android/dialer/theme/common/res/drawable/bottom_sheet_background.xml deleted file mode 100644 index 558277d42..000000000 --- a/java/com/android/dialer/theme/common/res/drawable/bottom_sheet_background.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/java/com/android/dialer/theme/common/res/values/styles.xml b/java/com/android/dialer/theme/common/res/values/styles.xml index ac23bdf98..2c6446ca1 100644 --- a/java/com/android/dialer/theme/common/res/values/styles.xml +++ b/java/com/android/dialer/theme/common/res/values/styles.xml @@ -31,13 +31,4 @@ 20dp 12dp - - - - \ No newline at end of file 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 -- cgit v1.2.3 From c2df207616a882d75f48fcb4112242adb8ffe884 Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Tue, 10 Jul 2018 18:41:17 +0000 Subject: Revert "UI refresh for bottom nav bar." This reverts commit 9af4b65fa7717a647e3c8996cbbbcc93637aeab4. Change-Id: I5610ae55eb9c22609e3e6a73ea0ce6a5ef3c0cda --- .../dialer/main/impl/bottomnav/BottomNavItem.java | 22 ++++++-- .../bottomnav/res/drawable/notification_badge.xml | 6 ++- .../impl/bottomnav/res/layout/bottom_nav_item.xml | 62 ++++++++++++---------- .../main/impl/bottomnav/res/values/dimens.xml | 21 ++++++++ .../dialer/theme/common/res/values/colors.xml | 2 +- .../dialer/theme/common/res/values/text_styles.xml | 6 --- 6 files changed, 80 insertions(+), 39 deletions(-) create mode 100644 java/com/android/dialer/main/impl/bottomnav/res/values/dimens.xml (limited to 'java') 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 @@ --> - + android:shape="rectangle"> + + + \ 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 @@ --> + android:gravity="center" + android:background="?android:attr/selectableItemBackgroundBorderless"> - + + + + + + - + android:gravity="center_horizontal" + android:textSize="12sp" + style="@style/Dialer.TextAppearance.Secondary"/> \ No newline at end of file diff --git a/java/com/android/dialer/main/impl/bottomnav/res/values/dimens.xml b/java/com/android/dialer/main/impl/bottomnav/res/values/dimens.xml new file mode 100644 index 000000000..8fd376bda --- /dev/null +++ b/java/com/android/dialer/main/impl/bottomnav/res/values/dimens.xml @@ -0,0 +1,21 @@ + + + + 10dp + 14dp + 22dp + \ No newline at end of file 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..207d29c80 100644 --- a/java/com/android/dialer/theme/common/res/values/colors.xml +++ b/java/com/android/dialer/theme/common/res/values/colors.xml @@ -27,7 +27,7 @@ #A52714 #097138 - #EA4335 + #C53929 #CFD8DC 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..df5dafa31 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 @@ -37,12 +37,6 @@ sans-serif-medium - - - - - - + + + + + + + + + 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"/> \ No newline at end of file -- cgit v1.2.3 From 9d10e6487be420597dc40c2ef4a72796a13ec032 Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Tue, 10 Jul 2018 18:48:42 +0000 Subject: Revert "Change reply with sms to chip." This reverts commit 19e85a54d723bbe23e51bed70df89bd3861570d7. Change-Id: Ic450c3012496a20c67327fc64e6b8a1047ea6995 --- .../dialer/theme/common/res/values/colors.xml | 4 +- .../hidden/res/values/colors_dialer_light.xml | 2 +- java/com/android/incallui/StatusBarNotifier.java | 2 +- .../incallui/answer/impl/AnswerFragment.java | 64 ++++++++-------------- .../drawable/secondary_action_chip_background.xml | 33 ----------- .../impl/res/layout/secondary_action_chip.xml | 37 ------------- .../incallui/answer/impl/res/values/strings.xml | 2 - .../android/incallui/speakeasy/Annotations.java | 4 +- .../incallui/speakeasy/SpeakEasyComponent.java | 9 +-- .../incallui/speakeasy/StubSpeakEasyModule.java | 14 ++--- 10 files changed, 41 insertions(+), 130 deletions(-) delete mode 100644 java/com/android/incallui/answer/impl/res/drawable/secondary_action_chip_background.xml delete mode 100644 java/com/android/incallui/answer/impl/res/layout/secondary_action_chip.xml (limited to 'java') 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 207d29c80..770aa8c15 100644 --- a/java/com/android/dialer/theme/common/res/values/colors.xml +++ b/java/com/android/dialer/theme/common/res/values/colors.xml @@ -18,7 +18,7 @@ #34A853 #D93025 - #DADCE0 + #D8D8D8 #2A56C6 #4285F4 @@ -31,4 +31,4 @@ #CFD8DC - + \ No newline at end of file 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 4621be115..0ed8e7566 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,7 @@ --> - @color/google_blue_600 + #2A56C6 #332A56C6 #1C3AA9 #F50057 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/answer/impl/AnswerFragment.java b/java/com/android/incallui/answer/impl/AnswerFragment.java index 8bfdcbaf6..f5da3effd 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 speakEasyIconOptional = - SpeakEasyComponent.get(getContext()).speakEasyIconResource(); - Optional 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 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 @@ -1005,7 +986,8 @@ 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(); @@ -1156,7 +1138,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/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 @@ - - - - - - - - - - - - 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 @@ - - - - - - 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 @@ Swipe up to answer and hold ongoing call Swipe up to answer and end call on hold Swipe from icon to answer and end ongoing call - - Reply Write your own… Write your own… 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 speakEasySettingsObject(); - public abstract @SpeakEasyIconResourceId Optional speakEasyIconResource(); + public abstract @SpeakEasyChipResourceId Optional speakEasyChip(); public abstract @SpeakEasyTextResourceId Optional 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 provideSpeakEasySettingsActivity() { - return Optional.empty(); + return Optional.absent(); } @Provides static @SpeakEasySettingsObject Optional provideSpeakEasySettingsObject() { - return Optional.empty(); + return Optional.absent(); } @Provides - static @SpeakEasyIconResourceId Optional provideSpeakEasyIconResource() { - return Optional.empty(); + static @SpeakEasyChipResourceId Optional provideSpeakEasyChip() { + return Optional.absent(); } @Provides static @SpeakEasyTextResourceId Optional provideSpeakEasyTextResource() { - return Optional.empty(); + return Optional.absent(); } } -- cgit v1.2.3 From 063171599f349c0c254a9be7a92074390ed103e4 Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Tue, 10 Jul 2018 18:37:54 +0000 Subject: Revert "Update style for important call badge." This reverts commit 79a9ae7be17c7fe50e6812a47cdd6e7ce5d07966. Change-Id: Ib60e15fba40207884cb2f9d4f0e65fd599b33ae5 --- java/com/android/dialer/theme/common/res/values/text_styles.xml | 2 +- .../incallui/answer/impl/res/drawable/urgent_call_background.xml | 2 +- .../incallui/answer/impl/res/layout/fragment_incoming_call.xml | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'java') 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 0d1fd850e..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,7 +33,7 @@ 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 @@ - + \ No newline at end of file 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 3a68bd4f6..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 @@ -121,16 +121,19 @@ + android:textAllCaps="true" + android:textColor="?android:attr/colorBackground" + android:textSize="14sp"/> Date: Tue, 10 Jul 2018 18:52:11 +0000 Subject: Revert "Fix color for disabled button in voice call." This reverts commit 4af5facf5a45bb06beebdba790af2807c39e7649. Change-Id: I3d923cb1cdfb31aa9db4384d554fff3ecbfbe4aa --- java/com/android/incallui/incall/impl/CheckableLabeledButton.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'java') diff --git a/java/com/android/incallui/incall/impl/CheckableLabeledButton.java b/java/com/android/incallui/incall/impl/CheckableLabeledButton.java index d4aba4c0b..4e8fa82c4 100644 --- a/java/com/android/incallui/incall/impl/CheckableLabeledButton.java +++ b/java/com/android/incallui/incall/impl/CheckableLabeledButton.java @@ -39,6 +39,7 @@ import com.android.dialer.theme.base.ThemeComponent; 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; @@ -123,6 +124,13 @@ 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 Drawable getIconDrawable() { return iconView.getDrawable(); } -- cgit v1.2.3 From 92854e01920bb300247d19457395b28df06428e0 Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Tue, 10 Jul 2018 18:37:33 +0000 Subject: Revert "UI refresh for voice call screen." This reverts commit b6c615dba7609e5134e960a92e723cfeadfbc589. Change-Id: Ibfe295c51323b4e0352098470921ffae114f5c83 --- java/com/android/dialer/theme/base/Theme.java | 3 --- .../dialer/theme/base/impl/AospThemeImpl.java | 9 --------- .../theme/base/res/values/theme_dialer_dark.xml | 2 +- .../theme/base/res/values/theme_dialer_light.xml | 4 ++-- .../dialer/theme/common/res/values/colors.xml | 2 +- .../res/color/dialer_dark_primary_text_color.xml | 2 +- .../res/color/dialer_dark_secondary_text_color.xml | 2 +- .../theme/hidden/res/color/dialer_icon_color.xml | 22 ---------------------- .../hidden/res/values/colors_dialer_light.xml | 1 + .../dialer/theme/hidden/res/values/styles.xml | 1 + java/com/android/incallui/CallButtonPresenter.java | 5 +++++ .../res/drawable/answer_answer_background.xml | 17 +---------------- .../res/drawable/answer_decline_background.xml | 17 +---------------- .../res/drawable/incall_end_call_background.xml | 17 +---------------- .../incallui/commontheme/res/values/styles.xml | 2 +- .../incall/impl/CheckableLabeledButton.java | 14 ++++++++++++-- .../incall/impl/InCallButtonGridFragment.java | 7 +++++++ .../incallui/incall/impl/InCallFragment.java | 6 ++++++ .../incall/impl/res/color/incall_button_icon.xml | 4 ++-- .../drawable/incall_button_background_checked.xml | 17 +---------------- .../incall/impl/res/layout/frag_incall_voice.xml | 3 ++- .../incallui/incall/protocol/InCallButtonUi.java | 3 +++ .../android/incallui/rtt/impl/RttChatFragment.java | 3 +++ .../video/impl/SurfaceViewVideoCallFragment.java | 4 ++++ .../incallui/video/impl/VideoCallFragment.java | 4 ++++ 25 files changed, 61 insertions(+), 110 deletions(-) delete mode 100644 java/com/android/dialer/theme/hidden/res/color/dialer_icon_color.xml (limited to 'java') diff --git a/java/com/android/dialer/theme/base/Theme.java b/java/com/android/dialer/theme/base/Theme.java index 2a9975b4b..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; @@ -51,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 35dcef27c..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); @@ -128,12 +125,6 @@ public class AospThemeImpl implements Theme { return colorIcon; } - @Override - public ColorStateList getColorIconStateList() { - Assert.checkArgument(colorIconStateList != null); - return colorIconStateList; - } - @Override public @ColorInt int getColorIconSecondary() { Assert.checkArgument(colorIconSecondary != -1); 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 142bb897b..4b5034023 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 @@ -56,7 +56,7 @@ ?android:attr/colorPrimary - ?android:attr/textColorSecondary + @color/google_grey_400 ?android:attr/textColorSecondary @android:color/white @android:color/white 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 e3eefe69a..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 @@ -39,7 +39,7 @@ diff --git a/java/com/android/incallui/incall/impl/CheckableLabeledButton.java b/java/com/android/incallui/incall/impl/CheckableLabeledButton.java index 4e8fa82c4..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,7 +36,6 @@ 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 { @@ -92,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())); @@ -131,6 +134,13 @@ public class CheckableLabeledButton extends LinearLayout implements Checkable { 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; @@ -494,6 +495,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 @@ --> - - + + 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 @@ - - + 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"/> Date: Tue, 10 Jul 2018 18:56:56 +0000 Subject: Revert "Internal change" This reverts commit 988dac56b45e935b99b125f608a2019ce836602b. Change-Id: I825b8ef2074592fcf23a419cd2cb4d0185035df7 --- java/com/android/incallui/theme/res/values/styles.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'java') diff --git a/java/com/android/incallui/theme/res/values/styles.xml b/java/com/android/incallui/theme/res/values/styles.xml index 1291173b5..ac66ffd37 100644 --- a/java/com/android/incallui/theme/res/values/styles.xml +++ b/java/com/android/incallui/theme/res/values/styles.xml @@ -26,7 +26,7 @@ @null ?android:attr/colorBackground - + never + 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/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. + * + *

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/commontheme/res/values/styles.xml b/java/com/android/incallui/commontheme/res/values/styles.xml index f2ec2ccc3..464eda5bb 100644 --- a/java/com/android/incallui/commontheme/res/values/styles.xml +++ b/java/com/android/incallui/commontheme/res/values/styles.xml @@ -17,12 +17,15 @@ - - - - + + -- cgit v1.2.3 From 57ac221e28cd86ecd2b114ab1a0a9465d1c757de Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Tue, 10 Jul 2018 19:09:05 +0000 Subject: Revert "Ignore display cutout for in call UI." This reverts commit a45b5e0299bad5aa6d287179d2c476570f14f347. Change-Id: I062108a36138f1023e549dafad7518177da74a03 --- java/com/android/incallui/theme/res/values/styles.xml | 1 - 1 file changed, 1 deletion(-) (limited to 'java') diff --git a/java/com/android/incallui/theme/res/values/styles.xml b/java/com/android/incallui/theme/res/values/styles.xml index 3266c7da3..5b65cc3d9 100644 --- a/java/com/android/incallui/theme/res/values/styles.xml +++ b/java/com/android/incallui/theme/res/values/styles.xml @@ -48,7 +48,6 @@ @drawable/incall_background_gradient true - never