summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRaj Yengisetty <raj@cyngn.com>2016-02-12 12:43:43 -0800
committerRichard MacGregor <rmacgregor@cyngn.com>2016-04-08 10:42:50 -0700
commita1aefab78ec4c7de7f69b5c3a6362f6ebe9d79f9 (patch)
tree207993e6e02ccf0b2e2cbc37072db551ab0ecd2c /src
parent95562ec70e8c61a010a77279540a1149844d11ce (diff)
downloadandroid_packages_apps_PhoneCommon-a1aefab78ec4c7de7f69b5c3a6362f6ebe9d79f9.tar.gz
android_packages_apps_PhoneCommon-a1aefab78ec4c7de7f69b5c3a6362f6ebe9d79f9.tar.bz2
android_packages_apps_PhoneCommon-a1aefab78ec4c7de7f69b5c3a6362f6ebe9d79f9.zip
InCall: move CreditBarHelper to src-ambient
Change-Id: I41cb619fc6e9fb759c3b4e388b4606e145d3c39c
Diffstat (limited to 'src')
-rw-r--r--src/com/android/phone/common/dialpad/CreditBarHelper.java93
1 files changed, 0 insertions, 93 deletions
diff --git a/src/com/android/phone/common/dialpad/CreditBarHelper.java b/src/com/android/phone/common/dialpad/CreditBarHelper.java
deleted file mode 100644
index ac698ad..0000000
--- a/src/com/android/phone/common/dialpad/CreditBarHelper.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package com.android.phone.common.dialpad;
-
-import android.app.PendingIntent;
-import android.content.res.Resources;
-import android.text.TextUtils;
-import android.util.Log;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.TextView;
-
-import com.android.phone.common.R;
-import com.android.phone.common.incall.CallMethodInfo;
-
-/**
- * Helper method used to handle incall credit bars
- *
- * The credit bar's origin code comes from google. We've added a second credit bar in dialer that
- * uses these same helper method.
- */
-public class CreditBarHelper {
-
- private static final String TAG = CreditBarHelper.class.getSimpleName();
-
- public interface CreditBarVisibilityListener {
- public void creditsBarVisibilityChanged(int visibility);
- }
-
- public static void clearCallRateInformation(ViewGroup v, CreditBarVisibilityListener cpvl) {
- setCallRateInformation(v, null, null, null, cpvl);
- }
-
- public static void setCallRateInformation(ViewGroup creditsBar, String countryName,
- String displayRate, final PendingIntent p,
- CreditBarVisibilityListener cpvl) {
- if (TextUtils.isEmpty(countryName) && TextUtils.isEmpty(displayRate) &&
- p == null) {
- creditsBar.setVisibility(View.GONE);
- cpvl.creditsBarVisibilityChanged(View.GONE);
- return;
- }
- creditsBar.setVisibility(View.VISIBLE);
- cpvl.creditsBarVisibilityChanged(View.VISIBLE);
- TextView ildCountry = (TextView) creditsBar.findViewById(R.id.ild_country);
- TextView ildRate = (TextView) creditsBar.findViewById(R.id.ild_rate);
-
- ildCountry.setText(countryName);
- ildRate.setText(displayRate);
- ildRate.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- try {
- if (p != null) {
- p.send();
- } else {
- Log.wtf(TAG, "The intent we attempted to fire was null");
- }
- } catch (PendingIntent.CanceledException e) {
- e.printStackTrace();
- }
- }
- });
- }
-
- public static void callMethodCredits(ViewGroup v, CallMethodInfo cmi, Resources r,
- CreditBarVisibilityListener cpvl) {
- String creditText = cmi.getCreditsDescriptionText(r);
- String buttonText = null;
- PendingIntent button;
-
- boolean warnIfLow = false;
- if (TextUtils.isEmpty(creditText)) {
- clearCallRateInformation(v, cpvl);
- return;
- } else {
- if (cmi.mIsAuthenticated) {
- button = cmi.mManageCreditIntent;
- if (cmi.usesSubscriptions()) {
- buttonText = cmi.mSubscriptionButtonText;
- } else {
- if (cmi.getCurrencyAmount() <= cmi.mCreditWarn) {
- warnIfLow = true;
- }
- buttonText = cmi.mCreditButtonText;
- }
- } else {
- buttonText = r.getString(R.string.sign_in_credit_banner_text);
- creditText = "";
- button = cmi.mLoginIntent;
- }
- }
- setCallRateInformation(v, creditText, buttonText, button, cpvl);
- }
-}