diff options
-rw-r--r-- | res/layout/dialpad_view_unthemed.xml | 39 | ||||
-rw-r--r-- | res/values/cm_dimens.xml | 2 | ||||
-rw-r--r-- | src/com/android/phone/common/dialpad/DialpadView.java | 17 |
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() { |