Loading packages/SystemUI/src/com/android/systemui/containeddrawable/ContainedDrawable.ktdeleted 100644 → 0 +0 −27 Original line number Diff line number Diff line /* * Copyright (C) 2022 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.containeddrawable import android.graphics.drawable.Drawable import androidx.annotation.DrawableRes /** Convenience container for [Drawable] or a way to load it later. */ sealed class ContainedDrawable { data class WithDrawable(val drawable: Drawable) : ContainedDrawable() data class WithResource(@DrawableRes val resourceId: Int) : ContainedDrawable() } packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardQuickAffordanceInteractor.kt +0 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,6 @@ constructor( KeyguardQuickAffordanceModel.Visible( configKey = configs[index]::class, icon = visibleState.icon, contentDescriptionResourceId = visibleState.contentDescriptionResourceId, ) } else { KeyguardQuickAffordanceModel.Hidden Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/model/KeyguardQuickAffordanceModel.kt +2 −8 Original line number Diff line number Diff line Loading @@ -17,8 +17,7 @@ package com.android.systemui.keyguard.domain.model import androidx.annotation.StringRes import com.android.systemui.containeddrawable.ContainedDrawable import com.android.systemui.common.shared.model.Icon import com.android.systemui.keyguard.domain.quickaffordance.KeyguardQuickAffordanceConfig import kotlin.reflect.KClass Loading @@ -35,11 +34,6 @@ sealed class KeyguardQuickAffordanceModel { /** Identifier for the affordance this is modeling. */ val configKey: KClass<out KeyguardQuickAffordanceConfig>, /** An icon for the affordance. */ val icon: ContainedDrawable, /** * Resource ID for a string to use for the accessibility content description text of the * affordance. */ @StringRes val contentDescriptionResourceId: Int, val icon: Icon, ) : KeyguardQuickAffordanceModel() } packages/SystemUI/src/com/android/systemui/keyguard/domain/quickaffordance/HomeControlsKeyguardQuickAffordanceConfig.kt +10 −3 Original line number Diff line number Diff line Loading @@ -23,7 +23,8 @@ import androidx.annotation.DrawableRes import com.android.systemui.animation.ActivityLaunchAnimator import com.android.systemui.common.coroutine.ChannelExt.trySendWithFailureLogging import com.android.systemui.common.coroutine.ConflatedCallbackFlow.conflatedCallbackFlow import com.android.systemui.containeddrawable.ContainedDrawable import com.android.systemui.common.shared.model.ContentDescription import com.android.systemui.common.shared.model.Icon import com.android.systemui.controls.ControlsServiceInfo import com.android.systemui.controls.controller.StructureInfo import com.android.systemui.controls.dagger.ControlsComponent Loading Loading @@ -122,8 +123,14 @@ constructor( visibility == ControlsComponent.Visibility.AVAILABLE ) { KeyguardQuickAffordanceConfig.State.Visible( icon = ContainedDrawable.WithResource(iconResourceId), contentDescriptionResourceId = component.getTileTitleId(), icon = Icon.Resource( res = iconResourceId, contentDescription = ContentDescription.Resource( res = component.getTileTitleId(), ), ), ) } else { KeyguardQuickAffordanceConfig.State.Hidden Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/quickaffordance/KeyguardQuickAffordanceConfig.kt +2 −8 Original line number Diff line number Diff line Loading @@ -18,9 +18,8 @@ package com.android.systemui.keyguard.domain.quickaffordance import android.content.Intent import androidx.annotation.StringRes import com.android.systemui.animation.ActivityLaunchAnimator import com.android.systemui.containeddrawable.ContainedDrawable import com.android.systemui.common.shared.model.Icon import kotlinx.coroutines.flow.Flow /** Defines interface that can act as data source for a single quick affordance model. */ Loading @@ -44,12 +43,7 @@ interface KeyguardQuickAffordanceConfig { /** An affordance is visible. */ data class Visible( /** An icon for the affordance. */ val icon: ContainedDrawable, /** * Resource ID for a string to use for the accessibility content description text of the * affordance. */ @StringRes val contentDescriptionResourceId: Int, val icon: Icon, ) : State() } Loading Loading
packages/SystemUI/src/com/android/systemui/containeddrawable/ContainedDrawable.ktdeleted 100644 → 0 +0 −27 Original line number Diff line number Diff line /* * Copyright (C) 2022 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.containeddrawable import android.graphics.drawable.Drawable import androidx.annotation.DrawableRes /** Convenience container for [Drawable] or a way to load it later. */ sealed class ContainedDrawable { data class WithDrawable(val drawable: Drawable) : ContainedDrawable() data class WithResource(@DrawableRes val resourceId: Int) : ContainedDrawable() }
packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardQuickAffordanceInteractor.kt +0 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,6 @@ constructor( KeyguardQuickAffordanceModel.Visible( configKey = configs[index]::class, icon = visibleState.icon, contentDescriptionResourceId = visibleState.contentDescriptionResourceId, ) } else { KeyguardQuickAffordanceModel.Hidden Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/model/KeyguardQuickAffordanceModel.kt +2 −8 Original line number Diff line number Diff line Loading @@ -17,8 +17,7 @@ package com.android.systemui.keyguard.domain.model import androidx.annotation.StringRes import com.android.systemui.containeddrawable.ContainedDrawable import com.android.systemui.common.shared.model.Icon import com.android.systemui.keyguard.domain.quickaffordance.KeyguardQuickAffordanceConfig import kotlin.reflect.KClass Loading @@ -35,11 +34,6 @@ sealed class KeyguardQuickAffordanceModel { /** Identifier for the affordance this is modeling. */ val configKey: KClass<out KeyguardQuickAffordanceConfig>, /** An icon for the affordance. */ val icon: ContainedDrawable, /** * Resource ID for a string to use for the accessibility content description text of the * affordance. */ @StringRes val contentDescriptionResourceId: Int, val icon: Icon, ) : KeyguardQuickAffordanceModel() }
packages/SystemUI/src/com/android/systemui/keyguard/domain/quickaffordance/HomeControlsKeyguardQuickAffordanceConfig.kt +10 −3 Original line number Diff line number Diff line Loading @@ -23,7 +23,8 @@ import androidx.annotation.DrawableRes import com.android.systemui.animation.ActivityLaunchAnimator import com.android.systemui.common.coroutine.ChannelExt.trySendWithFailureLogging import com.android.systemui.common.coroutine.ConflatedCallbackFlow.conflatedCallbackFlow import com.android.systemui.containeddrawable.ContainedDrawable import com.android.systemui.common.shared.model.ContentDescription import com.android.systemui.common.shared.model.Icon import com.android.systemui.controls.ControlsServiceInfo import com.android.systemui.controls.controller.StructureInfo import com.android.systemui.controls.dagger.ControlsComponent Loading Loading @@ -122,8 +123,14 @@ constructor( visibility == ControlsComponent.Visibility.AVAILABLE ) { KeyguardQuickAffordanceConfig.State.Visible( icon = ContainedDrawable.WithResource(iconResourceId), contentDescriptionResourceId = component.getTileTitleId(), icon = Icon.Resource( res = iconResourceId, contentDescription = ContentDescription.Resource( res = component.getTileTitleId(), ), ), ) } else { KeyguardQuickAffordanceConfig.State.Hidden Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/quickaffordance/KeyguardQuickAffordanceConfig.kt +2 −8 Original line number Diff line number Diff line Loading @@ -18,9 +18,8 @@ package com.android.systemui.keyguard.domain.quickaffordance import android.content.Intent import androidx.annotation.StringRes import com.android.systemui.animation.ActivityLaunchAnimator import com.android.systemui.containeddrawable.ContainedDrawable import com.android.systemui.common.shared.model.Icon import kotlinx.coroutines.flow.Flow /** Defines interface that can act as data source for a single quick affordance model. */ Loading @@ -44,12 +43,7 @@ interface KeyguardQuickAffordanceConfig { /** An affordance is visible. */ data class Visible( /** An icon for the affordance. */ val icon: ContainedDrawable, /** * Resource ID for a string to use for the accessibility content description text of the * affordance. */ @StringRes val contentDescriptionResourceId: Int, val icon: Icon, ) : State() } Loading