Add animations for search and markers

This commit is contained in:
PavelRatushny 2017-11-27 11:15:32 +02:00
parent 25d2a29787
commit e02bd51887
5 changed files with 25 additions and 2 deletions

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha android:fromAlpha="0.0" android:toAlpha="1.0"
android:duration="@android:integer/config_shortAnimTime" />
</set>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha android:fromAlpha="1.0" android:toAlpha="0.0"
android:duration="@android:integer/config_shortAnimTime" />
</set>

View file

@ -461,6 +461,11 @@
<item name="android:windowExitAnimation">@anim/slide_out_bottom</item> <item name="android:windowExitAnimation">@anim/slide_out_bottom</item>
</style> </style>
<style name="Animations.Alpha">
<item name="android:windowEnterAnimation">@anim/alpha_in</item>
<item name="android:windowExitAnimation">@anim/alpha_out</item>
</style>
<style name="create_poi_text_field"> <style name="create_poi_text_field">
<item name="android:layout_marginTop">8dp</item> <item name="android:layout_marginTop">8dp</item>
<item name="android:layout_marginRight">16dp</item> <item name="android:layout_marginRight">16dp</item>

View file

@ -78,7 +78,7 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm
@NonNull @NonNull
@Override @Override
public Dialog onCreateDialog(Bundle savedInstanceState) { public Dialog onCreateDialog(Bundle savedInstanceState) {
return new Dialog(getActivity(), getTheme()) { Dialog dialog = new Dialog(getActivity(), getTheme()) {
@Override @Override
public void onBackPressed() { public void onBackPressed() {
if (!dismissOptionsMenuFragment()) { if (!dismissOptionsMenuFragment()) {
@ -86,6 +86,10 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm
} }
} }
}; };
if (!getMyApplication().getSettings().DO_NOT_USE_ANIMATIONS.get()) {
dialog.getWindow().getAttributes().windowAnimations = R.style.Animations_Alpha;
}
return dialog;
} }
@Nullable @Nullable

View file

@ -628,7 +628,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
@NonNull @NonNull
@Override @Override
public Dialog onCreateDialog(Bundle savedInstanceState) { public Dialog onCreateDialog(Bundle savedInstanceState) {
return new Dialog(getActivity(), getTheme()){ Dialog dialog = new Dialog(getActivity(), getTheme()){
@Override @Override
public void onBackPressed() { public void onBackPressed() {
if (!processBackAction()) { if (!processBackAction()) {
@ -636,6 +636,10 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
} }
} }
}; };
if (!getMyApplication().getSettings().DO_NOT_USE_ANIMATIONS.get()) {
dialog.getWindow().getAttributes().windowAnimations = R.style.Animations_Alpha;
}
return dialog;
} }
public void saveCustomFilter() { public void saveCustomFilter() {