From fa8a8a54f7e9eeddc007545979a08b54f0290998 Mon Sep 17 00:00:00 2001 From: Sergey Solovyev Date: Tue, 27 Sep 2011 17:04:32 +0400 Subject: [PATCH] translations added --- res/layout-land/main.xml | 23 +++++++++++-------- res/layout-port/main.xml | 8 +++---- res/values/strings.xml | 6 +++++ .../android/calculator/CalculatorView.java | 2 +- .../view/widgets/HistoryDragProcessor.java | 21 +++++++++-------- 5 files changed, 36 insertions(+), 24 deletions(-) diff --git a/res/layout-land/main.xml b/res/layout-land/main.xml index 53f8beb6..935ce95d 100644 --- a/res/layout-land/main.xml +++ b/res/layout-land/main.xml @@ -50,7 +50,7 @@ a:scrollbars="none"/> @@ -67,12 +67,17 @@ - + - @@ -141,8 +146,8 @@ diff --git a/res/layout-port/main.xml b/res/layout-port/main.xml index 2e7241eb..0bc2fdd9 100644 --- a/res/layout-port/main.xml +++ b/res/layout-port/main.xml @@ -66,7 +66,7 @@ a:onClick="digitButtonClickHandler"/> @@ -131,7 +131,7 @@ a:onClick="digitButtonClickHandler"/> @@ -165,8 +165,8 @@ diff --git a/res/values/strings.xml b/res/values/strings.xml index e85e9973..5c087d69 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -17,9 +17,15 @@ Down Up Restart + Copyright (c) 2009-2011.\nCreated by serso aka se.solovyev.\n For more information please\ncontact me via email\nse.solovyev@gmail.com \nor visit\nhttp://se.solovyev.org + + undo + redo + clear + paste diff --git a/src/main/java/org/solovyev/android/calculator/CalculatorView.java b/src/main/java/org/solovyev/android/calculator/CalculatorView.java index 2824c692..8c929e9e 100644 --- a/src/main/java/org/solovyev/android/calculator/CalculatorView.java +++ b/src/main/java/org/solovyev/android/calculator/CalculatorView.java @@ -72,7 +72,7 @@ public class CalculatorView implements CursorControl, HistoryControl 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;