diff options
author | Andrew Lee <anwlee@google.com> | 2014-12-03 19:50:34 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-12-03 19:50:34 +0000 |
commit | 03ddafca2953667e812803a7a9e682e8d0d05ad0 (patch) | |
tree | 750ba94309292a79fd90e266c5724699a5f938e2 | |
parent | 0c2e29310f49c0d04afebb5d8a7cb3f1851e7173 (diff) | |
parent | 56688065dd74cc6a254d3dff7769dd59b541432c (diff) |
am 4675da66: Merge "Show HD audio icon." into lmp-mr1-dev
* commit '4675da663271a328c14a32934cfa25d22e64e654':
Show HD audio icon.
-rw-r--r-- | InCallUI/res/drawable-hdpi/ic_hd_audio.png | bin | 0 -> 386 bytes | |||
-rw-r--r-- | InCallUI/res/drawable-mdpi/ic_hd_audio.png | bin | 0 -> 312 bytes | |||
-rw-r--r-- | InCallUI/res/drawable-xhdpi/ic_hd_audio.png | bin | 0 -> 407 bytes | |||
-rw-r--r-- | InCallUI/res/drawable-xxhdpi/ic_hd_audio.png | bin | 0 -> 564 bytes | |||
-rw-r--r-- | InCallUI/res/drawable-xxxhdpi/ic_hd_audio.png | bin | 0 -> 638 bytes | |||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardFragment.java | 55 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardPresenter.java | 13 |
7 files changed, 42 insertions, 26 deletions
diff --git a/InCallUI/res/drawable-hdpi/ic_hd_audio.png b/InCallUI/res/drawable-hdpi/ic_hd_audio.png Binary files differnew file mode 100644 index 000000000..cccaf4949 --- /dev/null +++ b/InCallUI/res/drawable-hdpi/ic_hd_audio.png diff --git a/InCallUI/res/drawable-mdpi/ic_hd_audio.png b/InCallUI/res/drawable-mdpi/ic_hd_audio.png Binary files differnew file mode 100644 index 000000000..6353b7acf --- /dev/null +++ b/InCallUI/res/drawable-mdpi/ic_hd_audio.png diff --git a/InCallUI/res/drawable-xhdpi/ic_hd_audio.png b/InCallUI/res/drawable-xhdpi/ic_hd_audio.png Binary files differnew file mode 100644 index 000000000..6d05d45f5 --- /dev/null +++ b/InCallUI/res/drawable-xhdpi/ic_hd_audio.png diff --git a/InCallUI/res/drawable-xxhdpi/ic_hd_audio.png b/InCallUI/res/drawable-xxhdpi/ic_hd_audio.png Binary files differnew file mode 100644 index 000000000..44294ba05 --- /dev/null +++ b/InCallUI/res/drawable-xxhdpi/ic_hd_audio.png diff --git a/InCallUI/res/drawable-xxxhdpi/ic_hd_audio.png b/InCallUI/res/drawable-xxxhdpi/ic_hd_audio.png Binary files differnew file mode 100644 index 000000000..459cd8f46 --- /dev/null +++ b/InCallUI/res/drawable-xxxhdpi/ic_hd_audio.png diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java index 51c058557..d3a229c9f 100644 --- a/InCallUI/src/com/android/incallui/CallCardFragment.java +++ b/InCallUI/src/com/android/incallui/CallCardFragment.java @@ -477,7 +477,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr int sessionModificationState, DisconnectCause disconnectCause, String connectionLabel, - Drawable connectionIcon, + Drawable callStateIcon, String gatewayNumber) { boolean isGatewayCall = !TextUtils.isEmpty(gatewayNumber); CharSequence callStateLabel = getCallStateLabelFromState(state, videoState, @@ -498,44 +498,51 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr mCallStateLabel.setAlpha(1); mCallStateLabel.setVisibility(View.VISIBLE); - if (connectionIcon == null) { - mCallStateIcon.setVisibility(View.GONE); - } else { - mCallStateIcon.setVisibility(View.VISIBLE); - // Invoke setAlpha(float) instead of setAlpha(int) to set the view's alpha. This is - // needed because the pulse animation operates on the view alpha. - mCallStateIcon.setAlpha(1.0f); - mCallStateIcon.setImageDrawable(connectionIcon); - } - - if (VideoProfile.VideoState.isBidirectional(videoState) - || (state == Call.State.ACTIVE && sessionModificationState - == Call.SessionModificationState.WAITING_FOR_RESPONSE)) { - mCallStateVideoCallIcon.setVisibility(View.VISIBLE); - } else { - mCallStateVideoCallIcon.setVisibility(View.GONE); - } - if (state == Call.State.ACTIVE || state == Call.State.CONFERENCED) { mCallStateLabel.clearAnimation(); - mCallStateIcon.clearAnimation(); } else { mCallStateLabel.startAnimation(mPulseAnimation); - mCallStateIcon.startAnimation(mPulseAnimation); } } else { - Animation callStateAnimation = mCallStateLabel.getAnimation(); - if (callStateAnimation != null) { - callStateAnimation.cancel(); + Animation callStateLabelAnimation = mCallStateLabel.getAnimation(); + if (callStateLabelAnimation != null) { + callStateLabelAnimation.cancel(); } mCallStateLabel.setText(null); mCallStateLabel.setAlpha(0); mCallStateLabel.setVisibility(View.GONE); + } + + if (callStateIcon != null) { + mCallStateIcon.setVisibility(View.VISIBLE); + // Invoke setAlpha(float) instead of setAlpha(int) to set the view's alpha. This is + // needed because the pulse animation operates on the view alpha. + mCallStateIcon.setAlpha(1.0f); + mCallStateIcon.setImageDrawable(callStateIcon); + + if (state == Call.State.ACTIVE || state == Call.State.CONFERENCED + || TextUtils.isEmpty(callStateLabel)) { + mCallStateIcon.clearAnimation(); + } else { + mCallStateIcon.startAnimation(mPulseAnimation); + } + } else { + Animation callStateIconAnimation = mCallStateIcon.getAnimation(); + if (callStateIconAnimation != null) { + callStateIconAnimation.cancel(); + } + // Invoke setAlpha(float) instead of setAlpha(int) to set the view's alpha. This is // needed because the pulse animation operates on the view alpha. mCallStateIcon.setAlpha(0.0f); mCallStateIcon.setVisibility(View.GONE); + } + if (VideoProfile.VideoState.isBidirectional(videoState) + || (state == Call.State.ACTIVE && sessionModificationState + == Call.SessionModificationState.WAITING_FOR_RESPONSE)) { + mCallStateVideoCallIcon.setVisibility(View.VISIBLE); + } else { mCallStateVideoCallIcon.setVisibility(View.GONE); } } diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index 9e7273054..a039637e0 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -297,7 +297,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> mPrimary.getSessionModificationState(), mPrimary.getDisconnectCause(), getConnectionLabel(), - getConnectionIcon(), + getCallStateIcon(), getGatewayNumber()); setCallbackNumber(); } @@ -608,7 +608,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> return getCallProviderLabel(mPrimary); } - private Drawable getConnectionIcon() { + private Drawable getCallStateIcon() { + // Return connection icon if one exists. StatusHints statusHints = mPrimary.getTelecommCall().getDetails().getStatusHints(); if (statusHints != null && statusHints.getIconResId() != 0) { Drawable icon = statusHints.getIcon(mContext); @@ -616,6 +617,14 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> return icon; } } + + // Return high definition audio icon if the capability is indicated. + if (mPrimary.getTelecommCall().getDetails().can( + android.telecom.Call.Details.CAPABILITY_HIGH_DEF_AUDIO) + && mPrimary.getState() == Call.State.ACTIVE) { + return mContext.getResources().getDrawable(R.drawable.ic_hd_audio); + } + return null; } |