summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2013-08-29 19:37:04 -0700
committerYorke Lee <yorkelee@google.com>2013-08-29 19:38:57 -0700
commit90995fcb6778a9cb6dc35be12aeb1a5d0dcbb5ae (patch)
tree00bf6da6e8d9f141b921bdec5f3381f9e2857eb9 /InCallUI
parent7569427c703ae89003317ee3e37dfa9e171d8abe (diff)
Allow swapping calls by clicking on secondary call card
Bug: 9679473 Change-Id: I9e25a247c59530d257ece27e62c88329eb5f4f61
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/res/drawable/clickable_dim_effect.xml24
-rw-r--r--InCallUI/res/layout/secondary_call_info.xml5
-rw-r--r--InCallUI/src/com/android/incallui/CallCardFragment.java12
-rw-r--r--InCallUI/src/com/android/incallui/CallCardPresenter.java4
4 files changed, 44 insertions, 1 deletions
diff --git a/InCallUI/res/drawable/clickable_dim_effect.xml b/InCallUI/res/drawable/clickable_dim_effect.xml
new file mode 100644
index 000000000..e4b4f6fd6
--- /dev/null
+++ b/InCallUI/res/drawable/clickable_dim_effect.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 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.
+-->
+
+<!-- Background drawable used with dim effect for secondary photo. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:state_pressed="true" android:state_enabled="true"
+ android:drawable="@drawable/list_pressed_holo_dark" />
+ <item android:drawable="@color/on_hold_dim_effect" />
+
+</selector>
diff --git a/InCallUI/res/layout/secondary_call_info.xml b/InCallUI/res/layout/secondary_call_info.xml
index 546278f95..369763abf 100644
--- a/InCallUI/res/layout/secondary_call_info.xml
+++ b/InCallUI/res/layout/secondary_call_info.xml
@@ -31,7 +31,10 @@
android:scaleType="centerCrop"
android:contentDescription="@string/onHold" />
- <!-- TODO(klp): Add clickable dim effect -->
+ <View android:id="@+id/dim_effect_for_secondary_photo"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@drawable/clickable_dim_effect"/>
<!-- Name (or the phone number, if we don't have a name to display). -->
<TextView android:id="@+id/secondaryCallName"
diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java
index 2c0204c15..d880b973a 100644
--- a/InCallUI/src/com/android/incallui/CallCardFragment.java
+++ b/InCallUI/src/com/android/incallui/CallCardFragment.java
@@ -26,6 +26,7 @@ import android.text.TextUtils;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
+import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewStub;
import android.widget.ImageView;
@@ -56,6 +57,7 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
private ViewStub mSecondaryCallInfo;
private TextView mSecondaryCallName;
private ImageView mSecondaryPhoto;
+ private View mSecondaryPhotoOverlay;
// Cached DisplayMetrics density.
private float mDensity;
@@ -437,5 +439,15 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr
if (mSecondaryPhoto == null) {
mSecondaryPhoto = (ImageView) getView().findViewById(R.id.secondaryCallPhoto);
}
+
+ if (mSecondaryPhotoOverlay == null) {
+ mSecondaryPhotoOverlay = getView().findViewById(R.id.dim_effect_for_secondary_photo);
+ mSecondaryPhotoOverlay.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ getPresenter().secondaryPhotoClicked();
+ }
+ });
+ }
}
}
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java
index 5cb4219d4..f8343fea4 100644
--- a/InCallUI/src/com/android/incallui/CallCardPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java
@@ -480,6 +480,10 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
mAudioModeProvider.addListener(this);
}
+ public void secondaryPhotoClicked() {
+ CallCommandClient.getInstance().swap();
+ }
+
public interface CallCardUi extends Ui {
void setVisible(boolean on);
void setPrimary(String number, String name, boolean nameIsNumber, String label,