summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Bird <sbird@cyngn.com>2016-02-03 10:46:44 -0800
committerRichard MacGregor <rmacgregor@cyngn.com>2016-04-08 10:42:50 -0700
commit57e3b009c05595617c068c1be0b3fa0a10817576 (patch)
tree0d1514d1578b1496cfa25f8410bdd93ed0626dd9
parentfc97e72d5d8b7e785a49f9333e3497d14ee690bc (diff)
downloadandroid_packages_apps_PhoneCommon-57e3b009c05595617c068c1be0b3fa0a10817576.tar.gz
android_packages_apps_PhoneCommon-57e3b009c05595617c068c1be0b3fa0a10817576.tar.bz2
android_packages_apps_PhoneCommon-57e3b009c05595617c068c1be0b3fa0a10817576.zip
setOverflowMenuButton custom button placement
We need to move the default overflow button without being to disruptive to the common dialpad layout. Also, create way to force a PSTN call from an incall provider. Change-Id: I5cc7d372ff8e438a4a291f4296ac2a5da086b8c8
-rw-r--r--res/values/cm_colors.xml2
-rw-r--r--res/values/cm_dimens.xml3
-rw-r--r--src-ambient/incall/CallMethodInfo.java7
-rw-r--r--src/com/android/phone/common/dialpad/DialpadView.java11
4 files changed, 20 insertions, 3 deletions
diff --git a/res/values/cm_colors.xml b/res/values/cm_colors.xml
index fb696e6..5e63e5b 100644
--- a/res/values/cm_colors.xml
+++ b/res/values/cm_colors.xml
@@ -10,4 +10,6 @@
<color name="sim_icon_color">#f5a623</color>
<color name="emergency_call_icon_color">#42000000</color>
+ <color name="overflow_tint_color">#b3b3b3</color>
+
</resources> \ No newline at end of file
diff --git a/res/values/cm_dimens.xml b/res/values/cm_dimens.xml
index 8572abe..64968eb 100644
--- a/res/values/cm_dimens.xml
+++ b/res/values/cm_dimens.xml
@@ -19,6 +19,9 @@
<dimen name="dialpad_key_margin_right">9dp</dimen>
<dimen name="dialpad_key_number_left_margin">26dp</dimen>
+ <dimen name="dialpad_overflow_left_margin">50dp</dimen>
+ <dimen name="dialpad_overflow_left_margin_landscape">36dp</dimen>
+
<!-- Dimensions for call method spinner and items -->
<dimen name="call_method_spinner_padding_start">4dp</dimen>
<dimen name="call_method_spinner_item_default_padding">12dp</dimen>
diff --git a/src-ambient/incall/CallMethodInfo.java b/src-ambient/incall/CallMethodInfo.java
index 988a1c6..602e411 100644
--- a/src-ambient/incall/CallMethodInfo.java
+++ b/src-ambient/incall/CallMethodInfo.java
@@ -145,6 +145,11 @@ public class CallMethodInfo {
}
public void placeCall(String origin, String number, Context c, boolean isVideoCall) {
+ placeCall(origin, number, c, isVideoCall, false);
+ }
+
+ public void placeCall(String origin, String number, Context c, boolean isVideoCall,
+ boolean forcePSTN) {
StartInCallCallReceiver svcrr = CallMethodHelper.getVoIPResultReceiver(this, origin);
StartCallRequest request = new StartCallRequest(number, origin, 0, svcrr);
@@ -152,7 +157,7 @@ public class CallMethodInfo {
InCallServices.getInstance().startVideoCall(
AmbientConnection.CLIENT.get(c), this.mComponent, request);
} else {
- if (PhoneNumberUtils.isGlobalPhoneNumber(number)) {
+ if (PhoneNumberUtils.isGlobalPhoneNumber(number) || forcePSTN) {
InCallServices.getInstance().startOutCall(
AmbientConnection.CLIENT.get(c), this.mComponent, request);
} else {
diff --git a/src/com/android/phone/common/dialpad/DialpadView.java b/src/com/android/phone/common/dialpad/DialpadView.java
index 3d17880..aae7a43 100644
--- a/src/com/android/phone/common/dialpad/DialpadView.java
+++ b/src/com/android/phone/common/dialpad/DialpadView.java
@@ -269,8 +269,7 @@ public class DialpadView extends LinearLayout {
public void setCanDigitsBeEdited(boolean canBeEdited) {
View deleteButton = findViewById(R.id.deleteButton);
deleteButton.setVisibility(canBeEdited ? View.VISIBLE : View.GONE);
- View overflowMenuButton = findViewById(R.id.dialpad_overflow);
- overflowMenuButton.setVisibility(canBeEdited ? View.VISIBLE : View.GONE);
+ mOverflowMenuButton.setVisibility(canBeEdited ? View.VISIBLE : View.GONE);
EditText digits = (EditText) findViewById(R.id.digits);
digits.setClickable(canBeEdited);
@@ -360,6 +359,14 @@ public class DialpadView extends LinearLayout {
return mOverflowMenuButton;
}
+ public void setOverflowMenuButton(ImageButton ib) {
+ if (ib != null) {
+ mOverflowMenuButton.setVisibility(View.GONE);
+ }
+ mOverflowMenuButton = ib;
+
+ }
+
/**
* Get the animation delay for the buttons, taking into account whether the dialpad is in
* landscape left-to-right, landscape right-to-left, or portrait.