Add animations for wikivoyage fragments

This commit is contained in:
Alex Sytnyk 2018-04-05 20:08:26 +03:00
parent f0b146db77
commit bd2dce9d96

View file

@ -36,9 +36,12 @@ public class WikivoyageBaseDialogFragment extends BaseOsmAndDialogFragment {
public Dialog onCreateDialog(Bundle savedInstanceState) { public Dialog onCreateDialog(Bundle savedInstanceState) {
int themeId = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme_LightStatusBar; int themeId = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme_LightStatusBar;
Dialog dialog = new Dialog(getContext(), themeId); Dialog dialog = new Dialog(getContext(), themeId);
if (Build.VERSION.SDK_INT >= 21) {
Window window = dialog.getWindow(); Window window = dialog.getWindow();
if (window != null) { if (window != null) {
if (!getMyApplication().getSettings().DO_NOT_USE_ANIMATIONS.get()) {
window.getAttributes().windowAnimations = R.style.Animations_Alpha;
}
if (Build.VERSION.SDK_INT >= 21) {
window.setStatusBarColor(getResolvedColor(getStatusBarColor())); window.setStatusBarColor(getResolvedColor(getStatusBarColor()));
} }
} }