Clean <plurals> in ChooserActivity
Bug: 199230228 Test: make Change-Id: Id1364a9c67187ee4839392751f6ed41ca1b281bc
This commit is contained in:
@@ -90,6 +90,7 @@ import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.HashedStringCache;
|
||||
import android.util.Log;
|
||||
import android.util.PluralsMessageFormatter;
|
||||
import android.util.Size;
|
||||
import android.util.Slog;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -216,6 +217,9 @@ public class ChooserActivity extends ResolverActivity implements
|
||||
private static final int APP_PREDICTION_SHARE_TARGET_QUERY_PACKAGE_LIMIT = 20;
|
||||
public static final String APP_PREDICTION_INTENT_FILTER_KEY = "intent_filter";
|
||||
|
||||
private static final String PLURALS_COUNT = "count";
|
||||
private static final String PLURALS_FILE_NAME = "file_name";
|
||||
|
||||
@VisibleForTesting
|
||||
public static final int LIST_VIEW_UPDATE_INTERVAL_IN_MILLIS = 250;
|
||||
|
||||
@@ -1551,8 +1555,13 @@ public class ChooserActivity extends ResolverActivity implements
|
||||
} else {
|
||||
FileInfo fileInfo = extractFileInfo(uris.get(0), getContentResolver());
|
||||
int remUriCount = uriCount - 1;
|
||||
String fileName = getResources().getQuantityString(R.plurals.file_count,
|
||||
remUriCount, fileInfo.name, remUriCount);
|
||||
Map<String, Object> arguments = new HashMap<>();
|
||||
arguments.put(PLURALS_COUNT, remUriCount);
|
||||
arguments.put(PLURALS_FILE_NAME, fileInfo.name);
|
||||
String fileName = PluralsMessageFormatter.format(
|
||||
getResources(),
|
||||
arguments,
|
||||
R.string.file_count);
|
||||
|
||||
TextView fileNameView = contentPreviewLayout.findViewById(
|
||||
R.id.content_preview_filename);
|
||||
|
||||
@@ -5807,10 +5807,11 @@
|
||||
<!-- String displayed when loading a user in the car [CHAR LIMIT=30] -->
|
||||
<string name="car_loading_profile">Loading</string>
|
||||
|
||||
<plurals name="file_count">
|
||||
<item quantity="one"><xliff:g id="file_name">%s</xliff:g> + <xliff:g id="count">%d</xliff:g> file</item>
|
||||
<item quantity="other"><xliff:g id="file_name">%s</xliff:g> + <xliff:g id="count">%d</xliff:g> files</item>
|
||||
</plurals>
|
||||
<string name="file_count">{count, plural,
|
||||
=1 {{file_name} + # file}
|
||||
other {{file_name} + # files}
|
||||
}
|
||||
</string>
|
||||
|
||||
<!-- ChooserActivity - No direct share targets are available. [CHAR LIMIT=NONE] -->
|
||||
<string name="chooser_no_direct_share_targets">No recommended people to share with</string>
|
||||
|
||||
@@ -1261,9 +1261,9 @@
|
||||
<java-symbol type="string" name="tooltip_popup_title" />
|
||||
|
||||
<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="restr_pin_countdown" />
|
||||
<java-symbol type="string" name="file_count" />
|
||||
<java-symbol type="string" name="matches_found" />
|
||||
<java-symbol type="plurals" name="pinpuk_attempts" />
|
||||
<java-symbol type="plurals" name="ssl_ca_cert_warning" />
|
||||
|
||||
Reference in New Issue
Block a user