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

Commit 7466cdee authored by Yi-Ling Chuang's avatar Yi-Ling Chuang
Browse files

Update SettingsTransitionHelper

Add version control for the helper.

Bug: 177480673
Test: rebuild and test Settings
Change-Id: I0a61b29fa7b8460206b1fdfef128f902d74ffd0a
parent f7923a9c
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2021 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
  -->

<pathInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
    android:pathData="M 0,0 C 0.05, 0, 0.133333, 0.06, 0.166666, 0.4 C 0.208333, 0.82, 0.25, 1, 1, 1"/>
+9 −2
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@ import android.view.Window;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;

import androidx.core.os.BuildCompat;

import com.google.android.material.transition.platform.MaterialSharedAxis;
import com.google.android.material.transition.platform.SlideDistanceProvider;

@@ -47,8 +49,7 @@ public class SettingsTransitionHelper {
        transition.setDuration(DURATION);

        final Interpolator interpolator =
                AnimationUtils.loadInterpolator(context,
                        android.R.interpolator.fast_out_extra_slow_in);
                AnimationUtils.loadInterpolator(context, R.interpolator.fast_out_extra_slow_in);
        transition.setInterpolator(interpolator);

        // TODO(b/177480673): Update fade through threshold once (cl/362065364) is released
@@ -64,6 +65,9 @@ public class SettingsTransitionHelper {
     * triggered when the page is launched/entering.
     */
    public static void applyForwardTransition(Activity activity) {
        if (!BuildCompat.isAtLeastS()) {
            return;
        }
        if (activity == null) {
            Log.w(TAG, "applyForwardTransition: Invalid activity!");
            return;
@@ -87,6 +91,9 @@ public class SettingsTransitionHelper {
     * previously-started Activity.
     */
    public static void applyBackwardTransition(Activity activity) {
        if (!BuildCompat.isAtLeastS()) {
            return;
        }
        if (activity == null) {
            Log.w(TAG, "applyBackwardTransition: Invalid activity!");
            return;