Merge "Wrap the lottie views and trace whenever it invalidates" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
ddb03a45b8
@@ -28,7 +28,7 @@
|
|||||||
app:cardCornerRadius="28dp"
|
app:cardCornerRadius="28dp"
|
||||||
app:cardBackgroundColor="@color/rear_display_overlay_animation_background_color">
|
app:cardBackgroundColor="@color/rear_display_overlay_animation_background_color">
|
||||||
|
|
||||||
<com.airbnb.lottie.LottieAnimationView
|
<com.android.systemui.reardisplay.RearDisplayEducationLottieViewWrapper
|
||||||
android:id="@+id/rear_display_folded_animation"
|
android:id="@+id/rear_display_folded_animation"
|
||||||
android:importantForAccessibility="no"
|
android:importantForAccessibility="no"
|
||||||
android:layout_width="@dimen/rear_display_animation_width"
|
android:layout_width="@dimen/rear_display_animation_width"
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
app:cardCornerRadius="28dp"
|
app:cardCornerRadius="28dp"
|
||||||
app:cardBackgroundColor="@color/rear_display_overlay_animation_background_color">
|
app:cardBackgroundColor="@color/rear_display_overlay_animation_background_color">
|
||||||
|
|
||||||
<com.airbnb.lottie.LottieAnimationView
|
<com.android.systemui.reardisplay.RearDisplayEducationLottieViewWrapper
|
||||||
android:id="@+id/rear_display_folded_animation"
|
android:id="@+id/rear_display_folded_animation"
|
||||||
android:importantForAccessibility="no"
|
android:importantForAccessibility="no"
|
||||||
android:layout_width="@dimen/rear_display_animation_width_opened"
|
android:layout_width="@dimen/rear_display_animation_width_opened"
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
<include layout="@layout/auth_biometric_icon"/>
|
<include layout="@layout/auth_biometric_icon"/>
|
||||||
|
|
||||||
<com.airbnb.lottie.LottieAnimationView
|
<com.android.systemui.biometrics.BiometricPromptLottieViewWrapper
|
||||||
android:id="@+id/biometric_icon_overlay"
|
android:id="@+id/biometric_icon_overlay"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center">
|
android:layout_gravity="center">
|
||||||
|
|
||||||
<com.airbnb.lottie.LottieAnimationView
|
<com.android.systemui.biometrics.BiometricPromptLottieViewWrapper
|
||||||
android:id="@+id/biometric_icon"
|
android:id="@+id/biometric_icon"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
android:contentDescription="@null"
|
android:contentDescription="@null"
|
||||||
android:scaleType="fitXY" />
|
android:scaleType="fitXY" />
|
||||||
|
|
||||||
<com.airbnb.lottie.LottieAnimationView
|
<com.android.systemui.biometrics.BiometricPromptLottieViewWrapper
|
||||||
android:id="@+id/biometric_icon_overlay"
|
android:id="@+id/biometric_icon_overlay"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
~ See the License for the specific language governing permissions and
|
~ See the License for the specific language governing permissions and
|
||||||
~ limitations under the License.
|
~ limitations under the License.
|
||||||
-->
|
-->
|
||||||
<com.airbnb.lottie.LottieAnimationView
|
<com.android.systemui.biometrics.SideFpsLottieViewWrapper
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/sidefps_animation"
|
android:id="@+id/sidefps_animation"
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
android:background="@drawable/fingerprint_bg">
|
android:background="@drawable/fingerprint_bg">
|
||||||
|
|
||||||
<!-- LockScreen fingerprint icon from 0 stroke width to full width -->
|
<!-- LockScreen fingerprint icon from 0 stroke width to full width -->
|
||||||
<com.airbnb.lottie.LottieAnimationView
|
<com.android.systemui.keyguard.ui.view.UdfpsLottieViewWrapper
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
<!-- Fingerprint -->
|
<!-- Fingerprint -->
|
||||||
<!-- AOD dashed fingerprint icon with moving dashes -->
|
<!-- AOD dashed fingerprint icon with moving dashes -->
|
||||||
<com.airbnb.lottie.LottieAnimationView
|
<com.android.systemui.keyguard.ui.view.UdfpsLottieViewWrapper
|
||||||
android:id="@+id/udfps_aod_fp"
|
android:id="@+id/udfps_aod_fp"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
app:lottie_rawRes="@raw/udfps_aod_fp"/>
|
app:lottie_rawRes="@raw/udfps_aod_fp"/>
|
||||||
|
|
||||||
<!-- LockScreen fingerprint icon from 0 stroke width to full width -->
|
<!-- LockScreen fingerprint icon from 0 stroke width to full width -->
|
||||||
<com.airbnb.lottie.LottieAnimationView
|
<com.android.systemui.keyguard.ui.view.UdfpsLottieViewWrapper
|
||||||
android:id="@+id/udfps_lockscreen_fp"
|
android:id="@+id/udfps_lockscreen_fp"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2023 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.systemui.biometrics
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import com.android.systemui.util.wrapper.LottieViewWrapper
|
||||||
|
|
||||||
|
class BiometricPromptLottieViewWrapper
|
||||||
|
@JvmOverloads
|
||||||
|
constructor(context: Context, attrs: AttributeSet? = null) : LottieViewWrapper(context, attrs)
|
||||||
@@ -117,6 +117,8 @@ constructor(
|
|||||||
private var overlayView: View? = null
|
private var overlayView: View? = null
|
||||||
set(value) {
|
set(value) {
|
||||||
field?.let { oldView ->
|
field?.let { oldView ->
|
||||||
|
val lottie = oldView.findViewById(R.id.sidefps_animation) as LottieAnimationView
|
||||||
|
lottie.pauseAnimation()
|
||||||
windowManager.removeView(oldView)
|
windowManager.removeView(oldView)
|
||||||
orientationListener.disable()
|
orientationListener.disable()
|
||||||
}
|
}
|
||||||
@@ -193,7 +195,9 @@ constructor(
|
|||||||
requests.add(request)
|
requests.add(request)
|
||||||
mainExecutor.execute {
|
mainExecutor.execute {
|
||||||
if (overlayView == null) {
|
if (overlayView == null) {
|
||||||
traceSection("SideFpsController#show(request=${request.name}, reason=$reason") {
|
traceSection(
|
||||||
|
"SideFpsController#show(request=${request.name}, reason=$reason)"
|
||||||
|
) {
|
||||||
createOverlayForDisplay(reason)
|
createOverlayForDisplay(reason)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -208,7 +212,7 @@ constructor(
|
|||||||
requests.remove(request)
|
requests.remove(request)
|
||||||
mainExecutor.execute {
|
mainExecutor.execute {
|
||||||
if (requests.isEmpty()) {
|
if (requests.isEmpty()) {
|
||||||
traceSection("SideFpsController#hide(${request.name}") { overlayView = null }
|
traceSection("SideFpsController#hide(${request.name})") { overlayView = null }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2023 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.systemui.biometrics
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import com.android.systemui.util.wrapper.LottieViewWrapper
|
||||||
|
|
||||||
|
class SideFpsLottieViewWrapper
|
||||||
|
@JvmOverloads
|
||||||
|
constructor(context: Context, attrs: AttributeSet? = null) : LottieViewWrapper(context, attrs)
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2023 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.systemui.keyguard.ui.view
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import com.android.systemui.util.wrapper.LottieViewWrapper
|
||||||
|
|
||||||
|
class UdfpsLottieViewWrapper
|
||||||
|
@JvmOverloads
|
||||||
|
constructor(context: Context, attrs: AttributeSet? = null) : LottieViewWrapper(context, attrs)
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2023 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.systemui.reardisplay
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import com.android.systemui.util.wrapper.LottieViewWrapper
|
||||||
|
|
||||||
|
class RearDisplayEducationLottieViewWrapper
|
||||||
|
@JvmOverloads
|
||||||
|
constructor(context: Context, attrs: AttributeSet? = null) : LottieViewWrapper(context, attrs)
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2023 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.systemui.util.wrapper
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import com.airbnb.lottie.LottieAnimationView
|
||||||
|
import com.android.systemui.util.traceSection
|
||||||
|
|
||||||
|
/** LottieAnimationView that traces each call to invalidate. */
|
||||||
|
open class LottieViewWrapper : LottieAnimationView {
|
||||||
|
constructor(context: Context?) : super(context)
|
||||||
|
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
|
||||||
|
constructor(
|
||||||
|
context: Context?,
|
||||||
|
attrs: AttributeSet?,
|
||||||
|
defStyleAttr: Int
|
||||||
|
) : super(context, attrs, defStyleAttr)
|
||||||
|
|
||||||
|
override fun invalidate() {
|
||||||
|
traceSection<Any?>("${this::class} invalidate") {
|
||||||
|
super.invalidate()
|
||||||
|
null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user