Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e37c764

Browse files
committedJun 15, 2022
Migrate Glance sample into main branch
- Rebase with Glance branch - Remove glance module - Include List sample with theming
1 parent 73a441c commit e37c764

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+373
-1413
lines changed
 

‎AppWidget/app/src/main/AndroidManifest.xml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454
<meta-data
5555
android:name="android.appwidget.provider"
56-
android:resource="@xml/app_widget_info_checkbox_list" />
56+
android:resource="@xml/app_widget_list_rv" />
5757
</receiver>
5858

5959
<receiver
@@ -79,6 +79,19 @@
7979
android:name="android.appwidget.provider"
8080
android:resource="@xml/app_widget_weather_forecast" />
8181
</receiver>
82+
83+
<receiver
84+
android:name=".glance.list.ListGlanceWidgetReceiver"
85+
android:enabled="@bool/glance_appwidget_available"
86+
android:exported="false">
87+
<intent-filter>
88+
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
89+
</intent-filter>
90+
91+
<meta-data
92+
android:name="android.appwidget.provider"
93+
android:resource="@xml/app_widget_list_glance" />
94+
</receiver>
8295
</application>
8396

8497
</manifest>
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.example.android.glancewidget
17+
package com.example.android.appwidget.glance
18+
1819

1920
import android.os.Build
2021
import androidx.compose.runtime.Composable
@@ -23,10 +24,11 @@ import androidx.glance.GlanceModifier
2324
import androidx.glance.appwidget.cornerRadius
2425

2526
@Composable
26-
fun GlanceModifier.appWidgetBackgroundRadius(): GlanceModifier {
27-
return if (Build.VERSION.SDK_INT >= 31) {
28-
this.cornerRadius(android.R.dimen.system_app_widget_background_radius)
27+
fun GlanceModifier.appWidgetBackgroundCornerRadius(): GlanceModifier {
28+
if (Build.VERSION.SDK_INT >= 31) {
29+
cornerRadius(android.R.dimen.system_app_widget_background_radius)
2930
} else {
30-
this.cornerRadius(16.dp)
31+
cornerRadius(16.dp)
3132
}
32-
}
33+
return this
34+
}

0 commit comments

Comments
 (0)
Please sign in to comment.