From 1fda7d619e13e79acf9d767352b7bcd9e64288a0 Mon Sep 17 00:00:00 2001 From: Sergey Solovyev Date: Thu, 18 Jul 2013 17:53:44 +0400 Subject: [PATCH] correct versions in release notes --- android-app-core/res/values-de/text_about.xml | 4 +- .../res/values-de/text_strings.xml | 2 +- .../res/values/text_release_notes.xml | 39 +++++++++++++++++++ .../about/CalculatorReleaseNotesFragment.java | 35 +++++++++++++---- 4 files changed, 69 insertions(+), 11 deletions(-) diff --git a/android-app-core/res/values-de/text_about.xml b/android-app-core/res/values-de/text_about.xml index b149164c..1ba794b6 100644 --- a/android-app-core/res/values-de/text_about.xml +++ b/android-app-core/res/values-de/text_about.xml @@ -15,8 +15,8 @@ Wenn die Anwendung Ihnen gefäll\nbewerten Sie es bitte mit 5 Sterne auf\n Diese Anwendung nutzt folgende Open-Source-Bibliotheken:\n Simple (XML Serialization)\n JSCL - Dieser App wird ins Deutsche von E.Bazhenova übersetzt - + Dieser App wird ins Deutsche von folgenden Personen übersetzt: + E.Bazhenova Release Notizen "Release Notes für Version " http://www.facebook.com/calculatorpp diff --git a/android-app-core/res/values-de/text_strings.xml b/android-app-core/res/values-de/text_strings.xml index e6d2b2d3..a8b15c4c 100644 --- a/android-app-core/res/values-de/text_strings.xml +++ b/android-app-core/res/values-de/text_strings.xml @@ -19,7 +19,7 @@ Nach unten Nach oben Neustart - rückgängigmachen + aufheben wiederholen C diff --git a/android-app-core/res/values/text_release_notes.xml b/android-app-core/res/values/text_release_notes.xml index ed2cba67..5fa9fdca 100644 --- a/android-app-core/res/values/text_release_notes.xml +++ b/android-app-core/res/values/text_release_notes.xml @@ -22,6 +22,7 @@ + 1.1.4 1. Haptic feedback\n 2. Two layouts: calculator and cellphone\n @@ -29,12 +30,14 @@ 4. ERROR message is not so often now + 1.1.5 1. Screen with all functions\n 2. Added support for decimal logarithm, factorial, comparison functions\n 3. Haptic feedback duration preference + 1.1.6 1. Saving constants in two clicks (use +π button)\n 2. Result size is auto adjusted to fill all spare space\n @@ -43,6 +46,7 @@ 5. Degrees added (use °: e.g. 30° and result will be converted into radians) + 1.1.7 1. Support for entering numbers in scientific notation (2.3E2)\n 2. Added functions: deg(), rad() to convert from radians to degrees and vice versa\n @@ -53,11 +57,13 @@ 6. Fixed bug with displaying result + 1.1.8 1. Fixed bug with i^3\n 2. Fixed crash in case of many brackets + 1.1.9 1. Percentage calculations.\n Examples:\n @@ -70,6 +76,7 @@ 100+50%^2=2600, but 100+50^2%=101.08 + 1.1.12 1. Help screen added\n 2. Support for differentiation, integration, calculation of sum and product.\n @@ -81,11 +88,13 @@ ∫ab(x, x, 0, 10)=50.0 + 1.1.13 1. Fixed crashes\n 2. Added variables on the main screen + 1.1.14 1. Support for different angle units: radians, degrees, gradians, turns\n 2. Easy toggling between radians and degrees: use the toggle switch located on the 6 button\n @@ -93,12 +102,14 @@ 4. Fixed bug with simplification of √(π^2) + 1.1.15 1. Added functions\' plotting: type expression which contains 1 undefined variable (e.g. cos(t)) and click on the result. In the context menu choose \'Plot graph\'. Supported features: zoom in/out, moving graph, plotting imaginary part + 1.1.16 1. Buttons swipe preference\n 2. Added support for different numeral bases (currently supported: dec, bin, oct). Dec and bin can be chosen @@ -107,6 +118,7 @@ 4. Performance improvements in functions\' plotting + 1.2.20 1. New swipe actions (left, right)\n 2. Extended history: save, remove, copy, use from history screen (use long click for additional actions)\n @@ -117,6 +129,7 @@ 6. Bug fixes: correct double factorial calculation, 20x fix, e^(pi*i)+1 fix and others + 1.2.21 1. Release notes screen added\n 2. Added categories in functions and constants screens\n @@ -127,17 +140,20 @@ 6. Variant of π constant independent from angle units + 1.2.22 1. Fix for missing cursor in Android 3 and higher\n 2. Fix for substituting 3.14... with Π constant + 1.2.23 1. Fix for calculating inverse trigonometric functions in complex field\n 2. Removed time delay for calculation\n 3. Fix the problem with 200 - 10% = π + 1.2.24 Note from developer\n\n Sorry to inform you but this version of application brings built-in ads.\n @@ -153,6 +169,7 @@ or help to translate the application to your native language. + 1.2.25 1. Integration of ln() and lg()\n 2. Last opened tab is remembered now (history, variables etc)\n @@ -162,6 +179,7 @@ 6. Double zero (00) key + 1.2.26 1. Integration of trigonometric functions is disabled for not radian angles\n 2. Bug with 1/0 = -1/0 fixed\n @@ -169,6 +187,7 @@ 4. Other small fixes + 1.2.27 Note from developer:\n\n I\'m glad to inform you that I\'ve started a forum for Calculator++: http://facebook.com/calculatorpp.\n @@ -182,6 +201,7 @@ 5. Other small fixes + 1.2.28 1. New Metro theme with 3 color variations (old themes are still available)\n 2. Simple layout (Default layout is still scientific)\n @@ -195,6 +215,7 @@ 10. Billing problems fixes + 1.2.31 1. Ukrainian localization (Андрій Бандура)\n 2. HEX digits are not shown in not HEX mode\n @@ -207,12 +228,14 @@ 9. Wrong lg() integration and differentiation fixed + 1.2.34 1. Virtual keyboard are now not shown on Android 4 ICS\n 2. Fast number conversion from display context menu\n 3. Minor GUI fixes + 1.4.0 1. We are now on Facebook: facebook.com/calculatorpp\n 2. Tablet support (new awesome UI)\n @@ -223,17 +246,20 @@ 7. Chinese translations + 1.4.1 1. UI improvements for 4-7 inches displays\n 2. Ans variable (last calculated value) + 1.4.2 1. Calculator++ widget for home screen (works only if app installed in phone memory)\n 2. Mobile phone layout for tablets (Preferences->Appearance Preferences->Layout->Scientific (Mobile))\n 3. Manual calculations (Preferences->Calculations Preferences->Result is calculated…) + 1.4.4 1. Support for user-defined functions (see +f button or + button inside functions screen)\n 2. Widget in different sizes: 3x3, 3x4, 4x4, 4x5\n @@ -244,17 +270,20 @@ 7. Bug fixes + 1.5.1 1. Calculator in separate window\n 2. UI is fixed for some devices + 1.5.2 1. Possibility to remove icon for Calculator++ in separate window\n 2. Fixed some crashes (editing, plotting)\n 3. Fixed flicker for Calculator++ in separate window + 1.6.2 1. Graph plotter completely reworked\n 2. Added support for graphing several functions\n @@ -264,4 +293,14 @@ 6. Other fixes + 2.0.0 + + 1. German and Polish translations\n + 2. Wizard\n + 3. Graph improvements\n + 4. Asin(i) problem fix\n + 5. Greek letters for variable names\n + 6. Other fixes + + \ No newline at end of file diff --git a/android-app/src/main/java/org/solovyev/android/calculator/about/CalculatorReleaseNotesFragment.java b/android-app/src/main/java/org/solovyev/android/calculator/about/CalculatorReleaseNotesFragment.java index dcd8aaf2..029559a7 100644 --- a/android-app/src/main/java/org/solovyev/android/calculator/about/CalculatorReleaseNotesFragment.java +++ b/android-app/src/main/java/org/solovyev/android/calculator/about/CalculatorReleaseNotesFragment.java @@ -28,16 +28,16 @@ import android.text.Html; import android.text.method.LinkMovementMethod; import android.view.View; import android.widget.TextView; - -import javax.annotation.Nonnull; - -import org.solovyev.android.Android; import org.solovyev.android.calculator.CalculatorApplication; import org.solovyev.android.calculator.CalculatorFragment; import org.solovyev.android.calculator.CalculatorFragmentType; import org.solovyev.android.calculator.R; import org.solovyev.common.text.Strings; +import javax.annotation.Nonnull; + +import static org.solovyev.android.Android.getAppVersionCode; + /** * User: serso * Date: 12/25/11 @@ -69,13 +69,14 @@ public class CalculatorReleaseNotesFragment extends CalculatorFragment { final StringBuilder result = new StringBuilder(); final String releaseNotesForTitle = context.getString(R.string.c_release_notes_for_title); - final int version = Android.getAppVersionCode(context); + final int currentVersionCode = getAppVersionCode(context); final TextHelper textHelper = new TextHelper(context.getResources(), CalculatorApplication.class.getPackage().getName()); boolean first = true; - for (int i = version; i >= minVersion; i--) { - String releaseNotesForVersion = textHelper.getText("c_release_notes_for_" + i); + for (int versionCode = currentVersionCode; versionCode >= minVersion; versionCode--) { + final String versionName = getVersionName(textHelper, versionCode); + String releaseNotesForVersion = textHelper.getText(makeReleaseNotesResourceId(versionCode)); if (!Strings.isEmpty(releaseNotesForVersion)) { assert releaseNotesForVersion != null; if (!first) { @@ -84,11 +85,29 @@ public class CalculatorReleaseNotesFragment extends CalculatorFragment { first = false; } releaseNotesForVersion = releaseNotesForVersion.replace("\n", "
"); - result.append("").append(releaseNotesForTitle).append(i).append("

"); + result.append("").append(releaseNotesForTitle).append(versionName).append("

"); result.append(releaseNotesForVersion); } } return result.toString(); } + + @Nonnull + private static String getVersionName(@Nonnull TextHelper textHelper, int versionCode) { + final String versionName = textHelper.getText(makeVersionResourceId(versionCode)); + if (versionName != null) { + return versionName; + } else { + return String.valueOf(versionCode); + } + } + + private static String makeReleaseNotesResourceId(int versionCode) { + return "c_release_notes_for_" + versionCode; + } + + private static String makeVersionResourceId(int versionCode) { + return "c_release_notes_for_" + versionCode + "_version"; + } }