<string name="delete">Delete</string>
<!-- Misc files [CHAR LIMIT=25] -->
<string name="misc_files">Misc Files</string>
- <!-- number of misc files selected [CHAR LIMIT=20] -->
- <string name="misc_files_selected_count">selected</string>
- <!-- the string 'out of' displayed when saying "selected N out of M" [CHAR LIMIT=20] -->
- <string name="misc_files_selected_count_out_of">out of</string>
+ <!-- number of misc files selected [CHAR LIMIT=40] -->
+ <string name="misc_files_selected_count">selected %1$d out of %2$d</string>
+ <!-- number of bytes represented by the selected misc files [CHAR LIMIT=40] -->
+ <string name="misc_files_selected_count_bytes">%1$s out of %2$s</string>
<!-- action to select all [CHAR LIMIT=30] -->
<string name="select_all">Select All</string>
</resources>
*/
public class MiscFilesHandler extends ListActivity {
private static final String TAG = "MemorySettings";
- private String mNumSelectedStr;
- private String mNumSelectedOutOfStr;
+ private String mNumSelectedFormat;
+ private String mNumBytesSelectedFormat;
private MemoryMearurementAdapter mAdapter;
private LayoutInflater mInflater;
super.onCreate(savedInstanceState);
setFinishOnTouchOutside(true);
setTitle(R.string.misc_files);
- mNumSelectedStr = getString(R.string.misc_files_selected_count);
- mNumSelectedOutOfStr = getString(R.string.misc_files_selected_count_out_of);
+ mNumSelectedFormat = getString(R.string.misc_files_selected_count);
+ mNumBytesSelectedFormat = getString(R.string.misc_files_selected_count_bytes);
mAdapter = new MemoryMearurementAdapter(this);
mInflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
setContentView(R.layout.settings_storage_miscfiles_list);
boolean checked) {
ListView lv = getListView();
int numChecked = lv.getCheckedItemCount();
- mode.setTitle(mNumSelectedStr + " : " + numChecked +
- " " + mNumSelectedOutOfStr + " " + mAdapter.getCount());
+ mode.setTitle(String.format(mNumSelectedFormat, numChecked, mAdapter.getCount()));
// total the sizes of all items selected so far
SparseBooleanArray checkedItems = lv.getCheckedItemPositions();
}
}
}
- mode.setSubtitle(Formatter.formatFileSize(mContext, selectedDataSize) +
- " " + mNumSelectedOutOfStr + " " +
- Formatter.formatFileSize(mContext, mAdapter.getDataSize()));
+ mode.setSubtitle(String.format(mNumBytesSelectedFormat,
+ Formatter.formatFileSize(mContext, selectedDataSize),
+ Formatter.formatFileSize(mContext, mAdapter.getDataSize())));
}
}