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 33 class DefaultStatusViewSection @Inject constructor(private val context: Context) : 34 KeyguardSection { 35 private val statusViewId = R.id.keyguard_status_view 36 37 override fun apply(constraintSet: ConstraintSet) { 38 constraintSet.apply { 39 constrainWidth(statusViewId, MATCH_CONSTRAINT) 40 constrainHeight(statusViewId, WRAP_CONTENT) 41 connect(statusViewId, TOP, PARENT_ID, TOP) 42 connect(statusViewId, START, PARENT_ID, START) 43 connect(statusViewId, END, PARENT_ID, END) 44 } 45 } 46 } 47