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

Commit f5610c23 authored by Galia Peycheva's avatar Galia Peycheva Committed by Automerger Merge Worker
Browse files

Merge "Override DreamActivity enter and exit animations" into rvc-dev am: 1255a2d2 am: ca823fb5

Change-Id: Ib6263421a5aa69a53cca223f1d4124e6acaef107
parents 0c8df1e9 ca823fb5
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@ import android.app.Activity;
import android.os.Bundle;
import android.view.WindowInsets;

import com.android.internal.R;

/**
 * The Activity used by the {@link DreamService} to draw screensaver content
 * on the screen. This activity runs in dream application's process, but is started by a
@@ -56,8 +58,20 @@ public class DreamActivity extends Activity {
        if (callback != null) {
            callback.onActivityCreated(this);
        }
    }

    @Override
    public void onResume() {
        super.onResume();
        // Hide all insets (nav bar, status bar, etc) when the dream is showing
        getWindow().getInsetsController().hide(WindowInsets.Type.systemBars());
        overridePendingTransition(R.anim.dream_activity_open_enter,
                                  R.anim.dream_activity_open_exit);
    }

    @Override
    public void finishAndRemoveTask() {
        super.finishAndRemoveTask();
        overridePendingTransition(0, R.anim.dream_activity_close_exit);
    }
}
+0 −1
Original line number Diff line number Diff line
@@ -1052,7 +1052,6 @@ public class DreamService extends Service implements Window.Callback {
        mWindow.requestFeature(Window.FEATURE_NO_TITLE);

        WindowManager.LayoutParams lp = mWindow.getAttributes();
        lp.windowAnimations = com.android.internal.R.style.Animation_Dream;
        lp.flags |= (WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
                    | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR
                    | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/* Copyright 2020, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->

<alpha xmlns:android="http://schemas.android.com/apk/res/android"
    android:fromAlpha="1.0"
    android:toAlpha="0.0"
    android:duration="100" />
+26 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/* Copyright 2020, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->

<!-- During this animation we keep the previous activity on the screen
using a noop animation for it (dream_activity_open_exit). The duration of
those two has to be the same. -->
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
    android:fromAlpha="0.0"
    android:toAlpha="1.0"
    android:duration="1000" />
+25 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/* Copyright 2020, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->

<!-- A noop animation to keep the previous activity alive during the dream
enter animation. The duration should match the duration of the
dream_activity_open_enter animation. -->
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
    android:fromAlpha="1.0"
    android:toAlpha="1.0"
    android:duration="1000" />
Loading