New release notes

This commit is contained in:
serso 2016-04-10 23:58:19 +02:00
parent 13e7a5f9fe
commit c51f3043bc
3 changed files with 50 additions and 44 deletions

View File

@ -14,9 +14,9 @@ public final class ReleaseNotes {
private static final SparseArray<ReleaseNote> map = new SparseArray<>(); private static final SparseArray<ReleaseNote> map = new SparseArray<>();
static { static {
map.put(118, ReleaseNote.make("2.0.0", R.string.c_release_notes_for_118)); map.put(141, ReleaseNote.make("2.1.2", R.string.cpp_release_notes_141));
map.put(141, ReleaseNote.make("2.1.2", R.string.c_release_notes_for_141)); map.put(143, ReleaseNote.make("2.1.4", R.string.cpp_release_notes_143));
map.put(143, ReleaseNote.make("2.1.4", R.string.c_release_notes_for_143)); map.put(148, ReleaseNote.make("2.2.1", R.string.cpp_release_notes_148));
} }
@Nonnull @Nonnull
@ -33,7 +33,7 @@ public final class ReleaseNotes {
@Nonnull @Nonnull
public static String getReleaseNoteDescription(@Nonnull Context context, int version) { public static String getReleaseNoteDescription(@Nonnull Context context, int version) {
final ReleaseNote releaseNote = map.get(version); final ReleaseNote releaseNote = map.get(version);
return releaseNote == null ? "" : context.getString(releaseNote.description); return releaseNote == null ? "" : getDescription(context, releaseNote.description);
} }
@Nonnull @Nonnull
@ -54,8 +54,7 @@ public final class ReleaseNotes {
} else { } else {
first = false; first = false;
} }
final String description = context.getResources().getString(releaseNote.description); final String descriptionHtml = getDescription(context, releaseNote.description);
final String descriptionHtml = description.replace("\n", "<br/>");
result.append("<b>").append(releaseNotesForTitle).append(releaseNote.versionName).append("</b><br/><br/>"); result.append("<b>").append(releaseNotesForTitle).append(releaseNote.versionName).append("</b><br/><br/>");
result.append(descriptionHtml); result.append(descriptionHtml);
} }
@ -63,6 +62,11 @@ public final class ReleaseNotes {
return result.toString(); return result.toString();
} }
@Nonnull
private static String getDescription(@Nonnull Context context, int description) {
return context.getResources().getString(description).replace("\n", "<br/>");
}
@Nonnull @Nonnull
public static List<Integer> getReleaseNotesVersions(@Nonnull Context context, int minVersion) { public static List<Integer> getReleaseNotesVersions(@Nonnull Context context, int minVersion) {
final List<Integer> releaseNotes = new ArrayList<>(); final List<Integer> releaseNotes = new ArrayList<>();

View File

@ -22,25 +22,26 @@
<resources> <resources>
<string name="c_release_notes_for_118"> <string name="cpp_release_notes_141">
★ Немецкий и польский языки\n
★ Визард\n
★ Улучшения графопостроителя\n
★ Исправлена пролема с Asin(i)\n
★ Греческие буквы для названий переменных\n
★ Другие исправления и улучшения
</string>
<string name="c_release_notes_for_141">
★ Улучшен ввод жестами\n ★ Улучшен ввод жестами\n
★ Быстрое удаление текста при долгом нажатии кнопки "Удалить"\n ★ Быстрое удаление текста при долгом нажатии кнопки "Удалить"\n
★ Кнопка "Равно" копирует результат в поле ввода ★ Кнопка "Равно" копирует результат в поле ввода
</string> </string>
<string name="c_release_notes_for_143"> <string name="cpp_release_notes_143">
★ Язык приложения может быть изменён в настройках\n ★ Язык приложения может быть изменён в настройках\n
★ Темы для калькулятора в отдельном окне\n ★ Темы для калькулятора в отдельном окне\n
★ Темы для виджета на рабочий стол ★ Темы для виджета на рабочий стол
</string> </string>
<string name="cpp_release_notes_148">
★ Новый графопостроитель\n
★ Улучшенный пользовательский интерфейс: главный и второстепенные экраны, диалоги, меню и т.д.\n
★ Переделанный переводчик величин\n
★ Кнопка Память (MC, M+, M-, M)\n
★ Плавающий калькулятор для Андроид М\n
★ Автосохранение недавней истории\n
★ Приложение быстрее запускается и потребляет меньше памяти
</string>
</resources> </resources>

View File

@ -22,27 +22,28 @@
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation"> <resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
<string name="c_release_notes_for_118"> <string name="cpp_release_notes_141">
★ German and Polish translations\n
★ Wizard\n
★ Graph improvements\n
★ Asin(i) problem fix\n
★ Greek letters for variable names\n
★ Other fixes
</string>
<string name="c_release_notes_for_141">
★ Improved button gesture detection\n ★ Improved button gesture detection\n
★ Fast text removal by long pressing "Erase" button\n ★ Fast text removal by long pressing "Erase" button\n
★ "Equals" button now copies result to the editor\n ★ "Equals" button now copies result to the editor\n
★ Various bugfixes, stability and usability improvements ★ Various bugfixes, stability and usability improvements
</string> </string>
<string name="c_release_notes_for_143"> <string name="cpp_release_notes_143">
★ App language can be changed in settings\n ★ App language can be changed in settings\n
★ Floating calculator themes\n ★ Floating calculator themes\n
★ Widget themes\n ★ Widget themes\n
★ Various bugfixes, stability and usability improvements ★ Various bugfixes, stability and usability improvements
</string> </string>
<string name="cpp_release_notes_148">
★ New graph plotter\n
★ Improved user interface: main and additional screens, dialogs, menus, etc\n
★ Redesigned unit converter\n
★ Memory button (MC, M+, M-, M)\n
★ Floating calculator for Android M\n
★ Auto-save of recent history\n
★ Faster start-ups, less memory consumption
</string>
</resources> </resources>