Loading packages/SystemUI/res/layout/auth_biometric_icon.xmldeleted 100644 → 0 +0 −26 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ 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. --> <com.airbnb.lottie.LottieAnimationView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/biometric_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:contentDescription="@null" android:scaleType="fitXY"/> No newline at end of file packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/PromptIconViewBinder.kt +14 −3 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import androidx.constraintlayout.widget.ConstraintSet import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle import com.airbnb.lottie.LottieAnimationView import com.airbnb.lottie.LottieOnCompositionLoadedListener import com.android.settingslib.widget.LottieColorUtils import com.android.systemui.Flags.constraintBp import com.android.systemui.biometrics.ui.viewmodel.PromptIconViewModel Loading Loading @@ -77,6 +78,8 @@ object PromptIconViewBinder { } launch { var lottieOnCompositionLoadedListener: LottieOnCompositionLoadedListener? = null combine(viewModel.activeAuthType, viewModel.iconSize, ::Pair).collect { (activeAuthType, iconSize) -> // Every time after bp shows, [isIconViewLoaded] is set to false in Loading @@ -94,10 +97,18 @@ object PromptIconViewBinder { * TODO(b/288175072): May be able to remove this once constraint * layout is implemented */ iconView.removeAllLottieOnCompositionLoadedListener() iconView.addLottieOnCompositionLoadedListener { if (lottieOnCompositionLoadedListener != null) { iconView.removeLottieOnCompositionLoadedListener( lottieOnCompositionLoadedListener!! ) } lottieOnCompositionLoadedListener = LottieOnCompositionLoadedListener { promptViewModel.setIsIconViewLoaded(true) } iconView.addLottieOnCompositionLoadedListener( lottieOnCompositionLoadedListener!! ) } AuthType.Face -> { /** Loading Loading
packages/SystemUI/res/layout/auth_biometric_icon.xmldeleted 100644 → 0 +0 −26 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ 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. --> <com.airbnb.lottie.LottieAnimationView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/biometric_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:contentDescription="@null" android:scaleType="fitXY"/> No newline at end of file
packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/PromptIconViewBinder.kt +14 −3 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import androidx.constraintlayout.widget.ConstraintSet import androidx.lifecycle.Lifecycle import androidx.lifecycle.repeatOnLifecycle import com.airbnb.lottie.LottieAnimationView import com.airbnb.lottie.LottieOnCompositionLoadedListener import com.android.settingslib.widget.LottieColorUtils import com.android.systemui.Flags.constraintBp import com.android.systemui.biometrics.ui.viewmodel.PromptIconViewModel Loading Loading @@ -77,6 +78,8 @@ object PromptIconViewBinder { } launch { var lottieOnCompositionLoadedListener: LottieOnCompositionLoadedListener? = null combine(viewModel.activeAuthType, viewModel.iconSize, ::Pair).collect { (activeAuthType, iconSize) -> // Every time after bp shows, [isIconViewLoaded] is set to false in Loading @@ -94,10 +97,18 @@ object PromptIconViewBinder { * TODO(b/288175072): May be able to remove this once constraint * layout is implemented */ iconView.removeAllLottieOnCompositionLoadedListener() iconView.addLottieOnCompositionLoadedListener { if (lottieOnCompositionLoadedListener != null) { iconView.removeLottieOnCompositionLoadedListener( lottieOnCompositionLoadedListener!! ) } lottieOnCompositionLoadedListener = LottieOnCompositionLoadedListener { promptViewModel.setIsIconViewLoaded(true) } iconView.addLottieOnCompositionLoadedListener( lottieOnCompositionLoadedListener!! ) } AuthType.Face -> { /** Loading