translations added
This commit is contained in:
parent
268d3503d3
commit
4426e41df9
@ -50,7 +50,7 @@
|
|||||||
a:scrollbars="none"/>
|
a:scrollbars="none"/>
|
||||||
|
|
||||||
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/clearButton"
|
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/clearButton"
|
||||||
a:text="clear"
|
a:text="@string/c_clear"
|
||||||
a:layout_weight="1.5"
|
a:layout_weight="1.5"
|
||||||
style="@style/control_button_style"
|
style="@style/control_button_style"
|
||||||
a:onClick="clearButtonClickHandler"/>
|
a:onClick="clearButtonClickHandler"/>
|
||||||
@ -67,11 +67,16 @@
|
|||||||
|
|
||||||
<LinearLayout a:layout_weight="1" a:layout_width="match_parent" a:layout_height="0dp">
|
<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"
|
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/oneDigitButton"
|
||||||
calc:textDown="asin" style="@style/digit_button_style"
|
a:text="1"
|
||||||
|
calc:textUp="sin"
|
||||||
|
calc:textDown="asin"
|
||||||
|
style="@style/digit_button_style"
|
||||||
a:onClick="digitButtonClickHandler"/>
|
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"
|
calc:textDown="acos" style="@style/digit_button_style"
|
||||||
a:onClick="digitButtonClickHandler"/>
|
a:onClick="digitButtonClickHandler"/>
|
||||||
|
|
||||||
@ -96,7 +101,7 @@
|
|||||||
a:onClick="numericButtonClickHandler"/>
|
a:onClick="numericButtonClickHandler"/>
|
||||||
|
|
||||||
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/pasteButton"
|
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/pasteButton"
|
||||||
a:text="paste"
|
a:text="@string/c_paste"
|
||||||
style="@style/control_button_style"
|
style="@style/control_button_style"
|
||||||
a:onClick="pasteButtonClickHandler"/>
|
a:onClick="pasteButtonClickHandler"/>
|
||||||
|
|
||||||
@ -141,8 +146,8 @@
|
|||||||
|
|
||||||
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/historyButton"
|
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/historyButton"
|
||||||
a:text=""
|
a:text=""
|
||||||
calc:textUp="undo"
|
calc:textUp="@string/c_undo"
|
||||||
calc:textDown="redo"
|
calc:textDown="@string/c_redo"
|
||||||
style="@style/control_button_style"/>
|
style="@style/control_button_style"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -66,7 +66,7 @@
|
|||||||
a:onClick="digitButtonClickHandler"/>
|
a:onClick="digitButtonClickHandler"/>
|
||||||
|
|
||||||
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/clearButton"
|
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/clearButton"
|
||||||
a:text="clear"
|
a:text="@string/c_clear"
|
||||||
style="@style/control_button_style"
|
style="@style/control_button_style"
|
||||||
a:onClick="clearButtonClickHandler"/>
|
a:onClick="clearButtonClickHandler"/>
|
||||||
|
|
||||||
@ -131,7 +131,7 @@
|
|||||||
a:onClick="digitButtonClickHandler"/>
|
a:onClick="digitButtonClickHandler"/>
|
||||||
|
|
||||||
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/pasteButton"
|
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/pasteButton"
|
||||||
a:text="paste"
|
a:text="@string/c_paste"
|
||||||
style="@style/control_button_style"
|
style="@style/control_button_style"
|
||||||
a:onClick="pasteButtonClickHandler"/>
|
a:onClick="pasteButtonClickHandler"/>
|
||||||
|
|
||||||
@ -165,8 +165,8 @@
|
|||||||
|
|
||||||
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/historyButton"
|
<org.solovyev.android.view.widgets.DirectionDragButton a:id="@+id/historyButton"
|
||||||
a:text=""
|
a:text=""
|
||||||
calc:textUp="undo"
|
calc:textUp="@string/c_undo"
|
||||||
calc:textDown="redo"
|
calc:textDown="@string/c_redo"
|
||||||
style="@style/control_button_style"/>
|
style="@style/control_button_style"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -17,9 +17,15 @@
|
|||||||
<string name="c_down">Down</string>
|
<string name="c_down">Down</string>
|
||||||
<string name="c_up">Up</string>
|
<string name="c_up">Up</string>
|
||||||
<string name="c_restart">Restart</string>
|
<string name="c_restart">Restart</string>
|
||||||
|
|
||||||
<!--ABOUT ACTIVITY-->
|
<!--ABOUT ACTIVITY-->
|
||||||
<string name="c_copyright">Copyright (c) 2009-2011.\nCreated by serso aka se.solovyev.\n
|
<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>
|
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>
|
\nor visit\n<a href="http://se.solovyev.org">http://se.solovyev.org</a>
|
||||||
</string>
|
</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>
|
</resources>
|
||||||
|
@ -72,7 +72,7 @@ public class CalculatorView implements CursorControl, HistoryControl<CalculatorH
|
|||||||
if (!StringUtils.isEmpty(text)) {
|
if (!StringUtils.isEmpty(text)) {
|
||||||
final ClipboardManager clipboard = (ClipboardManager) activity.getSystemService(Activity.CLIPBOARD_SERVICE);
|
final ClipboardManager clipboard = (ClipboardManager) activity.getSystemService(Activity.CLIPBOARD_SERVICE);
|
||||||
clipboard.setText(text);
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,17 +33,18 @@ public class HistoryDragProcessor<T> implements SimpleOnDragListener.DragProcess
|
|||||||
|
|
||||||
Log.d(String.valueOf(dragButton.getId()), "History on drag event start: " + dragDirection);
|
Log.d(String.valueOf(dragButton.getId()), "History on drag event start: " + dragDirection);
|
||||||
|
|
||||||
assert dragButton instanceof DirectionDragButton;
|
final HistoryAction historyAction;
|
||||||
String actionText = ((DirectionDragButton) dragButton).getDirectionText(dragDirection);
|
if ( dragDirection == DragDirection.up ) {
|
||||||
if (!StringUtils.isEmpty(actionText)) {
|
historyAction = HistoryAction.undo;
|
||||||
try {
|
} else if ( dragDirection == DragDirection.down ) {
|
||||||
result = true;
|
historyAction = HistoryAction.redo;
|
||||||
|
} else {
|
||||||
final HistoryAction historyAction = HistoryAction.valueOf(actionText);
|
historyAction = null;
|
||||||
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;
|
return result;
|
||||||
|
Loading…
Reference in New Issue
Block a user