fixable message removed

This commit is contained in:
Solovyev_S 2013-07-01 11:31:06 +04:00
parent cd2f43bb43
commit 5518a38f16
4 changed files with 0 additions and 26 deletions

View File

@ -345,7 +345,6 @@
<string name="cpp_onscreen_remove_icon_message">Вы можете удалить вторую иконку Калькулятора++ из списка приложений
из настроек или нажав следующую кнопку
</string>
<string name="cpp_onscreen_remove_icon_button_text">Удалить иконку</string>
<string name="cpp_this_change_may_require_reboot">Это изменение может потребовать перезагрузки</string>
<string name="cpp_plot_2d">2D график</string>

View File

@ -336,7 +336,6 @@
<string name="cpp_onscreen_remove_icon_message">You can remove second icon in applications\' list from application
settings or by pressing next button
</string>
<string name="cpp_onscreen_remove_icon_button_text">Remove icon</string>
<string name="cpp_this_change_may_require_reboot">This change may require reboot</string>
<string name="cpp_plot_2d">2D plot</string>

View File

@ -58,7 +58,6 @@ public final class CalculatorPreferences {
public static class OnscreenCalculator {
public static final Preference<Boolean> startOnBoot = BooleanPreference.of("onscreen_start_on_boot", false);
public static final Preference<Boolean> showAppIcon = BooleanPreference.of("onscreen_show_app_icon", true);
public static final Preference<Boolean> removeIconDialogShown = BooleanPreference.of("onscreen_remove_icon_dialog_shown", false);
}
public static class Calculations {

View File

@ -46,31 +46,8 @@ public class CalculatorOnscreenStartActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (Android.isComponentEnabled(this, CalculatorOnscreenStartActivity.class)) {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
if (!CalculatorPreferences.OnscreenCalculator.removeIconDialogShown.getPreference(prefs)) {
FixableMessagesDialog.showDialog(Arrays.asList(new FixableMessage(getString(R.string.cpp_onscreen_remove_icon_message), MessageType.warning, new RemoveIconFixableError(this))), this, false);
CalculatorPreferences.OnscreenCalculator.removeIconDialogShown.putPreference(prefs, true);
}
}
CalculatorOnscreenService.showOnscreenView(this);
this.finish();
}
public static class RemoveIconFixableError extends AbstractFixableError {
public RemoveIconFixableError(@Nonnull Context context) {
super(context.getString(R.string.cpp_onscreen_remove_icon_button_text));
}
@Override
public void fix() {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(App.getApplication());
CalculatorPreferences.OnscreenCalculator.showAppIcon.putPreference(prefs, false);
}
}
}