diff options
Diffstat (limited to 'java/com/android/incallui')
39 files changed, 401 insertions, 238 deletions
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/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/incallui/answer/impl/res/drawable/secondary_action_chip_background.xml b/java/com/android/incallui/theme/res/drawable/incall_background_gradient.xml index a185ebb3c..996f17245 100644 --- a/java/com/android/incallui/answer/impl/res/drawable/secondary_action_chip_background.xml +++ b/java/com/android/incallui/theme/res/drawable/incall_background_gradient.xml @@ -14,20 +14,10 @@ ~ 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> +<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; } |