/* * Copyright 2019 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 * * https://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. */ package com.google.android.material.transition; import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP; import android.content.Context; import android.os.Build.VERSION_CODES; import androidx.annotation.IntDef; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.RequiresApi; import androidx.annotation.RestrictTo; import android.transition.Transition; import android.transition.TransitionSet; import android.view.Gravity; import com.google.android.material.animation.AnimationUtils; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * A {@link TransitionSet} that provides shared motion along an axis. * *
When configured along the {@link #X} axis, this transition slides and fades in the target when * appearing and slides and fades out the target when disappearing. * *
When configured along the {@link #Y} axis, this transition slides and fades in the target when * appearing and slides and fades out the target when disappearing. * *
When configured along the {@link #Z} axis, this transition scales and fades in when the target * is appearing and scales and fades out when the target is disappearing. * *
The direction of the slide or scale is determined by the {@link #create(Context, int,
* boolean)} method's forward property. When true, the target will slide to the left on the X axis,
* up on the Y axis and out in on the Z axis. When false, the target will slide to the right on the
* X axis, down on the Y axis and in on the Z axis. Note that this is independent of whether or not
* the target is appearing or disappearing.
*/
@RequiresApi(VERSION_CODES.LOLLIPOP)
public class MaterialSharedAxis extends MaterialTransitionSet