VERSION_CODE constant instead of hard coded number
This commit is contained in:
parent
c410e0f662
commit
15e7b0ee50
@ -6,6 +6,8 @@ import android.support.v4.app.Fragment;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ChooseThemeReleaseNoteStep extends ReleaseNoteStep {
|
||||
public static final int VERSION_CODE = 137;
|
||||
|
||||
public ChooseThemeReleaseNoteStep(Integer version) {
|
||||
super(version);
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import java.util.List;
|
||||
import static org.solovyev.android.Android.getAppVersionCode;
|
||||
|
||||
public final class ReleaseNotes {
|
||||
|
||||
@Nonnull
|
||||
public static String getReleaseNotes(@Nonnull Context context) {
|
||||
return getReleaseNotesString(context, 0);
|
||||
@ -54,8 +55,8 @@ public final class ReleaseNotes {
|
||||
final TextHelper textHelper = new TextHelper(context.getResources(), CalculatorApplication.class.getPackage().getName());
|
||||
|
||||
for (int versionCode = currentVersionCode; versionCode >= minVersion; versionCode--) {
|
||||
if (versionCode == 136) {
|
||||
releaseNotes.add(136);
|
||||
if (versionCode == ChooseThemeReleaseNoteStep.VERSION_CODE) {
|
||||
releaseNotes.add(ChooseThemeReleaseNoteStep.VERSION_CODE);
|
||||
}
|
||||
final String releaseNotesForVersion = textHelper.getText(makeReleaseNotesResourceId(versionCode));
|
||||
if (!Strings.isEmpty(releaseNotesForVersion)) {
|
||||
@ -71,7 +72,7 @@ public final class ReleaseNotes {
|
||||
final TextHelper textHelper = new TextHelper(context.getResources(), CalculatorApplication.class.getPackage().getName());
|
||||
|
||||
for (int versionCode = currentVersionCode; versionCode >= minVersion; versionCode--) {
|
||||
if (versionCode == 136) {
|
||||
if (versionCode == ChooseThemeReleaseNoteStep.VERSION_CODE) {
|
||||
return true;
|
||||
}
|
||||
String releaseNotesForVersion = textHelper.getText(makeReleaseNotesResourceId(versionCode));
|
||||
|
@ -88,7 +88,7 @@ public class CalculatorWizards implements Wizards {
|
||||
|
||||
for (Integer version : versions) {
|
||||
switch (version) {
|
||||
case 136:
|
||||
case ChooseThemeReleaseNoteStep.VERSION_CODE:
|
||||
wizardSteps.add(new ChooseThemeReleaseNoteStep(version));
|
||||
break;
|
||||
default:
|
||||
|
@ -331,5 +331,5 @@
|
||||
<string name="cpp_var_show_greek_keyboard">Показать греческий алфавит</string>
|
||||
<string name="cpp_var_hide_greek_keyboard">Скрыть греческий алфавит</string>
|
||||
<string name="cpp_new_in_version">Новое в версии %1$s</string>
|
||||
<string name="cpp_release_notes_choose_theme">Хотите попробовать новые темы в стиле Material? Выберите их из списка:</string>
|
||||
<string name="cpp_release_notes_choose_theme">Хотите попробовать новые темы в стиле Матириал? Выберите их из списка:</string>
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user