Disable animation in drawer

This commit is contained in:
PavelRatushny 2017-08-28 17:29:57 +03:00
parent 94e916b16f
commit c7ebe9e979
4 changed files with 14 additions and 2 deletions

View file

@ -9,6 +9,8 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
<string name="do_not_use_animations">Do not use animations</string>
<string name="do_not_use_animations_descr">It disables animations in app</string>
<string name="keep_showing_on_map">Keep showing on map</string>
<string name="exit_without_saving">Exit without saving?</string>
<string name="line">Line</string>

View file

@ -885,6 +885,7 @@ public class OsmandSettings {
public final OsmandPreference<Boolean> USE_KALMAN_FILTER_FOR_COMPASS = new BooleanPreference("use_kalman_filter_compass", true).makeGlobal().cache();
public final OsmandPreference<Boolean> DO_NOT_SHOW_STARTUP_MESSAGES = new BooleanPreference("do_not_show_startup_messages", false).makeGlobal().cache();
public final OsmandPreference<Boolean> DO_NOT_USE_ANIMATIONS = new BooleanPreference("do_not_use_animations", false).makeGlobal().cache();
public final OsmandPreference<Boolean> DO_NOT_SEND_ANONYMOUS_APP_USAGE = new BooleanPreference("do_not_send_anonymous_app_usage", false).makeGlobal().cache();

View file

@ -1404,7 +1404,11 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
public void openDrawer() {
mapActions.updateDrawerMenu();
drawerLayout.openDrawer(Gravity.LEFT);
boolean animate = true;
if (settings.DO_NOT_USE_ANIMATIONS.get()) {
animate = false;
}
drawerLayout.openDrawer(Gravity.LEFT, animate);
}
public void disableDrawer() {
@ -1422,7 +1426,11 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
}
public void closeDrawer() {
drawerLayout.closeDrawer(Gravity.LEFT);
boolean animate = true;
if (settings.DO_NOT_USE_ANIMATIONS.get()) {
animate = false;
}
drawerLayout.closeDrawer(Gravity.LEFT, animate);
}
public void toggleDrawer() {

View file

@ -478,6 +478,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity implements OnR
misc.addPreference(createCheckBoxPreference(settings.DO_NOT_SEND_ANONYMOUS_APP_USAGE, R.string.do_not_send_anonymous_app_usage, R.string.do_not_send_anonymous_app_usage_desc));
}
misc.addPreference(createCheckBoxPreference(settings.DO_NOT_SHOW_STARTUP_MESSAGES, R.string.do_not_show_startup_messages, R.string.do_not_show_startup_messages_desc));
misc.addPreference(createCheckBoxPreference(settings.DO_NOT_USE_ANIMATIONS, R.string.do_not_use_animations, R.string.do_not_use_animations_descr));
}