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 18 package com.android.systemui.keyguard.ui.view.layout.blueprints 19 20 import androidx.constraintlayout.widget.ConstraintSet 21 import com.android.systemui.dagger.SysUISingleton 22 import com.android.systemui.keyguard.data.repository.KeyguardBlueprint 23 import com.android.systemui.keyguard.ui.view.layout.sections.DefaultAmbientIndicationAreaSection 24 import com.android.systemui.keyguard.ui.view.layout.sections.DefaultIndicationAreaSection 25 import com.android.systemui.keyguard.ui.view.layout.sections.DefaultLockIconSection 26 import com.android.systemui.keyguard.ui.view.layout.sections.DefaultSettingsPopupMenuSection 27 import com.android.systemui.keyguard.ui.view.layout.sections.DefaultShortcutsSection 28 import com.android.systemui.keyguard.ui.view.layout.sections.DefaultStatusViewSection 29 import com.android.systemui.keyguard.ui.view.layout.sections.SplitShadeGuidelines 30 import javax.inject.Inject 31 32 /** 33 * Positions elements of the lockscreen to the default position. 34 * 35 * This will be the most common use case for phones in portrait mode. 36 */ 37 @SysUISingleton 38 @JvmSuppressWildcards 39 class DefaultKeyguardBlueprint 40 @Inject 41 constructor( 42 private val defaultIndicationAreaSection: DefaultIndicationAreaSection, 43 private val defaultLockIconSection: DefaultLockIconSection, 44 private val defaultShortcutsSection: DefaultShortcutsSection, 45 private val defaultAmbientIndicationAreaSection: DefaultAmbientIndicationAreaSection, 46 private val defaultSettingsPopupMenuSection: DefaultSettingsPopupMenuSection, 47 private val defaultStatusViewSection: DefaultStatusViewSection, 48 private val splitShadeGuidelines: SplitShadeGuidelines, 49 ) : KeyguardBlueprint { 50 override val id: String = DEFAULT 51 52 override fun apply(constraintSet: ConstraintSet) { 53 defaultIndicationAreaSection.apply(constraintSet) 54 defaultLockIconSection.apply(constraintSet) 55 defaultShortcutsSection.apply(constraintSet) 56 defaultAmbientIndicationAreaSection.apply(constraintSet) 57 defaultSettingsPopupMenuSection.apply(constraintSet) 58 defaultStatusViewSection.apply(constraintSet) 59 splitShadeGuidelines.apply(constraintSet) 60 } 61 62 companion object { 63 const val DEFAULT = "default" 64 } 65 } 66