translations added

This commit is contained in:
serso
2011-09-27 17:04:32 +04:00
parent 268d3503d3
commit 4426e41df9
5 changed files with 36 additions and 24 deletions

View File

@@ -72,7 +72,7 @@ public class CalculatorView implements CursorControl, HistoryControl<CalculatorH
if (!StringUtils.isEmpty(text)) {
final ClipboardManager clipboard = (ClipboardManager) activity.getSystemService(Activity.CLIPBOARD_SERVICE);
clipboard.setText(text);
Toast.makeText(activity, "Result copied to clipboard!", Toast.LENGTH_SHORT).show();
Toast.makeText(activity, activity.getText(R.string.c_result_copied), Toast.LENGTH_SHORT).show();
}
}
}

View File

@@ -33,17 +33,18 @@ public class HistoryDragProcessor<T> implements SimpleOnDragListener.DragProcess
Log.d(String.valueOf(dragButton.getId()), "History on drag event start: " + dragDirection);
assert dragButton instanceof DirectionDragButton;
String actionText = ((DirectionDragButton) dragButton).getDirectionText(dragDirection);
if (!StringUtils.isEmpty(actionText)) {
try {
result = true;
final HistoryAction historyAction;
if ( dragDirection == DragDirection.up ) {
historyAction = HistoryAction.undo;
} else if ( dragDirection == DragDirection.down ) {
historyAction = HistoryAction.redo;
} else {
historyAction = null;
}
final HistoryAction historyAction = HistoryAction.valueOf(actionText);
historyControl.doHistoryAction(historyAction);
} catch (IllegalArgumentException e) {
Log.e(String.valueOf(dragButton.getId()), "Unsupported history action: " + actionText);
}
if (historyAction != null) {
result = true;
historyControl.doHistoryAction(historyAction);
}
return result;