1 /*
2  * Copyright (C) 2022 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 package com.android.systemui.animation.view
18 
19 import android.content.Context
20 import android.util.AttributeSet
21 import android.widget.FrameLayout
22 import com.android.systemui.animation.LaunchableView
23 import com.android.systemui.animation.LaunchableViewDelegate
24 
25 /** A [FrameLayout] that also implements [LaunchableView]. */
26 open class LaunchableFrameLayout : FrameLayout, LaunchableView {
27     private val delegate =
28         LaunchableViewDelegate(
29             this,
<lambda>null30             superSetVisibility = { super.setVisibility(it) },
31         )
32 
33     constructor(context: Context) : super(context)
34     constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
35     constructor(
36         context: Context,
37         attrs: AttributeSet?,
38         defStyleAttr: Int
39     ) : super(context, attrs, defStyleAttr)
40 
41     constructor(
42         context: Context,
43         attrs: AttributeSet?,
44         defStyleAttr: Int,
45         defStyleRes: Int
46     ) : super(context, attrs, defStyleAttr, defStyleRes)
47 
setShouldBlockVisibilityChangesnull48     override fun setShouldBlockVisibilityChanges(block: Boolean) {
49         delegate.setShouldBlockVisibilityChanges(block)
50     }
51 
setVisibilitynull52     override fun setVisibility(visibility: Int) {
53         delegate.setVisibility(visibility)
54     }
55 }
56