diff options
author | Evan Charlton <evanc@google.com> | 2014-11-08 08:36:56 -0800 |
---|---|---|
committer | Evan Charlton <evanc@google.com> | 2014-11-10 10:52:47 -0800 |
commit | 972e8730b305c921e094690ae09abf2c44b0dc12 (patch) | |
tree | cc53b91271ad42dde695103394eb7046faee98f2 | |
parent | 3accf8639193a0fe7553e774940af6cef02c850b (diff) | |
download | packages_apps_PhoneCommon-972e8730b305c921e094690ae09abf2c44b0dc12.tar.gz packages_apps_PhoneCommon-972e8730b305c921e094690ae09abf2c44b0dc12.tar.bz2 packages_apps_PhoneCommon-972e8730b305c921e094690ae09abf2c44b0dc12.zip |
Show ILD rate information if present
If Dialer populates ILD (international / long distance) rate information,
populate a field above the dialed digits.
Bug: 13334252
Change-Id: Ia366148ef1318a2dacc4971d51a3bd34ec3c39de
-rw-r--r-- | res/layout/dialpad_view.xml | 33 | ||||
-rw-r--r-- | src/com/android/phone/common/dialpad/DialpadView.java | 18 |
2 files changed, 51 insertions, 0 deletions
diff --git a/res/layout/dialpad_view.xml b/res/layout/dialpad_view.xml index a6ff7aa..8ac4cf2 100644 --- a/res/layout/dialpad_view.xml +++ b/res/layout/dialpad_view.xml @@ -24,6 +24,39 @@ android:background="@color/background_dialpad" android:clickable="true" > + <!-- Text field where call rate is displayed for ILD calls. --> + <RelativeLayout + android:id="@+id/rate_container" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingTop="8dp" + android:visibility="gone"> + + <TextView android:id="@+id/ild_country" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:layout_alignParentTop="true" + android:layout_marginStart="@dimen/dialpad_digits_padding" /> + + <TextView android:id="@+id/ild_rate" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textStyle="bold" + android:layout_marginStart="4dp" + android:layout_toEndOf="@id/ild_country" /> + + <View + android:layout_width="match_parent" + android:layout_height="1dp" + android:background="#e3e3e3" + android:layout_marginTop="8dp" + android:layout_below="@id/ild_country" + android:layout_alignParentStart="true" + android:layout_alignParentEnd="true" /> + + </RelativeLayout> + <!-- Text field and possibly soft menu button above the keypad where the digits are displayed. --> <LinearLayout diff --git a/src/com/android/phone/common/dialpad/DialpadView.java b/src/com/android/phone/common/dialpad/DialpadView.java index 3cdc30e..fdce6f7 100644 --- a/src/com/android/phone/common/dialpad/DialpadView.java +++ b/src/com/android/phone/common/dialpad/DialpadView.java @@ -28,6 +28,7 @@ import android.util.AttributeSet; import android.util.Log; import android.view.MotionEvent; import android.view.View; +import android.view.ViewGroup; import android.view.ViewPropertyAnimator; import android.widget.EditText; import android.widget.ImageButton; @@ -63,6 +64,10 @@ public class DialpadView extends LinearLayout { private View mOverflowMenuButton; private ColorStateList mRippleColor; + private ViewGroup mRateContainer; + private TextView mIldCountry; + private TextView mIldRate; + private boolean mCanDigitsBeEdited; private final int[] mButtonIds = new int[] {R.id.zero, R.id.one, R.id.two, R.id.three, @@ -104,6 +109,9 @@ public class DialpadView extends LinearLayout { mDigits = (EditText) findViewById(R.id.digits); mDelete = (ImageButton) findViewById(R.id.deleteButton); mOverflowMenuButton = findViewById(R.id.dialpad_overflow); + mRateContainer = (ViewGroup) findViewById(R.id.rate_container); + mIldCountry = (TextView) mRateContainer.findViewById(R.id.ild_country); + mIldRate = (TextView) mRateContainer.findViewById(R.id.ild_rate); } private void setupKeypad() { @@ -184,6 +192,16 @@ public class DialpadView extends LinearLayout { mCanDigitsBeEdited = canBeEdited; } + public void setCallRateInformation(String countryName, String displayRate) { + if (TextUtils.isEmpty(countryName) && TextUtils.isEmpty(displayRate)) { + mRateContainer.setVisibility(View.GONE); + return; + } + mRateContainer.setVisibility(View.VISIBLE); + mIldCountry.setText(countryName); + mIldRate.setText(displayRate); + } + public boolean canDigitsBeEdited() { return mCanDigitsBeEdited; } |