コード例 #1
0
 @Override
 public void onSelectionChange(Path path, boolean selected) {
   int count = mSelectionManager.getSelectedCount();
   String format =
       mActivity.getResources().getQuantityString(R.plurals.number_of_items_selected, count);
   mActionModeHandler.setTitle(String.format(format, count));
   mActionModeHandler.updateSupportedOperation(path, selected);
 }
コード例 #2
0
 private String getSelectedString() {
   int count = mSelectionManager.getSelectedCount();
   int action = mActionBar.getClusterTypeAction();
   int string =
       action == FilterUtils.CLUSTER_BY_ALBUM
           ? R.plurals.number_of_albums_selected
           : R.plurals.number_of_groups_selected;
   String format = mActivity.getResources().getQuantityString(string, count);
   return String.format(format, count);
 }