Loading core/java/android/service/dreams/DreamActivity.java +14 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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); } } core/java/android/service/dreams/DreamService.java +0 −1 Original line number Diff line number Diff line Loading @@ -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 Loading core/res/res/anim/dream_activity_close_exit.xml 0 → 100644 +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" /> core/res/res/anim/dream_activity_open_enter.xml 0 → 100644 +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" /> core/res/res/anim/dream_activity_open_exit.xml 0 → 100644 +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
core/java/android/service/dreams/DreamActivity.java +14 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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); } }
core/java/android/service/dreams/DreamService.java +0 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
core/res/res/anim/dream_activity_close_exit.xml 0 → 100644 +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" />
core/res/res/anim/dream_activity_open_enter.xml 0 → 100644 +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" />
core/res/res/anim/dream_activity_open_exit.xml 0 → 100644 +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" />