summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Bird <sbird@cyngn.com>2016-01-19 16:32:08 -0800
committerRichard MacGregor <rmacgregor@cyngn.com>2016-04-08 10:42:49 -0700
commitc5f5b115f589f95d02fb0fd3690d098ca6397974 (patch)
treefed5b61de9dc57cc3158f9783621833c74b4ebc4
parent77d309114c14749e5905387cdb03a520b5a16bff (diff)
downloadandroid_packages_apps_PhoneCommon-c5f5b115f589f95d02fb0fd3690d098ca6397974.tar.gz
android_packages_apps_PhoneCommon-c5f5b115f589f95d02fb0fd3690d098ca6397974.tar.bz2
android_packages_apps_PhoneCommon-c5f5b115f589f95d02fb0fd3690d098ca6397974.zip
Bringup credits and other minor things
Change-Id: Ib8bd8373a53adc7a370850091a04ada87beca098
-rw-r--r--res/layout/dialpad_view_unthemed.xml39
-rw-r--r--res/values/cm_dimens.xml2
-rw-r--r--src/com/android/phone/common/dialpad/DialpadView.java17
3 files changed, 48 insertions, 10 deletions
diff --git a/res/layout/dialpad_view_unthemed.xml b/res/layout/dialpad_view_unthemed.xml
index 18ab647..f16ab39 100644
--- a/res/layout/dialpad_view_unthemed.xml
+++ b/res/layout/dialpad_view_unthemed.xml
@@ -34,22 +34,45 @@
<LinearLayout
android:id="@+id/ild_container"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center_horizontal"
+ android:weightSum="6"
android:layout_marginTop="@dimen/ild_margin_height"
android:layout_marginBottom="@dimen/ild_margin_height">
- <TextView android:id="@+id/ild_country"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
+ <LinearLayout
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:layout_weight="3"
+ android:layout_marginStart="@dimen/dialpad_credits_padding"
+ android:orientation="horizontal" >
+
+ <TextView android:id="@+id/ild_country"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="start" />
+
+ </LinearLayout>
- <TextView android:id="@+id/ild_rate"
- android:layout_width="wrap_content"
+ <LinearLayout
+ android:layout_width="0dp"
android:layout_height="wrap_content"
- android:layout_marginStart="4dp"
- android:textStyle="bold" />
+ android:singleLine="true"
+ android:layout_weight="3"
+ android:layout_marginEnd="@dimen/dialpad_credits_padding"
+ android:orientation="vertical" >
+
+ <TextView android:id="@+id/ild_rate"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="4dp"
+ android:textStyle="bold"
+ android:layout_gravity="end" />
+
+ </LinearLayout>
</LinearLayout>
diff --git a/res/values/cm_dimens.xml b/res/values/cm_dimens.xml
index 3880dd6..8572abe 100644
--- a/res/values/cm_dimens.xml
+++ b/res/values/cm_dimens.xml
@@ -26,4 +26,6 @@
<dimen name="call_method_spinner_item_text_left_margin">16dp</dimen>
<dimen name="call_method_spinner_dropdown_item_width">134dp</dimen>
<dimen name="call_method_spinner_icon_size">24dp</dimen>
+
+ <dimen name="dialpad_credits_padding">14dp</dimen>
</resources> \ No newline at end of file
diff --git a/src/com/android/phone/common/dialpad/DialpadView.java b/src/com/android/phone/common/dialpad/DialpadView.java
index 53a9dbe..3d17880 100644
--- a/src/com/android/phone/common/dialpad/DialpadView.java
+++ b/src/com/android/phone/common/dialpad/DialpadView.java
@@ -17,6 +17,7 @@
package com.android.phone.common.dialpad;
import android.animation.AnimatorListenerAdapter;
+import android.app.PendingIntent;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
@@ -280,14 +281,26 @@ public class DialpadView extends LinearLayout {
mCanDigitsBeEdited = canBeEdited;
}
- public void setCallRateInformation(String countryName, String displayRate) {
- if (TextUtils.isEmpty(countryName) && TextUtils.isEmpty(displayRate)) {
+ public void setCallRateInformation(String countryName, String displayRate,
+ final PendingIntent p) {
+ if (TextUtils.isEmpty(countryName) && TextUtils.isEmpty(displayRate) &&
+ p == null) {
mRateContainer.setVisibility(View.GONE);
return;
}
mRateContainer.setVisibility(View.VISIBLE);
mIldCountry.setText(countryName);
mIldRate.setText(displayRate);
+ mIldRate.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ try {
+ p.send();
+ } catch (PendingIntent.CanceledException e) {
+ e.printStackTrace();
+ }
+ }
+ });
}
public boolean canDigitsBeEdited() {