Disable animations in material bottom sheet

This commit is contained in:
PavelRatushny 2017-08-29 16:24:03 +03:00
parent bea7e18357
commit 8c234f64f3
2 changed files with 9 additions and 0 deletions

View file

@ -390,6 +390,11 @@
<!-- Dialog popup -->
<style name="Animations"/>
<style name="Animations.NoAnimation">
<item name="@android:windowEnterAnimation">@null</item>
<item name="@android:windowExitAnimation">@null</item>
</style>
<!-- PopDownMenu -->
<style name="Animations.PopDownMenu"/>

View file

@ -11,6 +11,7 @@ import android.view.ContextThemeWrapper;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
@ -43,6 +44,9 @@ public class SnapToRoadBottomSheetDialogFragment extends android.support.design.
@Override
public void setupDialog(Dialog dialog, int style) {
super.setupDialog(dialog, style);
if (getMyApplication().getSettings().DO_NOT_USE_ANIMATIONS.get()) {
dialog.getWindow().setWindowAnimations(R.style.Animations_NoAnimation);
}
nightMode = getMyApplication().getDaynightHelper().isNightModeForMapControls();
portrait = AndroidUiHelper.isOrientationPortrait(getActivity());