Merge "Selected count string needs plurals." into mnc-dev
This commit is contained in:
@@ -1790,6 +1790,15 @@ public class TextUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return localized string representing the given number of selected items.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static CharSequence formatSelectedCount(int count) {
|
||||||
|
return Resources.getSystem().getQuantityString(R.plurals.selected_count, count, count);
|
||||||
|
}
|
||||||
|
|
||||||
private static Object sLock = new Object();
|
private static Object sLock = new Object();
|
||||||
|
|
||||||
private static char[] sTemp = null;
|
private static char[] sTemp = null;
|
||||||
|
|||||||
@@ -4186,4 +4186,9 @@
|
|||||||
notification_template_material_inbox.xml.
|
notification_template_material_inbox.xml.
|
||||||
DO NOT TRANSLATE -->
|
DO NOT TRANSLATE -->
|
||||||
<string name="notification_inbox_ellipsis">\u2026</string>
|
<string name="notification_inbox_ellipsis">\u2026</string>
|
||||||
|
|
||||||
|
<!-- Label describing the number of selected items [CHAR LIMIT=48] -->
|
||||||
|
<plurals name="selected_count">
|
||||||
|
<item quantity="other"><xliff:g id="count" example="3">%1$d</xliff:g> selected</item>
|
||||||
|
</plurals>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -2306,5 +2306,6 @@
|
|||||||
<java-symbol type="string" name="ext_media_status_missing" />
|
<java-symbol type="string" name="ext_media_status_missing" />
|
||||||
<java-symbol type="string" name="ext_media_unsupported_notification_message" />
|
<java-symbol type="string" name="ext_media_unsupported_notification_message" />
|
||||||
<java-symbol type="string" name="ext_media_unsupported_notification_title" />
|
<java-symbol type="string" name="ext_media_unsupported_notification_title" />
|
||||||
|
<java-symbol type="plurals" name="selected_count" />
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -68,9 +68,6 @@
|
|||||||
<!-- Button label that copies files to the current directory [CHAR LIMIT=24] -->
|
<!-- Button label that copies files to the current directory [CHAR LIMIT=24] -->
|
||||||
<string name="button_copy">Copy</string>
|
<string name="button_copy">Copy</string>
|
||||||
|
|
||||||
<!-- Action mode title summarizing the number of documents selected [CHAR LIMIT=32] -->
|
|
||||||
<string name="mode_selected_count"><xliff:g id="count" example="3">%1$d</xliff:g> selected</string>
|
|
||||||
|
|
||||||
<!-- Mode that sorts documents by their display name alphabetically [CHAR LIMIT=24] -->
|
<!-- Mode that sorts documents by their display name alphabetically [CHAR LIMIT=24] -->
|
||||||
<string name="sort_name">By name</string>
|
<string name="sort_name">By name</string>
|
||||||
<!-- Mode that sorts documents by their last modified time in descending order; most recent first [CHAR LIMIT=24] -->
|
<!-- Mode that sorts documents by their last modified time in descending order; most recent first [CHAR LIMIT=24] -->
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ import android.os.OperationCanceledException;
|
|||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.provider.DocumentsContract;
|
import android.provider.DocumentsContract;
|
||||||
import android.provider.DocumentsContract.Document;
|
import android.provider.DocumentsContract.Document;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.text.format.DateUtils;
|
import android.text.format.DateUtils;
|
||||||
import android.text.format.Formatter;
|
import android.text.format.Formatter;
|
||||||
import android.text.format.Time;
|
import android.text.format.Time;
|
||||||
@@ -474,8 +475,7 @@ public class DirectoryFragment extends Fragment {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
|
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
|
||||||
mode.getMenuInflater().inflate(R.menu.mode_directory, menu);
|
mode.getMenuInflater().inflate(R.menu.mode_directory, menu);
|
||||||
mode.setTitle(getResources()
|
mode.setTitle(TextUtils.formatSelectedCount(mCurrentView.getCheckedItemCount()));
|
||||||
.getString(R.string.mode_selected_count, mCurrentView.getCheckedItemCount()));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -571,8 +571,7 @@ public class DirectoryFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mode.setTitle(getResources()
|
mode.setTitle(TextUtils.formatSelectedCount(mCurrentView.getCheckedItemCount()));
|
||||||
.getString(R.string.mode_selected_count, mCurrentView.getCheckedItemCount()));
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user