1 /* 2 * Copyright 2021 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 androidx.glance.appwidget 18 19 import androidx.glance.GlanceModifier 20 21 /** 22 * Define the current view as the background of the App Widget. 23 * 24 * By definition, the background of the App Widget is the view with the id `@android:id/background`. 25 * 26 * There can be only one view with this modifier in a given App Widget. 27 * 28 * This modifier does not automatically set corner radius. To have these set for you, use the 29 * [androidx.glance.appwidget.components.Scaffold] component. 30 * 31 * For more information about widget backgrounds, See the documentation on 32 * [Enable smoother transitions](https://developer.android.com/guide/topics/appwidgets/enhance#enable-smoother-transitions) 33 * and 34 * [Implement rounded corners](https://developer.android.com/guide/topics/appwidgets#rounded-corner) 35 * for details on why it is important to label a view as being the background, and why you will want 36 * to set the [cornerRadius] of the same view. 37 */ GlanceModifiernull38fun GlanceModifier.appWidgetBackground(): GlanceModifier = this.then(AppWidgetBackgroundModifier) 39 40 internal object AppWidgetBackgroundModifier : GlanceModifier.Element 41