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

Commit b9f802f6 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 13396955 from 247f51f1 to 25Q3-release

Change-Id: I182e59a54a153fb277f7e8e9a08fa1af896567cc
parents 25f0e2eb 247f51f1
Loading
Loading
Loading
Loading
+6 −25
Original line number Diff line number Diff line
@@ -3,31 +3,12 @@
    {
      "name": "mechanics_tests",
      "options": [
        {"exclude-annotation": "org.junit.Ignore"},
        {"exclude-annotation": "androidx.test.filters.FlakyTest"}
      ]
    },
        {
      "name": "SystemUIGoogleTests",
      "options": [
        {"exclude-annotation": "org.junit.Ignore"},
        {"exclude-annotation": "androidx.test.filters.FlakyTest"}
      ]
          "exclude-annotation": "org.junit.Ignore"
        },
        {
      "name": "WMShellUnitTests",
      "options": [
        {"exclude-annotation": "org.junit.Ignore"},
        {"exclude-annotation": "androidx.test.filters.FlakyTest"}
      ]
          "exclude-annotation": "androidx.test.filters.FlakyTest"
        }
  ],
  "presubmit-large": [
    {
      "name": "SystemUITests",
      "options": [
        {"exclude-annotation": "org.junit.Ignore"},
        {"exclude-annotation": "androidx.test.filters.FlakyTest"}
      ]
    }
  ]
+1 −2
Original line number Diff line number Diff line
@@ -72,11 +72,10 @@ internal fun Modifier.verticalFloatingExpandContainerBackground(
            obtainGraphicsLayer().apply {
                clip = true
                setRoundRectOutline(shapeTopLeft, shapeSize, cornerRadius = currentRadiusPx)

                record { drawContent() }
            }

        onDrawWithContent {
            layer.record { this@onDrawWithContent.drawContent() }
            drawRoundRect(
                color = backgroundColor,
                topLeft = shapeTopLeft,
+56 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 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.
 */

package com.android.mechanics.effects

import com.android.mechanics.spec.Mapping
import com.android.mechanics.spec.builder.Effect
import com.android.mechanics.spec.builder.EffectApplyScope
import com.android.mechanics.spec.builder.EffectPlacement
import com.android.mechanics.spec.builder.MotionBuilderContext
import com.android.mechanics.spec.builder.MotionSpecBuilderScope

/** Creates a [FixedValue] effect with the given [value]. */
fun MotionSpecBuilderScope.fixed(value: Float) = FixedValue(value)

val MotionSpecBuilderScope.zero: FixedValue
    get() = FixedValue.Zero
val MotionSpecBuilderScope.one: FixedValue
    get() = FixedValue.One

/** Produces a fixed [value]. */
open class FixedValue(val value: Float) : Effect {

    override fun EffectApplyScope.createSpec() {
        return unidirectional(Mapping.Fixed(value))
    }

    companion object {
        val Zero = FixedValue(0f)
        val One = FixedValue(1f)
    }
}

/** Produces a fixed [value], for a predefined [extent]. */
class FixedValueWithExtent(value: Float, private val extent: Float) : FixedValue(value) {
    init {
        require(extent > 0)
    }

    override fun MotionBuilderContext.measure(effectPlacement: EffectPlacement): Float {
        return extent * effectPlacement.directionSign
    }
}
+11 −484

File changed.

Preview size limit exceeded, changes collapsed.

+389 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading