diff --git a/404.html b/404.html index c14f468..b285216 100644 --- a/404.html +++ b/404.html @@ -7,7 +7,7 @@ - + diff --git a/assets/js/f477c445.974e1f48.js b/assets/js/f477c445.974e1f48.js new file mode 100644 index 0000000..a9c90f0 --- /dev/null +++ b/assets/js/f477c445.974e1f48.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkreact_native_android_widget_docs=self.webpackChunkreact_native_android_widget_docs||[]).push([[9990],{5733:(e,i,n)=>{n.r(i),n.d(i,{assets:()=>c,contentTitle:()=>o,default:()=>g,frontMatter:()=>s,metadata:()=>l,toc:()=>u});var t=n(5893),r=n(1151),a=n(4866),d=n(5162);const s={sidebar_position:4},o="Register widget",l={id:"tutorial/register-widget",title:"Register widget",description:"In order to register our widget so that it can be selected from the launchers widget picker, we need to tell the android app some information about the widget.",source:"@site/docs/tutorial/register-widget.md",sourceDirName:"tutorial",slug:"/tutorial/register-widget",permalink:"/react-native-android-widget/docs/tutorial/register-widget",draft:!1,unlisted:!1,editUrl:"https://github.com/sAleksovski/react-native-android-widget/tree/master/docs/docs/tutorial/register-widget.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"default",previous:{title:"Register task handler",permalink:"/react-native-android-widget/docs/tutorial/register-task-handler"},next:{title:"Register widget in Expo",permalink:"/react-native-android-widget/docs/tutorial/register-widget-expo"}},c={},u=[{value:"Add a widget provider class",id:"add-a-widget-provider-class",level:2},{value:"Create widget preview image",id:"create-widget-preview-image",level:2},{value:"Add widget description string (Optional)",id:"add-widget-description-string-optional",level:2},{value:"Add a widget provider xml file",id:"add-a-widget-provider-xml-file",level:2},{value:"Add services in AndroidManifest.xml",id:"add-services-in-androidmanifestxml",level:2},{value:"Add widget receiver in AndroidManifest.xml",id:"add-widget-receiver-in-androidmanifestxml",level:2},{value:"Add custom fonts used in widgets",id:"add-custom-fonts-used-in-widgets",level:2}];function h(e){const i={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.h1,{id:"register-widget",children:"Register widget"}),"\n",(0,t.jsx)(i.p,{children:"In order to register our widget so that it can be selected from the launchers widget picker, we need to tell the android app some information about the widget."}),"\n",(0,t.jsx)(i.h2,{id:"add-a-widget-provider-class",children:"Add a widget provider class"}),"\n",(0,t.jsxs)(i.p,{children:["Create a new package ",(0,t.jsx)(i.code,{children:"widget"})," in the native android app."]}),"\n","\n","\n",(0,t.jsxs)(a.Z,{children:[(0,t.jsxs)(d.Z,{value:"Java",label:"Java",default:!0,children:[(0,t.jsxs)(i.p,{children:["Inside it create a class ",(0,t.jsx)(i.code,{children:"Hello.java"})]}),(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-java",metastring:'title="android/app/src/main/java/com/yourapppackage/widget/Hello.java"',children:"package com.yourapppackage.widget;\n\nimport com.reactnativeandroidwidget.RNWidgetProvider;\n\npublic class Hello extends RNWidgetProvider {\n}\n"})})]}),(0,t.jsxs)(d.Z,{value:"Kotlin",label:"Kotlin",children:[(0,t.jsxs)(i.p,{children:["Inside it create a class ",(0,t.jsx)(i.code,{children:"Hello.kt"})]}),(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-kotlin",metastring:'title="android/app/src/main/java/com/yourapppackage/widget/Hello.kt"',children:"package com.yourapppackage.widget\n\nimport com.reactnativeandroidwidget.RNWidgetProvider\n\nclass Hello : RNWidgetProvider() {\n}\n"})})]})]}),"\n",(0,t.jsxs)(i.p,{children:["The class ",(0,t.jsx)(i.strong,{children:"name"})," will be used to reference our widget."]}),"\n",(0,t.jsx)(i.h2,{id:"create-widget-preview-image",children:"Create widget preview image"}),"\n",(0,t.jsx)(i.p,{children:"When the android launcher shows the widget select popup, we can show a screenshot of our widget to give the user an idea what the widget looks like."}),"\n",(0,t.jsxs)(i.p,{children:["Take a screenshot of the widget, and place it inside ",(0,t.jsx)(i.code,{children:"android/app/src/main/res/drawable/hello_preview.png"})]}),"\n",(0,t.jsx)("pre",{children:"android/app/src/main/res/drawable/hello_preview.png"}),"\n",(0,t.jsx)(i.p,{children:(0,t.jsx)(i.img,{alt:"Hello Widget Preview",src:n(6945).Z+"",width:"327",height:"208"})}),"\n",(0,t.jsx)(i.h2,{id:"add-widget-description-string-optional",children:"Add widget description string (Optional)"}),"\n",(0,t.jsxs)(i.p,{children:["When the android launcher shows the widget select popup, under the name of the widget it can show an optional description about the widget. If we want to show a description for our widget, we need to add a description string in ",(0,t.jsx)(i.code,{children:"strings.xml"})]}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-xml",metastring:'title="android/app/src/main/res/values/strings.xml"',children:'\n\n My App Name\n This is my first widget\n\n'})}),"\n",(0,t.jsx)(i.h2,{id:"add-a-widget-provider-xml-file",children:"Add a widget provider xml file"}),"\n",(0,t.jsx)(i.p,{children:"Create a new xml file in the resources directory containing the details about the widget."}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-xml",metastring:'title="android/app/src/main/res/xml/widgetprovider_hello.xml"',children:'\n\n\n'})}),"\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsxs)(i.li,{children:[(0,t.jsx)(i.code,{children:"android:updatePeriodMillis"})," How often, in milliseconds, that this AppWidget wants to be updated. The task handler will be called with ",(0,t.jsx)(i.code,{children:"widgetAction = 'UPDATE_WIDGET'"}),". See the official docs ",(0,t.jsx)(i.a,{href:"https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo.html#updatePeriodMillis",children:"here"})]}),"\n",(0,t.jsxs)(i.li,{children:[(0,t.jsx)(i.code,{children:"android:previewImage"})," should reference the preview image we added previously"]}),"\n",(0,t.jsxs)(i.li,{children:[(0,t.jsx)(i.code,{children:"android:description"})," can be added or not, depending on if we added a description in the previous step"]}),"\n"]}),"\n",(0,t.jsx)(i.h2,{id:"add-services-in-androidmanifestxml",children:"Add services in AndroidManifest.xml"}),"\n",(0,t.jsxs)(i.p,{children:["In order to use the ",(0,t.jsx)(i.a,{href:"/react-native-android-widget/docs/primitives/list-widget",children:"ListWidget"})," we need to add a ",(0,t.jsx)(i.code,{children:"RNWidgetCollectionService"})," service."]}),"\n",(0,t.jsxs)(i.p,{children:["Under the application section in the manifest, add a new ",(0,t.jsx)(i.code,{children:"RNWidgetCollectionService"})," service. This service will be shared between all widgets, so it needs to be added only once."]}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-xml",metastring:'title="android/app/src/main/AndroidManifest.xml"',children:'\n ...\n \n\n \n \n\n \n \n\n'})}),"\n",(0,t.jsx)(i.h2,{id:"add-widget-receiver-in-androidmanifestxml",children:"Add widget receiver in AndroidManifest.xml"}),"\n",(0,t.jsx)(i.p,{children:"Finally, we need to add a receiver for our widget, that will receive system events (like widget added, widget resized...)"}),"\n",(0,t.jsxs)(i.p,{children:["In ",(0,t.jsx)(i.code,{children:"AndroidManifest.xml"}),", add a receiver for the widget"]}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-xml",metastring:'title="android/app/src/main/AndroidManifest.xml"',children:'\n ...\n \n\n \n \n\n \n\n \n \n \n \n \n \n \n \n\n'})}),"\n",(0,t.jsx)(i.p,{children:"For the receiver"}),"\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsxs)(i.li,{children:[(0,t.jsx)(i.code,{children:"android:name"})," myst be ",(0,t.jsx)(i.code,{children:".widget.WidgetName"})," (same as the Java class extending ",(0,t.jsx)(i.code,{children:"RNWidgetProvider"}),")"]}),"\n",(0,t.jsxs)(i.li,{children:[(0,t.jsx)(i.code,{children:"android:label"})," will be shown in the widget picker"]}),"\n"]}),"\n",(0,t.jsx)(i.h2,{id:"add-custom-fonts-used-in-widgets",children:"Add custom fonts used in widgets"}),"\n",(0,t.jsxs)(i.p,{children:["If we used a custom font in our widget, we must copy the font file(s) to ",(0,t.jsx)(i.code,{children:"android/app/src/main/assets/fonts"}),". The ",(0,t.jsx)(i.code,{children:"fontFamily"})," style prop will match the file by name."]}),"\n",(0,t.jsxs)(i.p,{children:["For example, ",(0,t.jsx)(i.code,{children:"android/app/src/main/assets/fonts/Inter.ttf"})]})]})}function g(e={}){const{wrapper:i}={...(0,r.a)(),...e.components};return i?(0,t.jsx)(i,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},5162:(e,i,n)=>{n.d(i,{Z:()=>d});n(7294);var t=n(512);const r={tabItem:"tabItem_Ymn6"};var a=n(5893);function d(e){let{children:i,hidden:n,className:d}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,t.Z)(r.tabItem,d),hidden:n,children:i})}},4866:(e,i,n)=>{n.d(i,{Z:()=>b});var t=n(7294),r=n(512),a=n(2466),d=n(6550),s=n(469),o=n(1980),l=n(7392),c=n(12);function u(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:i}=e;return!!i&&"object"==typeof i&&"value"in i}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:i,children:n}=e;return(0,t.useMemo)((()=>{const e=i??function(e){return u(e).map((e=>{let{props:{value:i,label:n,attributes:t,default:r}}=e;return{value:i,label:n,attributes:t,default:r}}))}(n);return function(e){const i=(0,l.l)(e,((e,i)=>e.value===i.value));if(i.length>0)throw new Error(`Docusaurus error: Duplicate values "${i.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[i,n])}function g(e){let{value:i,tabValues:n}=e;return n.some((e=>e.value===i))}function p(e){let{queryString:i=!1,groupId:n}=e;const r=(0,d.k6)(),a=function(e){let{queryString:i=!1,groupId:n}=e;if("string"==typeof i)return i;if(!1===i)return null;if(!0===i&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:i,groupId:n});return[(0,o._X)(a),(0,t.useCallback)((e=>{if(!a)return;const i=new URLSearchParams(r.location.search);i.set(a,e),r.replace({...r.location,search:i.toString()})}),[a,r])]}function m(e){const{defaultValue:i,queryString:n=!1,groupId:r}=e,a=h(e),[d,o]=(0,t.useState)((()=>function(e){let{defaultValue:i,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(i){if(!g({value:i,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${i}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return i}const t=n.find((e=>e.default))??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:i,tabValues:a}))),[l,u]=p({queryString:n,groupId:r}),[m,v]=function(e){let{groupId:i}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(i),[r,a]=(0,c.Nk)(n);return[r,(0,t.useCallback)((e=>{n&&a.set(e)}),[n,a])]}({groupId:r}),f=(()=>{const e=l??m;return g({value:e,tabValues:a})?e:null})();(0,s.Z)((()=>{f&&o(f)}),[f]);return{selectedValue:d,selectValue:(0,t.useCallback)((e=>{if(!g({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);o(e),u(e),v(e)}),[u,v,a]),tabValues:a}}var v=n(2389);const f={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var w=n(5893);function x(e){let{className:i,block:n,selectedValue:t,selectValue:d,tabValues:s}=e;const o=[],{blockElementScrollPositionUntilNextRender:l}=(0,a.o5)(),c=e=>{const i=e.currentTarget,n=o.indexOf(i),r=s[n].value;r!==t&&(l(i),d(r))},u=e=>{let i=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=o.indexOf(e.currentTarget)+1;i=o[n]??o[0];break}case"ArrowLeft":{const n=o.indexOf(e.currentTarget)-1;i=o[n]??o[o.length-1];break}}i?.focus()};return(0,w.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":n},i),children:s.map((e=>{let{value:i,label:n,attributes:a}=e;return(0,w.jsx)("li",{role:"tab",tabIndex:t===i?0:-1,"aria-selected":t===i,ref:e=>o.push(e),onKeyDown:u,onClick:c,...a,className:(0,r.Z)("tabs__item",f.tabItem,a?.className,{"tabs__item--active":t===i}),children:n??i},i)}))})}function A(e){let{lazy:i,children:n,selectedValue:r}=e;const a=(Array.isArray(n)?n:[n]).filter(Boolean);if(i){const e=a.find((e=>e.props.value===r));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,w.jsx)("div",{className:"margin-top--md",children:a.map(((e,i)=>(0,t.cloneElement)(e,{key:i,hidden:e.props.value!==r})))})}function j(e){const i=m(e);return(0,w.jsxs)("div",{className:(0,r.Z)("tabs-container",f.tabList),children:[(0,w.jsx)(x,{...e,...i}),(0,w.jsx)(A,{...e,...i})]})}function b(e){const i=(0,v.Z)();return(0,w.jsx)(j,{...e,children:u(e.children)},String(i))}},6945:(e,i,n)=>{n.d(i,{Z:()=>t});const t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUcAAADQCAYAAACUXaMkAAAABHNCSVQICAgIfAhkiAAACTdJREFUeJzt3UtoXAUbgOFvJslMc/FSFItCK1YqUhAiukh0YV0o1p3QhZeVgiAiuhJERJGibkSxbisKgghqiYvWhYIomjYgqLgRrCItKO1CzMUkc0nmX0iHhn7NP5PMJBn7PBA4J+cyX6F9OWfmJC3MzMw0AoAVips9AMBWJI4ACXEESIgjQEIcARLiCJDo7/YLFAqFbr8EcIlqNLr3JGLH41gul6NUKnX6tACrqlarUalUOna+jsSxUCjE0NBQFIvu0oHNUSqVolQqxfLycszPz6/7qnLdcXSlCGwlxWIxRkZG1n0lua5LveHhYWEEtqRSqRTDw8NrPn7NcRweHnYbDWxpxWJxzYFcU90GBweFEegJxWIxBgcH2z+u3QMGBgaiv7/rTwABdEx/f3/b3Wo7jtu2bWv3EIBN1+7VY1txLJfLbZ0cYCtpp2FtxdEn00Ava6dhPlUBSLQcR+81Av8Frbas5Tj6hBr4L2i1ZS3H0W/XAf4LWm2Z9xwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCMxPj4eY2NjMTY2FsePH2/5uMnJyeZxY2NjXZvvjz/+WPV1Dh482Nz23HPPdW0OLi39mz0Am29qaioajUZERExPT7d83PT0dExNTXVrrKZKpbLq6/z222/N7dddd13X5+HS4MoRICGOAAlxBEh4z5ENV6vVYmlpKfr6+mJgYGBTZlheXo56vR7Ly8vR398f/f3+KbCSK0c2zPj4eJRKpSiVSjE4OBilUikGBgbijjvu2LAZfvnll7jiiiuir68vyuVyDA4OxsDAQAwNDcWLL764YXOw9YkjXff5559HoVCIEydORK1WW7GtXq/H8ePHo6+vL7744ouuznHnnXfGTTfdFDMzMxdsW1hYiIMHD8bQ0FAsLCx0dQ56g3sJumpycjLuvffe5nqhUIgnn3wy9u7dGz///HO8/fbbEfHvbe4999wTp06dip07d3Z8jltvvTV++OGH5nq5XI4nnngitm/fHhMTE81tCwsLcfnll18QcS494khX3X333c3lAwcOxEcffbRi+6FDh+LAgQPxySefRETErl27ms9cdsqRI0dWhPGtt96Kp59+urn+0ksvxenTp2P37t1Rr9ejXq/Hjh074syZMx2dg97itpoV9u/fH4VCoaWv+++/f9Vzvf7661GtViMiYs+ePReE8ZyPP/44SqVSc/2nn37q3B8oIh5++OHm8iOPPLIijOfs3Lkzfvzxx+b62bNn4++//+7oHPQWcaRr3njjjebyxMTEqvu+//77zeU333yzYzPMz89HpVJprr/zzjsX3Xfv3r2xffv25vqzzz7bsTnoPeJI1/z555/N5ZtvvjmWl5cv+nX77bc393333Xc7NsOnn37aXC4UClEul1fd//xPrA8fPtyxOeg94sgKx44dWzVi538dPXq05fP29fWt+nXjjTd25c/z7bffNpfPf//zYsbHx7syB73HBzKscO79xFb33erOf//ymmuu+b/7j4yMdHMceog4siG+/PLLTXnd0dHR+PrrryNi5W3+xWTPQHJpEkc2xL59+zblde+66644dOhQRER89dVX/3f/b775ptsj0SO850jX7Nixo7l87NixTZnhvvvuW7E+Nze36v6vvPJKc/mZZ57pykz0BnGka5566qnm8mOPPbbqvo8//ngUi8V49NFHY3JysmMzDA0NxbZt25rrDz744EX3nZqaWvHLfl999dWOzUHvEUe65oUXXohi8d+/YmfOnIldu3bF0tLSBftNTEzE4cOHo9FoxHvvvdfxD3o+++yz5vLRo0fj+eefv2CfU6dOrfgvGK6++uoYGhrq6Bz0FnGkq87/sb3Tp09Hf39/XHnllfHQQw/FDTfcEIODg/HAAw809xkeHu744zT79u2L0dHR5vprr70WAwMDcdVVV8WePXtiZGQkrr/++ub2YrEYZ8+e7egM9B5xpKtuueWW+O6771Z8b3p6Oj788MP4/fffY3Fxsfn93bt3x+zsbFfm+P7771dEuF6vx19//RUnT56Mf/75p/n94eHhmJ2d7YnHlOgucaTrbrvttqjVavHyyy+n20dHR+PEiRPx66+/djVKR44ciZMnT8b+/fsv2HbttdfGBx98EHNzc26niYiIwszMTEu/AuWyyy7r9iwAG6KVOxRXjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgETLcWw0Gt2cA2BDtNqyluNYq9XWPAzAVtFqy1qOY6VSWfMwAFtFqy1r6z1Ht9ZAL2unYW3F0dUj0MsWFxdb3retONZqNVePQE9qNBpRr9db3r/tR3nm5+fbPQRg07XbrrbjuLy87PYa6CmVSiWWl5fbOmZND4FXq1WP9gA9oVarRbVabfu4Nf+EzOLioitIYEurVCptfQhzvnX9+GC1Wo25ubn1nAKgK+bm5tZ0xXhO/3oHaDQaMTs7G6VSKcrl8npPB7AulUplXVE8Z91xPKdarUa1Wo2+vr4olUrR39+xUwOsql6vR7VajaWlpY6ds+MFW1paioWFhU6fFmBD+ZVlAAlxBEiII0BCHAES4giQEEeAhDgCJP4H6/Y8YKqxICUAAAAASUVORK5CYII="},1151:(e,i,n)=>{n.d(i,{Z:()=>s,a:()=>d});var t=n(7294);const r={},a=t.createContext(r);function d(e){const i=t.useContext(a);return t.useMemo((function(){return"function"==typeof e?e(i):{...i,...e}}),[i,e])}function s(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:d(e.components),t.createElement(a.Provider,{value:i},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/f477c445.a180dde0.js b/assets/js/f477c445.a180dde0.js deleted file mode 100644 index 3c3590c..0000000 --- a/assets/js/f477c445.a180dde0.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkreact_native_android_widget_docs=self.webpackChunkreact_native_android_widget_docs||[]).push([[9990],{5733:(e,i,n)=>{n.r(i),n.d(i,{assets:()=>c,contentTitle:()=>o,default:()=>g,frontMatter:()=>s,metadata:()=>l,toc:()=>u});var t=n(5893),r=n(1151),a=n(4866),d=n(5162);const s={sidebar_position:4},o="Register widget",l={id:"tutorial/register-widget",title:"Register widget",description:"In order to register our widget so that it can be selected from the launchers widget picker, we need to tell the android app some information about the widget.",source:"@site/docs/tutorial/register-widget.md",sourceDirName:"tutorial",slug:"/tutorial/register-widget",permalink:"/react-native-android-widget/docs/tutorial/register-widget",draft:!1,unlisted:!1,editUrl:"https://github.com/sAleksovski/react-native-android-widget/tree/master/docs/docs/tutorial/register-widget.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{sidebar_position:4},sidebar:"default",previous:{title:"Register task handler",permalink:"/react-native-android-widget/docs/tutorial/register-task-handler"},next:{title:"Register widget in Expo",permalink:"/react-native-android-widget/docs/tutorial/register-widget-expo"}},c={},u=[{value:"Add a widget provider class",id:"add-a-widget-provider-class",level:2},{value:"Create widget preview image",id:"create-widget-preview-image",level:2},{value:"Add widget description string (Optional)",id:"add-widget-description-string-optional",level:2},{value:"Add a widget provider xml file",id:"add-a-widget-provider-xml-file",level:2},{value:"Add services in AndroidManifest.xml",id:"add-services-in-androidmanifestxml",level:2},{value:"Add widget receiver in AndroidManifest.xml",id:"add-widget-receiver-in-androidmanifestxml",level:2},{value:"Add custom fonts used in widgets",id:"add-custom-fonts-used-in-widgets",level:2}];function h(e){const i={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.h1,{id:"register-widget",children:"Register widget"}),"\n",(0,t.jsx)(i.p,{children:"In order to register our widget so that it can be selected from the launchers widget picker, we need to tell the android app some information about the widget."}),"\n",(0,t.jsx)(i.h2,{id:"add-a-widget-provider-class",children:"Add a widget provider class"}),"\n",(0,t.jsxs)(i.p,{children:["Create a new package ",(0,t.jsx)(i.code,{children:"widget"})," in the native android app."]}),"\n","\n","\n",(0,t.jsxs)(a.Z,{children:[(0,t.jsxs)(d.Z,{value:"Java",label:"Java",default:!0,children:[(0,t.jsxs)(i.p,{children:["Inside it create a class ",(0,t.jsx)(i.code,{children:"Hello.java"})]}),(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-java",metastring:'title="android/app/src/main/java/com/yourapppackage/widget/Hello.java"',children:"package com.yourapppackage.widget;\n\nimport com.reactnativeandroidwidget.RNWidgetProvider;\n\npublic class Hello extends RNWidgetProvider {\n}\n"})})]}),(0,t.jsxs)(d.Z,{value:"Kotlin",label:"Kotlin",children:[(0,t.jsxs)(i.p,{children:["Inside it create a class ",(0,t.jsx)(i.code,{children:"Hello.kt"})]}),(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-kotlin",metastring:'title="android/app/src/main/java/com/yourapppackage/widget/Hello.kt"',children:"package com.yourapppackage.widget\n\nimport com.reactnativeandroidwidget.RNWidgetProvider\n\nclass Hello : RNWidgetProvider() {\n}\n"})})]})]}),"\n",(0,t.jsxs)(i.p,{children:["The class ",(0,t.jsx)(i.strong,{children:"name"})," will be used to reference our widget."]}),"\n",(0,t.jsx)(i.h2,{id:"create-widget-preview-image",children:"Create widget preview image"}),"\n",(0,t.jsx)(i.p,{children:"When the android launcher shows the widget select popup, we can show a screenshot of our widget to give the user an idea what the widget looks like."}),"\n",(0,t.jsxs)(i.p,{children:["Take a screenshot of the widget, and place it inside ",(0,t.jsx)(i.code,{children:"android/app/src/main/res/drawable/hello_preview.png"})]}),"\n",(0,t.jsx)("pre",{children:"android/app/src/main/res/drawable/hello_preview.png"}),"\n",(0,t.jsx)(i.p,{children:(0,t.jsx)(i.img,{alt:"Hello Widget Preview",src:n(6945).Z+"",width:"327",height:"208"})}),"\n",(0,t.jsx)(i.h2,{id:"add-widget-description-string-optional",children:"Add widget description string (Optional)"}),"\n",(0,t.jsxs)(i.p,{children:["When the android launcher shows the widget select popup, under the name of the widget it can show an optional description about the widget. If we want to show a description for our widget, we need to add a description string in ",(0,t.jsx)(i.code,{children:"strings.xml"})]}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-xml",metastring:'title="android/app/src/main/res/values/strings.xml"',children:'\n\n My App Name\n This is my first widget\n\n'})}),"\n",(0,t.jsx)(i.h2,{id:"add-a-widget-provider-xml-file",children:"Add a widget provider xml file"}),"\n",(0,t.jsx)(i.p,{children:"Create a new xml file in the resources directory containing the details about the widget."}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-xml",metastring:'title="android/app/src/main/res/xml/widgetprovider_hello.xml"',children:'\n\n\n'})}),"\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsxs)(i.li,{children:[(0,t.jsx)(i.code,{children:"android:updatePeriodMillis"})," How often, in milliseconds, that this AppWidget wants to be updated. The task handler will be called with ",(0,t.jsx)(i.code,{children:"widgetAction = 'UPDATE_WIDGET'"}),". See the official docs ",(0,t.jsx)(i.a,{href:"https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo.html#updatePeriodMillis",children:"here"})]}),"\n",(0,t.jsxs)(i.li,{children:[(0,t.jsx)(i.code,{children:"android:previewImage"})," should reference the preview image we added previously"]}),"\n",(0,t.jsxs)(i.li,{children:[(0,t.jsx)(i.code,{children:"android:description"})," can be added or not, depending on if we added a description in the previous step"]}),"\n"]}),"\n",(0,t.jsx)(i.h2,{id:"add-services-in-androidmanifestxml",children:"Add services in AndroidManifest.xml"}),"\n",(0,t.jsxs)(i.p,{children:["In order to use the ",(0,t.jsx)(i.a,{href:"/react-native-android-widget/docs/primitives/list-widget",children:"ListWidget"})," we need to add a ",(0,t.jsx)(i.code,{children:"RNWidgetCollectionService"})," service."]}),"\n",(0,t.jsxs)(i.p,{children:["Under the application section in the manifest, add a new ",(0,t.jsx)(i.code,{children:"RNWidgetCollectionService"})," service. This service will be shared between all widgets, so it needs to be added only once."]}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-xml",metastring:'title="android/app/src/main/AndroidManifest.xml"',children:'\n ...\n \n\n \n \n\n \n \n\n'})}),"\n",(0,t.jsx)(i.h2,{id:"add-widget-receiver-in-androidmanifestxml",children:"Add widget receiver in AndroidManifest.xml"}),"\n",(0,t.jsx)(i.p,{children:"Finally, we need to add a receiver for our widget, that will receive system events (like widget added, widget resized...)"}),"\n",(0,t.jsxs)(i.p,{children:["In ",(0,t.jsx)(i.code,{children:"AndroidManifest.xml"}),", add a receiver for the widget"]}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-xml",metastring:'title="android/app/src/main/AndroidManifest.xml"',children:'\n ...\n \n\n \n \n\n \n\n \n \n \n \n \n \n \n \n\n'})}),"\n",(0,t.jsx)(i.p,{children:"For the receiver"}),"\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsxs)(i.li,{children:[(0,t.jsx)(i.code,{children:"android:name"})," myst be ",(0,t.jsx)(i.code,{children:".widget.WidgetName"})," (same as the Java class extending ",(0,t.jsx)(i.code,{children:"RNWidgetProvider"}),")"]}),"\n",(0,t.jsxs)(i.li,{children:[(0,t.jsx)(i.code,{children:"android:label"})," will be shown in the widget picker"]}),"\n"]}),"\n",(0,t.jsx)(i.h2,{id:"add-custom-fonts-used-in-widgets",children:"Add custom fonts used in widgets"}),"\n",(0,t.jsxs)(i.p,{children:["If we used a custom font in our widget, we must copy the font file(s) to ",(0,t.jsx)(i.code,{children:"android/app/src/main/assets/fonts"}),". The ",(0,t.jsx)(i.code,{children:"fontFamily"})," style prop will match the file by name."]}),"\n",(0,t.jsxs)(i.p,{children:["For example, ",(0,t.jsx)(i.code,{children:"android/app/src/main/assets/fonts/Inter.ttf"})]})]})}function g(e={}){const{wrapper:i}={...(0,r.a)(),...e.components};return i?(0,t.jsx)(i,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},5162:(e,i,n)=>{n.d(i,{Z:()=>d});n(7294);var t=n(512);const r={tabItem:"tabItem_Ymn6"};var a=n(5893);function d(e){let{children:i,hidden:n,className:d}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,t.Z)(r.tabItem,d),hidden:n,children:i})}},4866:(e,i,n)=>{n.d(i,{Z:()=>b});var t=n(7294),r=n(512),a=n(2466),d=n(6550),s=n(469),o=n(1980),l=n(7392),c=n(12);function u(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:i}=e;return!!i&&"object"==typeof i&&"value"in i}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:i,children:n}=e;return(0,t.useMemo)((()=>{const e=i??function(e){return u(e).map((e=>{let{props:{value:i,label:n,attributes:t,default:r}}=e;return{value:i,label:n,attributes:t,default:r}}))}(n);return function(e){const i=(0,l.l)(e,((e,i)=>e.value===i.value));if(i.length>0)throw new Error(`Docusaurus error: Duplicate values "${i.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[i,n])}function g(e){let{value:i,tabValues:n}=e;return n.some((e=>e.value===i))}function p(e){let{queryString:i=!1,groupId:n}=e;const r=(0,d.k6)(),a=function(e){let{queryString:i=!1,groupId:n}=e;if("string"==typeof i)return i;if(!1===i)return null;if(!0===i&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:i,groupId:n});return[(0,o._X)(a),(0,t.useCallback)((e=>{if(!a)return;const i=new URLSearchParams(r.location.search);i.set(a,e),r.replace({...r.location,search:i.toString()})}),[a,r])]}function m(e){const{defaultValue:i,queryString:n=!1,groupId:r}=e,a=h(e),[d,o]=(0,t.useState)((()=>function(e){let{defaultValue:i,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(i){if(!g({value:i,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${i}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return i}const t=n.find((e=>e.default))??n[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:i,tabValues:a}))),[l,u]=p({queryString:n,groupId:r}),[m,v]=function(e){let{groupId:i}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(i),[r,a]=(0,c.Nk)(n);return[r,(0,t.useCallback)((e=>{n&&a.set(e)}),[n,a])]}({groupId:r}),f=(()=>{const e=l??m;return g({value:e,tabValues:a})?e:null})();(0,s.Z)((()=>{f&&o(f)}),[f]);return{selectedValue:d,selectValue:(0,t.useCallback)((e=>{if(!g({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);o(e),u(e),v(e)}),[u,v,a]),tabValues:a}}var v=n(2389);const f={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var w=n(5893);function x(e){let{className:i,block:n,selectedValue:t,selectValue:d,tabValues:s}=e;const o=[],{blockElementScrollPositionUntilNextRender:l}=(0,a.o5)(),c=e=>{const i=e.currentTarget,n=o.indexOf(i),r=s[n].value;r!==t&&(l(i),d(r))},u=e=>{let i=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=o.indexOf(e.currentTarget)+1;i=o[n]??o[0];break}case"ArrowLeft":{const n=o.indexOf(e.currentTarget)-1;i=o[n]??o[o.length-1];break}}i?.focus()};return(0,w.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.Z)("tabs",{"tabs--block":n},i),children:s.map((e=>{let{value:i,label:n,attributes:a}=e;return(0,w.jsx)("li",{role:"tab",tabIndex:t===i?0:-1,"aria-selected":t===i,ref:e=>o.push(e),onKeyDown:u,onClick:c,...a,className:(0,r.Z)("tabs__item",f.tabItem,a?.className,{"tabs__item--active":t===i}),children:n??i},i)}))})}function A(e){let{lazy:i,children:n,selectedValue:r}=e;const a=(Array.isArray(n)?n:[n]).filter(Boolean);if(i){const e=a.find((e=>e.props.value===r));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,w.jsx)("div",{className:"margin-top--md",children:a.map(((e,i)=>(0,t.cloneElement)(e,{key:i,hidden:e.props.value!==r})))})}function j(e){const i=m(e);return(0,w.jsxs)("div",{className:(0,r.Z)("tabs-container",f.tabList),children:[(0,w.jsx)(x,{...e,...i}),(0,w.jsx)(A,{...e,...i})]})}function b(e){const i=(0,v.Z)();return(0,w.jsx)(j,{...e,children:u(e.children)},String(i))}},6945:(e,i,n)=>{n.d(i,{Z:()=>t});const t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUcAAADQCAYAAACUXaMkAAAABHNCSVQICAgIfAhkiAAACTdJREFUeJzt3UtoXAUbgOFvJslMc/FSFItCK1YqUhAiukh0YV0o1p3QhZeVgiAiuhJERJGibkSxbisKgghqiYvWhYIomjYgqLgRrCItKO1CzMUkc0nmX0iHhn7NP5PMJBn7PBA4J+cyX6F9OWfmJC3MzMw0AoAVips9AMBWJI4ACXEESIgjQEIcARLiCJDo7/YLFAqFbr8EcIlqNLr3JGLH41gul6NUKnX6tACrqlarUalUOna+jsSxUCjE0NBQFIvu0oHNUSqVolQqxfLycszPz6/7qnLdcXSlCGwlxWIxRkZG1n0lua5LveHhYWEEtqRSqRTDw8NrPn7NcRweHnYbDWxpxWJxzYFcU90GBweFEegJxWIxBgcH2z+u3QMGBgaiv7/rTwABdEx/f3/b3Wo7jtu2bWv3EIBN1+7VY1txLJfLbZ0cYCtpp2FtxdEn00Ava6dhPlUBSLQcR+81Av8Frbas5Tj6hBr4L2i1ZS3H0W/XAf4LWm2Z9xwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCMxPj4eY2NjMTY2FsePH2/5uMnJyeZxY2NjXZvvjz/+WPV1Dh482Nz23HPPdW0OLi39mz0Am29qaioajUZERExPT7d83PT0dExNTXVrrKZKpbLq6/z222/N7dddd13X5+HS4MoRICGOAAlxBEh4z5ENV6vVYmlpKfr6+mJgYGBTZlheXo56vR7Ly8vR398f/f3+KbCSK0c2zPj4eJRKpSiVSjE4OBilUikGBgbijjvu2LAZfvnll7jiiiuir68vyuVyDA4OxsDAQAwNDcWLL764YXOw9YkjXff5559HoVCIEydORK1WW7GtXq/H8ePHo6+vL7744ouuznHnnXfGTTfdFDMzMxdsW1hYiIMHD8bQ0FAsLCx0dQ56g3sJumpycjLuvffe5nqhUIgnn3wy9u7dGz///HO8/fbbEfHvbe4999wTp06dip07d3Z8jltvvTV++OGH5nq5XI4nnngitm/fHhMTE81tCwsLcfnll18QcS494khX3X333c3lAwcOxEcffbRi+6FDh+LAgQPxySefRETErl27ms9cdsqRI0dWhPGtt96Kp59+urn+0ksvxenTp2P37t1Rr9ejXq/Hjh074syZMx2dg97itpoV9u/fH4VCoaWv+++/f9Vzvf7661GtViMiYs+ePReE8ZyPP/44SqVSc/2nn37q3B8oIh5++OHm8iOPPLIijOfs3Lkzfvzxx+b62bNn4++//+7oHPQWcaRr3njjjebyxMTEqvu+//77zeU333yzYzPMz89HpVJprr/zzjsX3Xfv3r2xffv25vqzzz7bsTnoPeJI1/z555/N5ZtvvjmWl5cv+nX77bc393333Xc7NsOnn37aXC4UClEul1fd//xPrA8fPtyxOeg94sgKx44dWzVi538dPXq05fP29fWt+nXjjTd25c/z7bffNpfPf//zYsbHx7syB73HBzKscO79xFb33erOf//ymmuu+b/7j4yMdHMceog4siG+/PLLTXnd0dHR+PrrryNi5W3+xWTPQHJpEkc2xL59+zblde+66644dOhQRER89dVX/3f/b775ptsj0SO850jX7Nixo7l87NixTZnhvvvuW7E+Nze36v6vvPJKc/mZZ57pykz0BnGka5566qnm8mOPPbbqvo8//ngUi8V49NFHY3JysmMzDA0NxbZt25rrDz744EX3nZqaWvHLfl999dWOzUHvEUe65oUXXohi8d+/YmfOnIldu3bF0tLSBftNTEzE4cOHo9FoxHvvvdfxD3o+++yz5vLRo0fj+eefv2CfU6dOrfgvGK6++uoYGhrq6Bz0FnGkq87/sb3Tp09Hf39/XHnllfHQQw/FDTfcEIODg/HAAw809xkeHu744zT79u2L0dHR5vprr70WAwMDcdVVV8WePXtiZGQkrr/++ub2YrEYZ8+e7egM9B5xpKtuueWW+O6771Z8b3p6Oj788MP4/fffY3Fxsfn93bt3x+zsbFfm+P7771dEuF6vx19//RUnT56Mf/75p/n94eHhmJ2d7YnHlOgucaTrbrvttqjVavHyyy+n20dHR+PEiRPx66+/djVKR44ciZMnT8b+/fsv2HbttdfGBx98EHNzc26niYiIwszMTEu/AuWyyy7r9iwAG6KVOxRXjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgIQ4AiTEESAhjgAJcQRIiCNAQhwBEuIIkBBHgETLcWw0Gt2cA2BDtNqyluNYq9XWPAzAVtFqy1qOY6VSWfMwAFtFqy1r6z1Ht9ZAL2unYW3F0dUj0MsWFxdb3retONZqNVePQE9qNBpRr9db3r/tR3nm5+fbPQRg07XbrrbjuLy87PYa6CmVSiWWl5fbOmZND4FXq1WP9gA9oVarRbVabfu4Nf+EzOLioitIYEurVCptfQhzvnX9+GC1Wo25ubn1nAKgK+bm5tZ0xXhO/3oHaDQaMTs7G6VSKcrl8npPB7AulUplXVE8Z91xPKdarUa1Wo2+vr4olUrR39+xUwOsql6vR7VajaWlpY6ds+MFW1paioWFhU6fFmBD+ZVlAAlxBEiII0BCHAES4giQEEeAhDgCJP4H6/Y8YKqxICUAAAAASUVORK5CYII="},1151:(e,i,n)=>{n.d(i,{Z:()=>s,a:()=>d});var t=n(7294);const r={},a=t.createContext(r);function d(e){const i=t.useContext(a);return t.useMemo((function(){return"function"==typeof e?e(i):{...i,...e}}),[i,e])}function s(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:d(e.components),t.createElement(a.Provider,{value:i},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.b6825bad.js b/assets/js/runtime~main.8a6864c7.js similarity index 99% rename from assets/js/runtime~main.b6825bad.js rename to assets/js/runtime~main.8a6864c7.js index 436afde..83f9b5c 100644 --- a/assets/js/runtime~main.b6825bad.js +++ b/assets/js/runtime~main.8a6864c7.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,f,b,t,c={},r={};function d(e){var a=r[e];if(void 0!==a)return a.exports;var f=r[e]={exports:{}};return c[e].call(f.exports,f,f.exports,d),f.exports}d.m=c,e=[],d.O=(a,f,b,t)=>{if(!f){var c=1/0;for(i=0;i=t)&&Object.keys(d.O).every((e=>d.O[e](f[o])))?f.splice(o--,1):(r=!1,t0&&e[i-1][2]>t;i--)e[i]=e[i-1];e[i]=[f,b,t]},d.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return d.d(a,{a:a}),a},f=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,b){if(1&b&&(e=this(e)),8&b)return e;if("object"==typeof e&&e){if(4&b&&e.__esModule)return e;if(16&b&&"function"==typeof e.then)return e}var t=Object.create(null);d.r(t);var c={};a=a||[null,f({}),f([]),f(f)];for(var r=2&b&&e;"object"==typeof r&&!~a.indexOf(r);r=f(r))Object.getOwnPropertyNames(r).forEach((a=>c[a]=()=>e[a]));return c.default=()=>e,d.d(t,c),t},d.d=(e,a)=>{for(var f in a)d.o(a,f)&&!d.o(e,f)&&Object.defineProperty(e,f,{enumerable:!0,get:a[f]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce(((a,f)=>(d.f[f](e,a),a)),[])),d.u=e=>"assets/js/"+({53:"935f2afb",265:"94be2f97",322:"1bb5842c",924:"e73c34ba",1069:"cc1aedd7",1161:"4787fd9f",1188:"aa86ff20",1328:"8d25c1fb",1400:"24767a4f",1408:"5b19e069",1493:"407354e8",1744:"70097127",1946:"31e029c9",2097:"b0736eaa",2321:"c56934f7",2386:"d5b87c6b",2814:"74b23640",2894:"569e2f67",2934:"0124b8bf",3153:"ff470113",3159:"bcda6bdc",3237:"1df93b7f",3814:"5d454204",3895:"17c5701b",4331:"fdf94c78",4368:"a94703ab",4483:"3666eb9e",5020:"0314676f",5073:"7ad22d07",5087:"1476a8a4",5187:"49b00a7f",5672:"a66dadf2",5710:"4b7010bf",5937:"ff301dc0",6090:"2eb66e86",6117:"82b1394b",6516:"bcaac1db",6573:"399d2a39",6831:"281947f5",6971:"c377a04b",6998:"334fbae1",7071:"7135efbc",7291:"01e0afe4",7374:"0cb0f7cb",7386:"ef61de09",7473:"181303e3",7655:"ead7330c",7679:"a3102611",7918:"17896441",7938:"3fa31a86",8518:"a7bd4aaa",8558:"f600eb30",8646:"9958a938",8888:"c10b2ba3",8998:"730f732a",9069:"7f5eb84b",9209:"95f41f41",9239:"3a45f1c7",9484:"1cfe139a",9557:"7402041a",9661:"5e95c892",9817:"14eb3368",9896:"7d14206d",9945:"adcb0710",9990:"f477c445"}[e]||e)+"."+{53:"08ad04fc",265:"7ccb10d4",322:"0dda42b8",924:"0d8be8ea",1069:"79c64f57",1161:"15fa7793",1188:"19cba91b",1328:"2b16981b",1400:"74b80371",1408:"15947364",1493:"79755485",1744:"e0004669",1772:"44679dd4",1946:"f33e7bc2",2097:"aad426e9",2321:"8e3103e5",2386:"01046f78",2814:"b7ba9192",2894:"d8c3de38",2934:"e95477ab",3153:"4a5ebaee",3159:"82e92352",3237:"46e4da64",3814:"2c28231e",3895:"2929a44e",4331:"9b77ca85",4368:"936e2c37",4483:"78798a89",5020:"e709c05d",5073:"60a72768",5087:"956acaa2",5187:"fcdcb0c2",5672:"804eb26b",5710:"cdfc4910",5937:"08dc00c3",6090:"13cacfbe",6117:"c3d1f722",6516:"e2c36ed3",6573:"7662f1b6",6831:"046e7e9b",6971:"6b285835",6998:"8f27ce28",7071:"85b2a445",7291:"34057d77",7374:"196c8d6b",7386:"8ca3a6aa",7473:"43cd7c29",7655:"bea349ed",7679:"babbc858",7918:"4208fb36",7938:"cb6ecfc4",8518:"9935b610",8558:"1218363a",8646:"8cb4cff7",8888:"3231a4da",8998:"8e33be50",9069:"5347e75f",9209:"09ea0980",9239:"f57d87b2",9484:"35bdaf71",9557:"c9221ca9",9661:"f07c34e3",9817:"dbedd089",9896:"94a40fa9",9945:"1aa3f7c6",9990:"a180dde0"}[e]+".js",d.miniCssF=e=>{},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),b={},t="react-native-android-widget-docs:",d.l=(e,a,f,c)=>{if(b[e])b[e].push(a);else{var r,o;if(void 0!==f)for(var n=document.getElementsByTagName("script"),i=0;i{r.onerror=r.onload=null,clearTimeout(s);var t=b[e];if(delete b[e],r.parentNode&&r.parentNode.removeChild(r),t&&t.forEach((e=>e(f))),a)return a(f)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=l.bind(null,r.onerror),r.onload=l.bind(null,r.onload),o&&document.head.appendChild(r)}},d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.p="/react-native-android-widget/",d.gca=function(e){return e={17896441:"7918",70097127:"1744","935f2afb":"53","94be2f97":"265","1bb5842c":"322",e73c34ba:"924",cc1aedd7:"1069","4787fd9f":"1161",aa86ff20:"1188","8d25c1fb":"1328","24767a4f":"1400","5b19e069":"1408","407354e8":"1493","31e029c9":"1946",b0736eaa:"2097",c56934f7:"2321",d5b87c6b:"2386","74b23640":"2814","569e2f67":"2894","0124b8bf":"2934",ff470113:"3153",bcda6bdc:"3159","1df93b7f":"3237","5d454204":"3814","17c5701b":"3895",fdf94c78:"4331",a94703ab:"4368","3666eb9e":"4483","0314676f":"5020","7ad22d07":"5073","1476a8a4":"5087","49b00a7f":"5187",a66dadf2:"5672","4b7010bf":"5710",ff301dc0:"5937","2eb66e86":"6090","82b1394b":"6117",bcaac1db:"6516","399d2a39":"6573","281947f5":"6831",c377a04b:"6971","334fbae1":"6998","7135efbc":"7071","01e0afe4":"7291","0cb0f7cb":"7374",ef61de09:"7386","181303e3":"7473",ead7330c:"7655",a3102611:"7679","3fa31a86":"7938",a7bd4aaa:"8518",f600eb30:"8558","9958a938":"8646",c10b2ba3:"8888","730f732a":"8998","7f5eb84b":"9069","95f41f41":"9209","3a45f1c7":"9239","1cfe139a":"9484","7402041a":"9557","5e95c892":"9661","14eb3368":"9817","7d14206d":"9896",adcb0710:"9945",f477c445:"9990"}[e]||e,d.p+d.u(e)},(()=>{var e={1303:0,532:0};d.f.j=(a,f)=>{var b=d.o(e,a)?e[a]:void 0;if(0!==b)if(b)f.push(b[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var t=new Promise(((f,t)=>b=e[a]=[f,t]));f.push(b[2]=t);var c=d.p+d.u(a),r=new Error;d.l(c,(f=>{if(d.o(e,a)&&(0!==(b=e[a])&&(e[a]=void 0),b)){var t=f&&("load"===f.type?"missing":f.type),c=f&&f.target&&f.target.src;r.message="Loading chunk "+a+" failed.\n("+t+": "+c+")",r.name="ChunkLoadError",r.type=t,r.request=c,b[1](r)}}),"chunk-"+a,a)}},d.O.j=a=>0===e[a];var a=(a,f)=>{var b,t,c=f[0],r=f[1],o=f[2],n=0;if(c.some((a=>0!==e[a]))){for(b in r)d.o(r,b)&&(d.m[b]=r[b]);if(o)var i=o(d)}for(a&&a(f);n{"use strict";var e,a,f,b,t,c={},r={};function d(e){var a=r[e];if(void 0!==a)return a.exports;var f=r[e]={exports:{}};return c[e].call(f.exports,f,f.exports,d),f.exports}d.m=c,e=[],d.O=(a,f,b,t)=>{if(!f){var c=1/0;for(i=0;i=t)&&Object.keys(d.O).every((e=>d.O[e](f[o])))?f.splice(o--,1):(r=!1,t0&&e[i-1][2]>t;i--)e[i]=e[i-1];e[i]=[f,b,t]},d.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return d.d(a,{a:a}),a},f=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,b){if(1&b&&(e=this(e)),8&b)return e;if("object"==typeof e&&e){if(4&b&&e.__esModule)return e;if(16&b&&"function"==typeof e.then)return e}var t=Object.create(null);d.r(t);var c={};a=a||[null,f({}),f([]),f(f)];for(var r=2&b&&e;"object"==typeof r&&!~a.indexOf(r);r=f(r))Object.getOwnPropertyNames(r).forEach((a=>c[a]=()=>e[a]));return c.default=()=>e,d.d(t,c),t},d.d=(e,a)=>{for(var f in a)d.o(a,f)&&!d.o(e,f)&&Object.defineProperty(e,f,{enumerable:!0,get:a[f]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce(((a,f)=>(d.f[f](e,a),a)),[])),d.u=e=>"assets/js/"+({53:"935f2afb",265:"94be2f97",322:"1bb5842c",924:"e73c34ba",1069:"cc1aedd7",1161:"4787fd9f",1188:"aa86ff20",1328:"8d25c1fb",1400:"24767a4f",1408:"5b19e069",1493:"407354e8",1744:"70097127",1946:"31e029c9",2097:"b0736eaa",2321:"c56934f7",2386:"d5b87c6b",2814:"74b23640",2894:"569e2f67",2934:"0124b8bf",3153:"ff470113",3159:"bcda6bdc",3237:"1df93b7f",3814:"5d454204",3895:"17c5701b",4331:"fdf94c78",4368:"a94703ab",4483:"3666eb9e",5020:"0314676f",5073:"7ad22d07",5087:"1476a8a4",5187:"49b00a7f",5672:"a66dadf2",5710:"4b7010bf",5937:"ff301dc0",6090:"2eb66e86",6117:"82b1394b",6516:"bcaac1db",6573:"399d2a39",6831:"281947f5",6971:"c377a04b",6998:"334fbae1",7071:"7135efbc",7291:"01e0afe4",7374:"0cb0f7cb",7386:"ef61de09",7473:"181303e3",7655:"ead7330c",7679:"a3102611",7918:"17896441",7938:"3fa31a86",8518:"a7bd4aaa",8558:"f600eb30",8646:"9958a938",8888:"c10b2ba3",8998:"730f732a",9069:"7f5eb84b",9209:"95f41f41",9239:"3a45f1c7",9484:"1cfe139a",9557:"7402041a",9661:"5e95c892",9817:"14eb3368",9896:"7d14206d",9945:"adcb0710",9990:"f477c445"}[e]||e)+"."+{53:"08ad04fc",265:"7ccb10d4",322:"0dda42b8",924:"0d8be8ea",1069:"79c64f57",1161:"15fa7793",1188:"19cba91b",1328:"2b16981b",1400:"74b80371",1408:"15947364",1493:"79755485",1744:"e0004669",1772:"44679dd4",1946:"f33e7bc2",2097:"aad426e9",2321:"8e3103e5",2386:"01046f78",2814:"b7ba9192",2894:"d8c3de38",2934:"e95477ab",3153:"4a5ebaee",3159:"82e92352",3237:"46e4da64",3814:"2c28231e",3895:"2929a44e",4331:"9b77ca85",4368:"936e2c37",4483:"78798a89",5020:"e709c05d",5073:"60a72768",5087:"956acaa2",5187:"fcdcb0c2",5672:"804eb26b",5710:"cdfc4910",5937:"08dc00c3",6090:"13cacfbe",6117:"c3d1f722",6516:"e2c36ed3",6573:"7662f1b6",6831:"046e7e9b",6971:"6b285835",6998:"8f27ce28",7071:"85b2a445",7291:"34057d77",7374:"196c8d6b",7386:"8ca3a6aa",7473:"43cd7c29",7655:"bea349ed",7679:"babbc858",7918:"4208fb36",7938:"cb6ecfc4",8518:"9935b610",8558:"1218363a",8646:"8cb4cff7",8888:"3231a4da",8998:"8e33be50",9069:"5347e75f",9209:"09ea0980",9239:"f57d87b2",9484:"35bdaf71",9557:"c9221ca9",9661:"f07c34e3",9817:"dbedd089",9896:"94a40fa9",9945:"1aa3f7c6",9990:"974e1f48"}[e]+".js",d.miniCssF=e=>{},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),b={},t="react-native-android-widget-docs:",d.l=(e,a,f,c)=>{if(b[e])b[e].push(a);else{var r,o;if(void 0!==f)for(var n=document.getElementsByTagName("script"),i=0;i{r.onerror=r.onload=null,clearTimeout(s);var t=b[e];if(delete b[e],r.parentNode&&r.parentNode.removeChild(r),t&&t.forEach((e=>e(f))),a)return a(f)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=l.bind(null,r.onerror),r.onload=l.bind(null,r.onload),o&&document.head.appendChild(r)}},d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.p="/react-native-android-widget/",d.gca=function(e){return e={17896441:"7918",70097127:"1744","935f2afb":"53","94be2f97":"265","1bb5842c":"322",e73c34ba:"924",cc1aedd7:"1069","4787fd9f":"1161",aa86ff20:"1188","8d25c1fb":"1328","24767a4f":"1400","5b19e069":"1408","407354e8":"1493","31e029c9":"1946",b0736eaa:"2097",c56934f7:"2321",d5b87c6b:"2386","74b23640":"2814","569e2f67":"2894","0124b8bf":"2934",ff470113:"3153",bcda6bdc:"3159","1df93b7f":"3237","5d454204":"3814","17c5701b":"3895",fdf94c78:"4331",a94703ab:"4368","3666eb9e":"4483","0314676f":"5020","7ad22d07":"5073","1476a8a4":"5087","49b00a7f":"5187",a66dadf2:"5672","4b7010bf":"5710",ff301dc0:"5937","2eb66e86":"6090","82b1394b":"6117",bcaac1db:"6516","399d2a39":"6573","281947f5":"6831",c377a04b:"6971","334fbae1":"6998","7135efbc":"7071","01e0afe4":"7291","0cb0f7cb":"7374",ef61de09:"7386","181303e3":"7473",ead7330c:"7655",a3102611:"7679","3fa31a86":"7938",a7bd4aaa:"8518",f600eb30:"8558","9958a938":"8646",c10b2ba3:"8888","730f732a":"8998","7f5eb84b":"9069","95f41f41":"9209","3a45f1c7":"9239","1cfe139a":"9484","7402041a":"9557","5e95c892":"9661","14eb3368":"9817","7d14206d":"9896",adcb0710:"9945",f477c445:"9990"}[e]||e,d.p+d.u(e)},(()=>{var e={1303:0,532:0};d.f.j=(a,f)=>{var b=d.o(e,a)?e[a]:void 0;if(0!==b)if(b)f.push(b[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var t=new Promise(((f,t)=>b=e[a]=[f,t]));f.push(b[2]=t);var c=d.p+d.u(a),r=new Error;d.l(c,(f=>{if(d.o(e,a)&&(0!==(b=e[a])&&(e[a]=void 0),b)){var t=f&&("load"===f.type?"missing":f.type),c=f&&f.target&&f.target.src;r.message="Loading chunk "+a+" failed.\n("+t+": "+c+")",r.name="ChunkLoadError",r.type=t,r.request=c,b[1](r)}}),"chunk-"+a,a)}},d.O.j=a=>0===e[a];var a=(a,f)=>{var b,t,c=f[0],r=f[1],o=f[2],n=0;if(c.some((a=>0!==e[a]))){for(b in r)d.o(r,b)&&(d.m[b]=r[b]);if(o)var i=o(d)}for(a&&a(f);n - + diff --git a/docs/api/register-widget-configuration-screen.html b/docs/api/register-widget-configuration-screen.html index 3b9496e..c310ce9 100644 --- a/docs/api/register-widget-configuration-screen.html +++ b/docs/api/register-widget-configuration-screen.html @@ -7,7 +7,7 @@ - + diff --git a/docs/api/register-widget-task-handler.html b/docs/api/register-widget-task-handler.html index bd00683..8d4f2a5 100644 --- a/docs/api/register-widget-task-handler.html +++ b/docs/api/register-widget-task-handler.html @@ -7,7 +7,7 @@ - + diff --git a/docs/api/request-widget-update-by-id.html b/docs/api/request-widget-update-by-id.html index 15c946e..2305de1 100644 --- a/docs/api/request-widget-update-by-id.html +++ b/docs/api/request-widget-update-by-id.html @@ -7,7 +7,7 @@ - + diff --git a/docs/api/request-widget-update.html b/docs/api/request-widget-update.html index a654741..af33d45 100644 --- a/docs/api/request-widget-update.html +++ b/docs/api/request-widget-update.html @@ -7,7 +7,7 @@ - + diff --git a/docs/api/widget-preview.html b/docs/api/widget-preview.html index 697382d..bdebec9 100644 --- a/docs/api/widget-preview.html +++ b/docs/api/widget-preview.html @@ -7,7 +7,7 @@ - + diff --git a/docs/demo.html b/docs/demo.html index 9c0de67..bdc265f 100644 --- a/docs/demo.html +++ b/docs/demo.html @@ -7,7 +7,7 @@ - + diff --git a/docs/handling-clicks.html b/docs/handling-clicks.html index e82c317..e3c2ce2 100644 --- a/docs/handling-clicks.html +++ b/docs/handling-clicks.html @@ -7,7 +7,7 @@ - + diff --git a/docs/limitations.html b/docs/limitations.html index 56172a7..7836b58 100644 --- a/docs/limitations.html +++ b/docs/limitations.html @@ -7,7 +7,7 @@ - + diff --git a/docs/primitives/flex-widget.html b/docs/primitives/flex-widget.html index f8e9c58..fb046b3 100644 --- a/docs/primitives/flex-widget.html +++ b/docs/primitives/flex-widget.html @@ -7,7 +7,7 @@ - + diff --git a/docs/primitives/icon-widget.html b/docs/primitives/icon-widget.html index 00873a2..08d6c1c 100644 --- a/docs/primitives/icon-widget.html +++ b/docs/primitives/icon-widget.html @@ -7,7 +7,7 @@ - + diff --git a/docs/primitives/image-widget.html b/docs/primitives/image-widget.html index 05bab26..2c4e340 100644 --- a/docs/primitives/image-widget.html +++ b/docs/primitives/image-widget.html @@ -7,7 +7,7 @@ - + diff --git a/docs/primitives/index.html b/docs/primitives/index.html index 93d6152..e44ef2e 100644 --- a/docs/primitives/index.html +++ b/docs/primitives/index.html @@ -7,7 +7,7 @@ - + diff --git a/docs/primitives/list-widget.html b/docs/primitives/list-widget.html index 048fedf..5c692c6 100644 --- a/docs/primitives/list-widget.html +++ b/docs/primitives/list-widget.html @@ -7,7 +7,7 @@ - + diff --git a/docs/primitives/overlap-widget.html b/docs/primitives/overlap-widget.html index f412c7f..9e6b9cf 100644 --- a/docs/primitives/overlap-widget.html +++ b/docs/primitives/overlap-widget.html @@ -7,7 +7,7 @@ - + diff --git a/docs/primitives/svg-widget.html b/docs/primitives/svg-widget.html index 42b5a5d..71c175d 100644 --- a/docs/primitives/svg-widget.html +++ b/docs/primitives/svg-widget.html @@ -7,7 +7,7 @@ - + diff --git a/docs/primitives/text-widget.html b/docs/primitives/text-widget.html index 39c3b0b..ebe8a70 100644 --- a/docs/primitives/text-widget.html +++ b/docs/primitives/text-widget.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api.html b/docs/public-api.html index ed8f454..297b877 100644 --- a/docs/public-api.html +++ b/docs/public-api.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/BackgroundStyleProps.html b/docs/public-api/interfaces/BackgroundStyleProps.html index 7118fce..e84201f 100644 --- a/docs/public-api/interfaces/BackgroundStyleProps.html +++ b/docs/public-api/interfaces/BackgroundStyleProps.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/BorderStyleProps.html b/docs/public-api/interfaces/BorderStyleProps.html index 9340342..085552b 100644 --- a/docs/public-api/interfaces/BorderStyleProps.html +++ b/docs/public-api/interfaces/BorderStyleProps.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/ClickActionProps.html b/docs/public-api/interfaces/ClickActionProps.html index 36daa71..e2a3b35 100644 --- a/docs/public-api/interfaces/ClickActionProps.html +++ b/docs/public-api/interfaces/ClickActionProps.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/CommonStyleProps.html b/docs/public-api/interfaces/CommonStyleProps.html index e4ae2fb..422c847 100644 --- a/docs/public-api/interfaces/CommonStyleProps.html +++ b/docs/public-api/interfaces/CommonStyleProps.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/FlexWidgetProps.html b/docs/public-api/interfaces/FlexWidgetProps.html index fb9e21c..e248b8c 100644 --- a/docs/public-api/interfaces/FlexWidgetProps.html +++ b/docs/public-api/interfaces/FlexWidgetProps.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/FlexWidgetStyle.html b/docs/public-api/interfaces/FlexWidgetStyle.html index b282a1e..aaac176 100644 --- a/docs/public-api/interfaces/FlexWidgetStyle.html +++ b/docs/public-api/interfaces/FlexWidgetStyle.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/IconWidgetProps.html b/docs/public-api/interfaces/IconWidgetProps.html index b2e849d..c632511 100644 --- a/docs/public-api/interfaces/IconWidgetProps.html +++ b/docs/public-api/interfaces/IconWidgetProps.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/IconWidgetStyle.html b/docs/public-api/interfaces/IconWidgetStyle.html index 026c5db..06ed08f 100644 --- a/docs/public-api/interfaces/IconWidgetStyle.html +++ b/docs/public-api/interfaces/IconWidgetStyle.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/ImageWidgetProps.html b/docs/public-api/interfaces/ImageWidgetProps.html index 0f7f739..192406b 100644 --- a/docs/public-api/interfaces/ImageWidgetProps.html +++ b/docs/public-api/interfaces/ImageWidgetProps.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/ListWidgetProps.html b/docs/public-api/interfaces/ListWidgetProps.html index cdd4243..49bcdb2 100644 --- a/docs/public-api/interfaces/ListWidgetProps.html +++ b/docs/public-api/interfaces/ListWidgetProps.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/ListWidgetStyle.html b/docs/public-api/interfaces/ListWidgetStyle.html index 0548e15..951d62a 100644 --- a/docs/public-api/interfaces/ListWidgetStyle.html +++ b/docs/public-api/interfaces/ListWidgetStyle.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/MarginStyleProps.html b/docs/public-api/interfaces/MarginStyleProps.html index cb53d0c..3eb3ca3 100644 --- a/docs/public-api/interfaces/MarginStyleProps.html +++ b/docs/public-api/interfaces/MarginStyleProps.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/OtherStyleProps.html b/docs/public-api/interfaces/OtherStyleProps.html index b308b4a..317b646 100644 --- a/docs/public-api/interfaces/OtherStyleProps.html +++ b/docs/public-api/interfaces/OtherStyleProps.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/OverlapWidgetProps.html b/docs/public-api/interfaces/OverlapWidgetProps.html index 3eb9c6a..851be5a 100644 --- a/docs/public-api/interfaces/OverlapWidgetProps.html +++ b/docs/public-api/interfaces/OverlapWidgetProps.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/OverlapWidgetStyle.html b/docs/public-api/interfaces/OverlapWidgetStyle.html index 773268d..73c2282 100644 --- a/docs/public-api/interfaces/OverlapWidgetStyle.html +++ b/docs/public-api/interfaces/OverlapWidgetStyle.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/PaddingStyleProps.html b/docs/public-api/interfaces/PaddingStyleProps.html index b07e552..7a32759 100644 --- a/docs/public-api/interfaces/PaddingStyleProps.html +++ b/docs/public-api/interfaces/PaddingStyleProps.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/RequestWidgetUpdateByIdProps.html b/docs/public-api/interfaces/RequestWidgetUpdateByIdProps.html index c403734..871086b 100644 --- a/docs/public-api/interfaces/RequestWidgetUpdateByIdProps.html +++ b/docs/public-api/interfaces/RequestWidgetUpdateByIdProps.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/RequestWidgetUpdateProps.html b/docs/public-api/interfaces/RequestWidgetUpdateProps.html index f12e20b..b16f612 100644 --- a/docs/public-api/interfaces/RequestWidgetUpdateProps.html +++ b/docs/public-api/interfaces/RequestWidgetUpdateProps.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/ScreenInfo.html b/docs/public-api/interfaces/ScreenInfo.html index 7c00a63..5b98d80 100644 --- a/docs/public-api/interfaces/ScreenInfo.html +++ b/docs/public-api/interfaces/ScreenInfo.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/SizeStyleProps.html b/docs/public-api/interfaces/SizeStyleProps.html index a30759b..0a7a1ea 100644 --- a/docs/public-api/interfaces/SizeStyleProps.html +++ b/docs/public-api/interfaces/SizeStyleProps.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/SvgWidgetProps.html b/docs/public-api/interfaces/SvgWidgetProps.html index a3338af..129acfd 100644 --- a/docs/public-api/interfaces/SvgWidgetProps.html +++ b/docs/public-api/interfaces/SvgWidgetProps.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/TextWidgetProps.html b/docs/public-api/interfaces/TextWidgetProps.html index 351f47f..2a5a319 100644 --- a/docs/public-api/interfaces/TextWidgetProps.html +++ b/docs/public-api/interfaces/TextWidgetProps.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/TextWidgetStyle.html b/docs/public-api/interfaces/TextWidgetStyle.html index 4e213c5..bac918c 100644 --- a/docs/public-api/interfaces/TextWidgetStyle.html +++ b/docs/public-api/interfaces/TextWidgetStyle.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/Widget.html b/docs/public-api/interfaces/Widget.html index 3c4603b..4913b04 100644 --- a/docs/public-api/interfaces/Widget.html +++ b/docs/public-api/interfaces/Widget.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/WidgetConfigurationScreenProps.html b/docs/public-api/interfaces/WidgetConfigurationScreenProps.html index 1fdd8c9..a060f33 100644 --- a/docs/public-api/interfaces/WidgetConfigurationScreenProps.html +++ b/docs/public-api/interfaces/WidgetConfigurationScreenProps.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/WidgetInfo.html b/docs/public-api/interfaces/WidgetInfo.html index 4d1cf97..83f12b0 100644 --- a/docs/public-api/interfaces/WidgetInfo.html +++ b/docs/public-api/interfaces/WidgetInfo.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/WidgetPreviewProps.html b/docs/public-api/interfaces/WidgetPreviewProps.html index 5e90605..4475bb0 100644 --- a/docs/public-api/interfaces/WidgetPreviewProps.html +++ b/docs/public-api/interfaces/WidgetPreviewProps.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/WidgetTaskHandlerProps.html b/docs/public-api/interfaces/WidgetTaskHandlerProps.html index 0408618..ad8d9c4 100644 --- a/docs/public-api/interfaces/WidgetTaskHandlerProps.html +++ b/docs/public-api/interfaces/WidgetTaskHandlerProps.html @@ -7,7 +7,7 @@ - + diff --git a/docs/public-api/interfaces/WithAndroidWidgetsParams.html b/docs/public-api/interfaces/WithAndroidWidgetsParams.html index 5705e00..70e3d16 100644 --- a/docs/public-api/interfaces/WithAndroidWidgetsParams.html +++ b/docs/public-api/interfaces/WithAndroidWidgetsParams.html @@ -7,7 +7,7 @@ - + diff --git a/docs/tutorial/congratulations.html b/docs/tutorial/congratulations.html index 1d2bc77..9df2193 100644 --- a/docs/tutorial/congratulations.html +++ b/docs/tutorial/congratulations.html @@ -7,7 +7,7 @@ - + diff --git a/docs/tutorial/make-widget-configurable.html b/docs/tutorial/make-widget-configurable.html index 73b6494..a288304 100644 --- a/docs/tutorial/make-widget-configurable.html +++ b/docs/tutorial/make-widget-configurable.html @@ -7,7 +7,7 @@ - + diff --git a/docs/tutorial/register-task-handler.html b/docs/tutorial/register-task-handler.html index 0ac2078..14df06c 100644 --- a/docs/tutorial/register-task-handler.html +++ b/docs/tutorial/register-task-handler.html @@ -7,7 +7,7 @@ - + diff --git a/docs/tutorial/register-widget-expo.html b/docs/tutorial/register-widget-expo.html index cfa9dbd..95d3bdf 100644 --- a/docs/tutorial/register-widget-expo.html +++ b/docs/tutorial/register-widget-expo.html @@ -7,7 +7,7 @@ - + diff --git a/docs/tutorial/register-widget.html b/docs/tutorial/register-widget.html index f5fb1f2..21052c6 100644 --- a/docs/tutorial/register-widget.html +++ b/docs/tutorial/register-widget.html @@ -7,7 +7,7 @@ - + @@ -29,7 +29,7 @@

android/app/src/main/res/values/strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">My App Name</string>
<string name="widget_hello_description" translatable="false">This is my first widget</string>
</resources>

Add a widget provider xml file

Create a new xml file in the resources directory containing the details about the widget.

-
android/app/src/main/res/xml/widgetprovider_hello.xml
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="320dp"
android:minHeight="120dp"

android:updatePeriodMillis="0"

android:initialLayout="@layout/rn_widget"

android:previewImage="@drawable/hello_preview"
android:description="@string/widget_hello_description"

android:resizeMode="none"

android:widgetCategory="home_screen">
</appwidget-provider>
+
android/app/src/main/res/xml/widgetprovider_hello.xml
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="320dp"
android:minHeight="120dp"

android:targetCellWidth="5"
android:targetCellHeight="2"

android:updatePeriodMillis="0"

android:initialLayout="@layout/rn_widget"

android:previewImage="@drawable/hello_preview"
android:description="@string/widget_hello_description"

android:resizeMode="none"

android:widgetCategory="home_screen">
</appwidget-provider>
  • android:updatePeriodMillis How often, in milliseconds, that this AppWidget wants to be updated. The task handler will be called with widgetAction = 'UPDATE_WIDGET'. See the official docs here
  • android:previewImage should reference the preview image we added previously
  • diff --git a/docs/tutorial/try-it-our.html b/docs/tutorial/try-it-our.html index f67bec6..288a3ec 100644 --- a/docs/tutorial/try-it-our.html +++ b/docs/tutorial/try-it-our.html @@ -7,7 +7,7 @@ - + diff --git a/docs/tutorial/widget-design.html b/docs/tutorial/widget-design.html index a9a6bea..126f4ac 100644 --- a/docs/tutorial/widget-design.html +++ b/docs/tutorial/widget-design.html @@ -7,7 +7,7 @@ - + diff --git a/docs/tutorial/widget-preview.html b/docs/tutorial/widget-preview.html index 27e015a..f51746b 100644 --- a/docs/tutorial/widget-preview.html +++ b/docs/tutorial/widget-preview.html @@ -7,7 +7,7 @@ - + diff --git a/docs/update-widget.html b/docs/update-widget.html index 7a858af..4ee484a 100644 --- a/docs/update-widget.html +++ b/docs/update-widget.html @@ -7,7 +7,7 @@ - + diff --git a/index.html b/index.html index 524025f..7e6a5c1 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ - +