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.sections 19 20 import android.content.Context 21 import android.view.ViewGroup 22 import androidx.constraintlayout.widget.ConstraintSet 23 import com.android.systemui.R 24 import com.android.systemui.keyguard.data.repository.KeyguardSection 25 import javax.inject.Inject 26 import android.view.ViewGroup.LayoutParams.WRAP_CONTENT 27 import androidx.constraintlayout.widget.ConstraintSet.MATCH_CONSTRAINT 28 import androidx.constraintlayout.widget.ConstraintSet.PARENT_ID 29 import androidx.constraintlayout.widget.ConstraintSet.START 30 import androidx.constraintlayout.widget.ConstraintSet.TOP 31 import androidx.constraintlayout.widget.ConstraintSet.END 32 import androidx.constraintlayout.widget.ConstraintSet.VERTICAL 33 34 class SplitShadeGuidelines @Inject constructor(private val context: Context) : 35 KeyguardSection { 36 37 override fun apply(constraintSet: ConstraintSet) { 38 constraintSet.apply { 39 // For use on large screens, it will provide a guideline vertically in the center to 40 // enable items to be aligned on the left or right sides 41 create(R.id.split_shade_guideline, VERTICAL) 42 setGuidelinePercent(R.id.split_shade_guideline, 0.5f) 43 } 44 } 45 } 46