translations added

This commit is contained in:
serso 2011-09-27 17:04:32 +04:00
parent 90fb6cf109
commit fca272dc49
5 changed files with 36 additions and 24 deletions

View File

@ -50,7 +50,7 @@
a:scrollbars="none"/>
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/clearButton"
a:text="clear"
a:text="@string/c_clear"
a:layout_weight="1.5"
style="@style/control_button_style"
a:onClick="clearButtonClickHandler"/>
@ -67,11 +67,16 @@
<LinearLayout a:layout_weight="1" a:layout_width="match_parent" a:layout_height="0dp">
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/oneDigitButton" a:text="1" calc:textUp="sin"
calc:textDown="asin" style="@style/digit_button_style"
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/oneDigitButton"
a:text="1"
calc:textUp="sin"
calc:textDown="asin"
style="@style/digit_button_style"
a:onClick="digitButtonClickHandler"/>
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/twoDigitButton" a:text="2" calc:textUp="cos"
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/twoDigitButton"
a:text="2"
calc:textUp="cos"
calc:textDown="acos" style="@style/digit_button_style"
a:onClick="digitButtonClickHandler"/>
@ -96,7 +101,7 @@
a:onClick="numericButtonClickHandler"/>
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/pasteButton"
a:text="paste"
a:text="@string/c_paste"
style="@style/control_button_style"
a:onClick="pasteButtonClickHandler"/>
@ -141,8 +146,8 @@
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/historyButton"
a:text=""
calc:textUp="undo"
calc:textDown="redo"
calc:textUp="@string/c_undo"
calc:textDown="@string/c_redo"
style="@style/control_button_style"/>
</LinearLayout>

View File

@ -66,7 +66,7 @@
a:onClick="digitButtonClickHandler"/>
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/clearButton"
a:text="clear"
a:text="@string/c_clear"
style="@style/control_button_style"
a:onClick="clearButtonClickHandler"/>
@ -131,7 +131,7 @@
a:onClick="digitButtonClickHandler"/>
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/pasteButton"
a:text="paste"
a:text="@string/c_paste"
style="@style/control_button_style"
a:onClick="pasteButtonClickHandler"/>
@ -165,8 +165,8 @@
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/historyButton"
a:text=""
calc:textUp="undo"
calc:textDown="redo"
calc:textUp="@string/c_undo"
calc:textDown="@string/c_redo"
style="@style/control_button_style"/>
</LinearLayout>

View File

@ -17,9 +17,15 @@
<string name="c_down">Down</string>
<string name="c_up">Up</string>
<string name="c_restart">Restart</string>
<!--ABOUT ACTIVITY-->
<string name="c_copyright">Copyright (c) 2009-2011.\nCreated by serso aka se.solovyev.\n
For more information please\ncontact me via email\n<a href="mailto:se.solovyev@gmail.com">se.solovyev@gmail.com</a>
\nor visit\n<a href="http://se.solovyev.org">http://se.solovyev.org</a>
</string>
<string name="c_undo">undo</string>
<string name="c_redo">redo</string>
<string name="c_clear">clear</string>
<string name="c_paste">paste</string>
</resources>

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 = HistoryAction.valueOf(actionText);
historyControl.doHistoryAction(historyAction);
} catch (IllegalArgumentException e) {
Log.e(String.valueOf(dragButton.getId()), "Unsupported history action: " + actionText);
final HistoryAction historyAction;
if ( dragDirection == DragDirection.up ) {
historyAction = HistoryAction.undo;
} else if ( dragDirection == DragDirection.down ) {
historyAction = HistoryAction.redo;
} else {
historyAction = null;
}
if (historyAction != null) {
result = true;
historyControl.doHistoryAction(historyAction);
}
return result;