• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 @file:JvmName("BubbleDismissViewUtils")
17 
18 package com.android.launcher3.taskbar.bubbles
19 
20 import com.android.launcher3.R
21 import com.android.wm.shell.shared.R as SharedR
22 import com.android.wm.shell.shared.bubbles.DismissView
23 
24 /**
25  * Dismiss view is shared from WMShell. It requires setup with local resources.
26  *
27  * Usage:
28  * - Kotlin `dismissView.setup()`
29  * - Java `BubbleDismissViewUtils.setup(dismissView)`
30  */
setupnull31 fun DismissView.setup() {
32     setup(
33         DismissView.Config(
34             dismissViewResId = R.id.dismiss_view,
35             targetSizeResId = R.dimen.bubblebar_dismiss_target_size,
36             iconSizeResId = R.dimen.bubblebar_dismiss_target_icon_size,
37             bottomMarginResId = R.dimen.bubblebar_dismiss_target_bottom_margin,
38             floatingGradientHeightResId = R.dimen.bubblebar_dismiss_floating_gradient_height,
39             floatingGradientColorResId = android.R.color.system_neutral1_900,
40             backgroundResId = SharedR.drawable.floating_dismiss_background,
41             iconResId = SharedR.drawable.floating_dismiss_ic_close,
42         )
43     )
44 }
45