1 /* 2 * Copyright (C) 2024 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.systemui.animation.shared; 18 19 import android.window.RemoteTransition; 20 21 /** 22 * An interface for an app to link a launch transition and a return transition together into an 23 * origin transition. 24 */ 25 interface IOriginTransitions { 26 27 /** 28 * Create a new "origin transition" which wraps a launch transition and a return transition. 29 * The returned {@link RemoteTransition} is expected to be passed to 30 * {@link ActivityOptions#makeRemoteTransition(RemoteTransition)} to create an 31 * {@link ActivityOptions} and being used to launch an intent. When being used with 32 * {@link ActivityOptions}, the launch transition will be triggered for launching the intent, 33 * and the return transition will be remembered and triggered for returning from the launched 34 * activity. 35 */ makeOriginTransition(in RemoteTransition launchTransition, in RemoteTransition returnTransition)36 RemoteTransition makeOriginTransition(in RemoteTransition launchTransition, 37 in RemoteTransition returnTransition) = 1; 38 39 /** 40 * Cancels an origin transition. Any parts not yet played will no longer be triggered, and the 41 * origin transition object will reset to a single frame animation. 42 */ 43 void cancelOriginTransition(in RemoteTransition originTransition) = 2; 44 } 45