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.common.bubbles.DismissView
22
23 /**
24 * Dismiss view is shared from WMShell. It requires setup with local resources.
25 *
26 * Usage:
27 * - Kotlin `dismissView.setup()`
28 * - Java `BubbleDismissViewUtils.setup(dismissView)`
29 */
setupnull30 fun DismissView.setup() {
31 setup(
32 DismissView.Config(
33 dismissViewResId = R.id.dismiss_view,
34 targetSizeResId = R.dimen.bubblebar_dismiss_target_size,
35 iconSizeResId = R.dimen.bubblebar_dismiss_target_icon_size,
36 bottomMarginResId = R.dimen.bubblebar_dismiss_target_bottom_margin,
37 floatingGradientHeightResId = R.dimen.bubblebar_dismiss_floating_gradient_height,
38 floatingGradientColorResId = android.R.color.system_neutral1_900,
39 backgroundResId = R.drawable.bg_bubble_dismiss_circle,
40 iconResId = R.drawable.ic_bubble_dismiss_white
41 )
42 )
43 }
44