From c0be1faf6fa10b7b4ab025012cdffd98a5be7148 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Fri, 11 Jul 2014 15:50:00 -0700 Subject: Show different glowpad options for incoming video call. - Refactor code be more flexibile/specific in specifying the targets for the glow pad; went from "n-way" labeling of different target sets to more explicit labeling of scenarios, such as "audio without sms". - Add target sets and cases for showing targest in AnswerFragment. - Added new drawable for the target to answer a video call. - Add method to GlowPadView to allow changing the handle (now it may be either a videocamera or phone icon, depending on the scenario). - Add a new video handle for incoming video calls. - TODO: Hook this up to show these glowpads if there is an incoming video call. - Deleted some unused resource files. Bug: 16015750 Change-Id: I77ff08f45f57cd2817866b5d78648af8891bb675 --- .../src/com/android/incallui/AnswerFragment.java | 74 ++++++++++++++++------ .../src/com/android/incallui/AnswerPresenter.java | 7 +- .../incallui/widget/multiwaveview/GlowPadView.java | 13 +++- 3 files changed, 67 insertions(+), 27 deletions(-) (limited to 'InCallUI/src') diff --git a/InCallUI/src/com/android/incallui/AnswerFragment.java b/InCallUI/src/com/android/incallui/AnswerFragment.java index dfc902dc8..371a3ca25 100644 --- a/InCallUI/src/com/android/incallui/AnswerFragment.java +++ b/InCallUI/src/com/android/incallui/AnswerFragment.java @@ -44,6 +44,11 @@ import java.util.List; public class AnswerFragment extends BaseFragment implements GlowPadWrapper.AnswerListener, AnswerPresenter.AnswerUi { + public static final int TARGET_SET_FOR_AUDIO_WITHOUT_SMS = 0; + public static final int TARGET_SET_FOR_AUDIO_WITH_SMS = 1; + public static final int TARGET_SET_FOR_VIDEO_WITHOUT_SMS = 2; + public static final int TARGET_SET_FOR_VIDEO_WITH_SMS = 3; + /** * The popup showing the list of canned responses. * @@ -112,29 +117,58 @@ public class AnswerFragment extends BaseFragment getUi().showAnswerUi(true); if (call.can(CallCapabilities.RESPOND_VIA_TEXT) && textMsgs != null) { - getUi().showTextButton(true); + getUi().showTargets(AnswerFragment.TARGET_SET_FOR_AUDIO_WITH_SMS); getUi().configureMessageDialog(textMsgs); } else { - getUi().showTextButton(false); + getUi().showTargets(AnswerFragment.TARGET_SET_FOR_AUDIO_WITHOUT_SMS); } } - @Override public void onCallChanged(Call call) { Log.d(this, "onCallStateChange() " + call + " " + this); @@ -154,7 +153,7 @@ public class AnswerPresenter extends Presenter interface AnswerUi extends Ui { public void showAnswerUi(boolean show); - public void showTextButton(boolean show); + public void showTargets(int targetSet); public void showMessageDialog(); public void configureMessageDialog(List textResponses); } diff --git a/InCallUI/src/com/android/incallui/widget/multiwaveview/GlowPadView.java b/InCallUI/src/com/android/incallui/widget/multiwaveview/GlowPadView.java index e97691bb8..a5733de2c 100644 --- a/InCallUI/src/com/android/incallui/widget/multiwaveview/GlowPadView.java +++ b/InCallUI/src/com/android/incallui/widget/multiwaveview/GlowPadView.java @@ -223,8 +223,7 @@ public class GlowPadView extends View { mFeedbackCount); mAllowScaling = a.getBoolean(R.styleable.GlowPadView_allowScaling, false); TypedValue handle = a.peekValue(R.styleable.GlowPadView_handleDrawable); - mHandleDrawable = new TargetDrawable(res, handle != null ? handle.resourceId : 0, 2); - mHandleDrawable.setState(TargetDrawable.STATE_INACTIVE); + setHandleDrawable(handle != null ? handle.resourceId : R.drawable.ic_incall_audio_handle); mOuterRing = new TargetDrawable(res, getResourceId(a, R.styleable.GlowPadView_outerRingDrawable), 1); @@ -620,7 +619,6 @@ public class GlowPadView extends View { updatePointCloudPosition(mWaveCenterX, mWaveCenterY); } } - /** * Loads an array of drawables from the given resourceId. * @@ -639,6 +637,15 @@ public class GlowPadView extends View { return mTargetResourceId; } + /** + * Sets teh handle drawable to the drawable specified by the resource ID. + * @param resourceId + */ + public void setHandleDrawable(int resourceId) { + mHandleDrawable = new TargetDrawable(getResources(), resourceId, 2); + mHandleDrawable.setState(TargetDrawable.STATE_INACTIVE); + } + /** * Sets the resource id specifying the target descriptions for accessibility. * -- cgit v1.2.3