@Override
 public void onClick(DialogInterface dialog, int which) {
   dialog.dismiss();
   if ((0 > which) || (TextSizeSetting.VALUES.size() <= which)) {
     return;
   }
   textSize(TextSizeSetting.VALUES.get(which));
 }
 private void onScale(int scale) {
   if (0 == scale) {
     return;
   }
   int textSize = sourceView.getTextSize();
   int index = TextSizeSetting.REVERSE_VALUES.get(textSize);
   index += scale;
   if ((0 <= index) && (TextSizeSetting.VALUES.size() > index)) {
     textSize(TextSizeSetting.VALUES.get(index));
   }
 }
 private boolean onTextSizeClick() {
   AlertDialog.Builder builder = new AlertDialog.Builder(this);
   builder.setCancelable(true);
   String[] items = new String[TextSizeSetting.VALUES.size()];
   int index = -1;
   int textSize = textSize();
   for (int ii = items.length - 1; 0 <= ii; --ii) {
     int value = TextSizeSetting.VALUES.get(ii);
     items[ii] = Integer.toString(value);
     if (textSize == value) {
       index = ii;
     }
   }
   builder.setSingleChoiceItems(items, index, new TextSizeListener());
   builder.setNegativeButton(R.string.cancel, null);
   builder.setTitle(R.string.text_size);
   AlertDialog dialog = builder.create();
   dialog.show();
   return true;
 }