Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9ace2c6 authored by Calvin Pan's avatar Calvin Pan
Browse files

Clean <plurals> in FindActionModeCallback

Bug: 199230228
Test: make
Change-Id: I59618e5467696d3173dfb4782ce55964694a42fc
parent 9e38ebf3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -398,7 +398,7 @@ Lcom/android/internal/R$layout;->select_dialog_multichoice:I
Lcom/android/internal/R$layout;->select_dialog_singlechoice:I
Lcom/android/internal/R$layout;->webview_find:I
Lcom/android/internal/R$layout;->zoom_magnify:I
Lcom/android/internal/R$plurals;->matches_found:I
Lcom/android/internal/R$string;->matches_found:I
Lcom/android/internal/R$raw;->loaderror:I
Lcom/android/internal/R$raw;->nodomain:I
Lcom/android/internal/R$string;->byteShort:I
+14 −3
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.text.Editable;
import android.text.Selection;
import android.text.Spannable;
import android.text.TextWatcher;
import android.util.PluralsMessageFormatter;
import android.view.ActionMode;
import android.view.LayoutInflater;
import android.view.Menu;
@@ -35,6 +36,11 @@ import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.TextView;

import com.android.internal.R;

import java.util.HashMap;
import java.util.Map;

/**
 * @hide
 */
@@ -180,9 +186,14 @@ public class FindActionModeCallback implements ActionMode.Callback, TextWatcher,
        if (mNumberOfMatches == 0) {
            mMatches.setText(com.android.internal.R.string.no_matches);
        } else {
            mMatches.setText(mResources.getQuantityString(
                com.android.internal.R.plurals.matches_found, mNumberOfMatches,
                mActiveMatchIndex + 1, mNumberOfMatches));
            Map<String, Object> arguments = new HashMap<>();
            arguments.put("count", mActiveMatchIndex + 1);
            arguments.put("total", mNumberOfMatches);

            mMatches.setText(PluralsMessageFormatter.format(
                    mResources,
                    arguments,
                    R.string.matches_found));
        }
        mMatches.setVisibility(View.VISIBLE);
    }
+5 −6
Original line number Diff line number Diff line
@@ -4191,12 +4191,11 @@

    <!-- Displayed on the Find dialog to display the index of the highlighted
         match and total number of matches found in the current page. [CHAR LIMIT=NONE] -->
    <plurals name="matches_found">
        <!-- Case of one match -->
        <item quantity="one">1 match</item>
        <!-- Case of multiple total matches -->
        <item quantity="other"><xliff:g id="index" example="2">%d</xliff:g> of <xliff:g id="total" example="137">%d</xliff:g></item>
    </plurals>
    <string name="matches_found">{ count, plural,
        =1 {# match}
        other {# of {total}}}
    }
    </string>

    <!-- Label for the "Done" button on the far left of action mode toolbars. -->
    <string name="action_mode_done">Done</string>
+1 −1
Original line number Diff line number Diff line
@@ -1263,8 +1263,8 @@
  <java-symbol type="plurals" name="bugreport_countdown" />
  <java-symbol type="plurals" name="file_count" />
  <java-symbol type="plurals" name="last_num_days" />
  <java-symbol type="plurals" name="matches_found" />
  <java-symbol type="plurals" name="restr_pin_countdown" />
  <java-symbol type="string" name="matches_found" />
  <java-symbol type="plurals" name="pinpuk_attempts" />
  <java-symbol type="plurals" name="ssl_ca_cert_warning" />