-
-
Save kasem-sm/87b374bf2262828d13850267c89e4d5f to your computer and use it in GitHub Desktop.
Registering Glance widget in your Android Manifest file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<application> | |
<receiver | |
<!-- Specify the package location of your widget receiver --> | |
android:name="your.package.DailyReadWidgetReceiver" | |
android:exported="false"> | |
<intent-filter> | |
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> | |
</intent-filter> | |
<meta-data | |
android:name="android.appwidget.provider" | |
android:resource="@xml/widget_provider" /> | |
</receiver> | |
</applicaton> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In your main/res/layout | |
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_gravity="center" | |
android:text="@string/app_name" /> | |
</FrameLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In your main/res/xml | |
<?xml version="1.0" encoding="utf-8"?> | |
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" | |
android:minWidth="36dp" | |
android:minHeight="36dp" | |
android:resizeMode="horizontal|vertical" | |
android:minResizeWidth="36dp" | |
android:minResizeHeight="36dp" | |
android:initialLayout="@layout/widget_initial_layout"/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment