fixable message removed
This commit is contained in:
parent
cd2f43bb43
commit
5518a38f16
@ -345,7 +345,6 @@
|
|||||||
<string name="cpp_onscreen_remove_icon_message">Вы можете удалить вторую иконку Калькулятора++ из списка приложений
|
<string name="cpp_onscreen_remove_icon_message">Вы можете удалить вторую иконку Калькулятора++ из списка приложений
|
||||||
из настроек или нажав следующую кнопку
|
из настроек или нажав следующую кнопку
|
||||||
</string>
|
</string>
|
||||||
<string name="cpp_onscreen_remove_icon_button_text">Удалить иконку</string>
|
|
||||||
<string name="cpp_this_change_may_require_reboot">Это изменение может потребовать перезагрузки</string>
|
<string name="cpp_this_change_may_require_reboot">Это изменение может потребовать перезагрузки</string>
|
||||||
|
|
||||||
<string name="cpp_plot_2d">2D график</string>
|
<string name="cpp_plot_2d">2D график</string>
|
||||||
|
@ -336,7 +336,6 @@
|
|||||||
<string name="cpp_onscreen_remove_icon_message">You can remove second icon in applications\' list from application
|
<string name="cpp_onscreen_remove_icon_message">You can remove second icon in applications\' list from application
|
||||||
settings or by pressing next button
|
settings or by pressing next button
|
||||||
</string>
|
</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_this_change_may_require_reboot">This change may require reboot</string>
|
||||||
|
|
||||||
<string name="cpp_plot_2d">2D plot</string>
|
<string name="cpp_plot_2d">2D plot</string>
|
||||||
|
@ -58,7 +58,6 @@ public final class CalculatorPreferences {
|
|||||||
public static class OnscreenCalculator {
|
public static class OnscreenCalculator {
|
||||||
public static final Preference<Boolean> startOnBoot = BooleanPreference.of("onscreen_start_on_boot", false);
|
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> 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 {
|
public static class Calculations {
|
||||||
|
@ -46,31 +46,8 @@ public class CalculatorOnscreenStartActivity extends Activity {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(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);
|
CalculatorOnscreenService.showOnscreenView(this);
|
||||||
|
|
||||||
this.finish();
|
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user