Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit abb63cb6 authored by George Mount's avatar George Mount
Browse files

Activity Transitions: change default behavior.

Bug 15746767

The default for activity transitions with the material theme
should be to enable them when makeSceneTransitionAnimation is
used, but disable them when no ActivityOptions is used.

Change-Id: I4c777a72e4401b367e30b9ba971f7280646d5017
parent a0a0260e
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -3666,11 +3666,7 @@ public class Activity extends ContextThemeWrapper
     * @see #startActivity
     */
    public void startActivityForResult(Intent intent, int requestCode) {
        Bundle options = null;
        if (mWindow.hasFeature(Window.FEATURE_CONTENT_TRANSITIONS)) {
            options = ActivityOptions.makeSceneTransitionAnimation(this).toBundle();
        }
        startActivityForResult(intent, requestCode, options);
        startActivityForResult(intent, requestCode, null);
    }

    /**
@@ -4221,11 +4217,7 @@ public class Activity extends ContextThemeWrapper
     */
    public void startActivityFromFragment(@NonNull Fragment fragment, Intent intent,
            int requestCode) {
        Bundle options = null;
        if (mWindow.hasFeature(Window.FEATURE_CONTENT_TRANSITIONS)) {
            options = ActivityOptions.makeSceneTransitionAnimation(this).toBundle();
        }
        startActivityFromFragment(fragment, intent, requestCode, options);
        startActivityFromFragment(fragment, intent, requestCode, null);
    }

    /**
+2 −1
Original line number Diff line number Diff line
@@ -156,7 +156,7 @@ please see themes_device_defaults.xml.
        <item name="windowTitleStyle">@style/WindowTitle.Material</item>
        <item name="windowTitleSize">@dimen/action_bar_default_height_material</item>
        <item name="windowTitleBackgroundStyle">@style/WindowTitleBackground.Material</item>
        <item name="windowContentTransitions">false</item>
        <item name="windowContentTransitions">true</item>
        <item name="windowAnimationStyle">@style/Animation.Material.Activity</item>
        <item name="windowSoftInputMode">stateUnspecified|adjustUnspecified</item>
        <item name="windowActionBar">true</item>
@@ -521,6 +521,7 @@ please see themes_device_defaults.xml.
        <item name="windowEnterTransition">@transition/fade</item>
        <item name="windowSharedElementEnterTransition">@transition/move</item>
        <item name="windowSharedElementExitTransition">@transition/move</item>
        <item name="windowContentTransitions">true</item>

        <!-- Dialog attributes -->
        <item name="dialogTheme">@style/Theme.Material.Light.Dialog</item>