summaryrefslogtreecommitdiff
path: root/InCallUI/src/com/android/incallui/CallCardFragment.java
diff options
context:
space:
mode:
Diffstat (limited to 'InCallUI/src/com/android/incallui/CallCardFragment.java')
-rw-r--r--InCallUI/src/com/android/incallui/CallCardFragment.java27
1 files changed, 23 insertions, 4 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java
index 6643128b3..a3804b15d 100644
--- a/InCallUI/src/com/android/incallui/CallCardFragment.java
+++ b/InCallUI/src/com/android/incallui/CallCardFragment.java
@@ -46,7 +46,7 @@ import android.view.animation.AnimationUtils;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
-
+import com.android.contacts.common.util.MaterialColorMapUtils.MaterialPalette;
import com.android.contacts.common.widget.FloatingActionButtonController;
import com.android.phone.common.animation.AnimUtils;
@@ -112,6 +112,8 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
private int mVideoAnimationDuration;
+ private MaterialPalette mCurrentThemeColors;
+
@Override
CallCardPresenter.CallCardUi getUi() {
return this;
@@ -791,6 +793,22 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
mManageConferenceCallButton.setVisibility(visible ? View.VISIBLE : View.GONE);
}
+ /**
+ * Get the overall InCallUI background colors and apply to call card.
+ */
+ public void updateColors() {
+ MaterialPalette themeColors = InCallPresenter.getInstance().getThemeColors();
+
+ if (mCurrentThemeColors != null && mCurrentThemeColors.equals(themeColors)) {
+ return;
+ }
+
+ mPrimaryCallCardContainer.setBackgroundColor(themeColors.mPrimaryColor);
+ mCallButtonsContainer.setBackgroundColor(themeColors.mPrimaryColor);
+
+ mCurrentThemeColors = themeColors;
+ }
+
private void dispatchPopulateAccessibilityEvent(AccessibilityEvent event, View view) {
if (view == null) return;
final List<CharSequence> eventText = event.getText();
@@ -802,9 +820,8 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
}
}
- public void animateForNewOutgoingCall(Point touchPoint) {
+ public void animateForNewOutgoingCall(final Point touchPoint) {
final ViewGroup parent = (ViewGroup) mPrimaryCallCardContainer.getParent();
- final Point startPoint = touchPoint;
final ViewTreeObserver observer = getView().getViewTreeObserver();
@@ -835,7 +852,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
mCallTypeLabel.setAlpha(0);
mCallNumberAndLabel.setAlpha(0);
- final Animator revealAnimator = getRevealAnimator(startPoint);
+ final Animator revealAnimator = getRevealAnimator(touchPoint);
final Animator shrinkAnimator =
getShrinkAnimator(parent.getHeight(), originalHeight);
@@ -903,6 +920,8 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
updateFabPosition();
}
});
+
+ updateColors();
}
/**