diff options
-rw-r--r-- | res/values/cm_plurals.xml | 22 | ||||
-rw-r--r-- | src-ambient/incall/CallMethodInfo.java | 24 |
2 files changed, 24 insertions, 22 deletions
diff --git a/res/values/cm_plurals.xml b/res/values/cm_plurals.xml new file mode 100644 index 0000000..0ed759e --- /dev/null +++ b/res/values/cm_plurals.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2016 The CyanogenMod Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<resources> + <plurals name="number_of_incall_subscriptions"> + <item quantity="one">%d Subscription</item> + <item quantity="other">%d Subscriptions</item> + </plurals> +</resources>
\ No newline at end of file diff --git a/src-ambient/incall/CallMethodInfo.java b/src-ambient/incall/CallMethodInfo.java index f98e811..c4e0b52 100644 --- a/src-ambient/incall/CallMethodInfo.java +++ b/src-ambient/incall/CallMethodInfo.java @@ -181,28 +181,8 @@ public class CallMethodInfo { List<SubscriptionInfo> subscriptionInfos = ci.subscriptions; if (subscriptionInfos != null && !subscriptionInfos.isEmpty()) { - int subscriptionSize = subscriptionInfos.size(); - StringBuilder subscripText = new StringBuilder(); - int extraCount = 0; - for (int i = 0; i < subscriptionSize; i++) { - SubscriptionInfo si = subscriptionInfos.get(i); - if (i >= 3) { - extraCount++; - if (i == subscriptionSize - 1) { - subscripText.append("+" + extraCount); - } - } else { - // Region codes should be no larger than three char long the credits bar - // can only show so much. - if (si.regionCode.length() <= 3) { - subscripText.append(si.regionCode); - if (i < subscriptionSize - 1) { - subscripText.append(", "); - } - } - } - } - return subscripText.toString(); + int size = subscriptionInfos.size(); + return r.getQuantityString(R.plurals.number_of_incall_subscriptions, size, size); } else { CreditBalance balance = ci.balance; if (balance != null) { |