1 /* 2 * Copyright (C) 2023 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.shade.transition 18 19 import android.util.MathUtils 20 import com.android.systemui.animation.ShadeInterpolation 21 import javax.inject.Inject 22 23 /** Interpolator responsible for the shade when in portrait on a large screen. */ 24 internal class LargeScreenPortraitShadeInterpolator @Inject internal constructor() : 25 LargeScreenShadeInterpolator { 26 getBehindScrimAlphanull27 override fun getBehindScrimAlpha(fraction: Float): Float { 28 return MathUtils.constrainedMap(0f, 1f, 0f, 0.3f, fraction) 29 } 30 getNotificationScrimAlphanull31 override fun getNotificationScrimAlpha(fraction: Float): Float { 32 return MathUtils.constrainedMap(0f, 1f, 0.3f, 0.75f, fraction) 33 } 34 getNotificationContentAlphanull35 override fun getNotificationContentAlpha(fraction: Float): Float { 36 return ShadeInterpolation.getContentAlpha(fraction) 37 } 38 getNotificationFooterAlphanull39 override fun getNotificationFooterAlpha(fraction: Float): Float { 40 return ShadeInterpolation.getContentAlpha(fraction) 41 } 42 getQsAlphanull43 override fun getQsAlpha(fraction: Float): Float { 44 return ShadeInterpolation.getContentAlpha(fraction) 45 } 46 } 47