@@ -62,6 +62,81 @@ export class RemoteViews {
6262 return this . _remoteViews ;
6363 }
6464
65+ setOnClickPendingIntent ( intent : android . app . PendingIntent ) {
66+ this . native . setOnClickPendingIntent ( intent ) ;
67+ return this ;
68+ }
69+
70+ setBackgroundColor ( value : number ) {
71+ this . native . setBackgroundColor ( value ) ;
72+ return this ;
73+ }
74+
75+ setBoolean ( method : string , value : boolean ) {
76+ this . native . setBoolean ( method , value ) ;
77+ return this ;
78+ }
79+
80+ setByte ( method : string , value : number ) {
81+ this . native . setByte ( method , value ) ;
82+ return this ;
83+ }
84+
85+ setShort ( method : string , value : number ) {
86+ this . native . setShort ( method , value ) ;
87+ return this ;
88+ }
89+
90+ setInt ( method : string , value : number ) {
91+ this . native . setInt ( method , value ) ;
92+ return this ;
93+ }
94+
95+ setLong ( method : string , value : number ) {
96+ this . native . setLong ( method , value ) ;
97+ return this ;
98+ }
99+
100+ setFloat ( method : string , value : number ) {
101+ this . native . setFloat ( method , value ) ;
102+ return this ;
103+ }
104+
105+ setString ( method : string , value : string ) {
106+ this . native . setString ( method , value ) ;
107+ return this ;
108+ }
109+
110+ setSize ( width : number , widthUnit : number , height : number , heightUnit : number ) {
111+ this . native . setSize ( width , widthUnit , height , heightUnit ) ;
112+ return this ;
113+ }
114+
115+ setWidth ( value : number , unit : number ) {
116+ this . native . setWidth ( value , unit ) ;
117+ return this ;
118+ }
119+
120+ setHeight ( value : number , unit : number ) {
121+ this . native . setHeight ( value , unit ) ;
122+ return this ;
123+ }
124+
125+ setVisibility ( visibility : number ) {
126+ this . native . setVisibility ( visibility ) ;
127+ return this ;
128+ }
129+
130+ findViewById ( id : string ) {
131+ const view = this . native . findViewById ( id ) ;
132+ return view ? new RemoteViews ( view ) : null ;
133+ }
134+
135+ resolveRemoteResources ( ) {
136+ this . native . resolveRemoteResources ( ) ;
137+ return this ;
138+ }
139+
65140 toAndroidRemoteViews ( packageName ?: string ) : AndroidRemoteViews {
66141 return new AndroidRemoteViews ( this . _remoteViews . build ( packageName ?? Utils . android . getApplicationContext ( ) . getPackageName ( ) ) ) ;
67142 }
@@ -71,18 +146,40 @@ export class AdapterViewFlipper extends RemoteViews {
71146 constructor ( id ?: string ) {
72147 super ( new org . nativescript . widgets . RemoteViews . AdapterViewFlipper ( id ?? null ) ) ;
73148 }
149+
150+ get native ( ) {
151+ return this . _remoteViews as org . nativescript . widgets . RemoteViews . AdapterViewFlipper ;
152+ }
74153}
75154
76155export class Button extends RemoteViews {
77156 constructor ( id ?: string ) {
78157 super ( new org . nativescript . widgets . RemoteViews . Button ( id ?? null ) ) ;
79158 }
159+
160+ get native ( ) {
161+ return this . _remoteViews as org . nativescript . widgets . RemoteViews . Button ;
162+ }
163+
164+ setText ( value : string ) {
165+ this . native . setText ( value ) ;
166+ return this ;
167+ }
168+
169+ setTextColor ( value : number ) {
170+ this . native . setTextColor ( value ) ;
171+ return this ;
172+ }
80173}
81174
82175export class Chronometer extends RemoteViews {
83176 constructor ( id ?: string ) {
84177 super ( new org . nativescript . widgets . RemoteViews . Chronometer ( id ?? null ) ) ;
85178 }
179+
180+ get native ( ) {
181+ return this . _remoteViews as org . nativescript . widgets . RemoteViews . Chronometer ;
182+ }
86183}
87184
88185export class FrameLayout extends RemoteViews {
@@ -143,12 +240,60 @@ export class ImageButton extends RemoteViews {
143240 constructor ( id ?: string ) {
144241 super ( new org . nativescript . widgets . RemoteViews . ImageButton ( id ?? null ) ) ;
145242 }
243+
244+ get native ( ) {
245+ return this . _remoteViews as org . nativescript . widgets . RemoteViews . ImageButton ;
246+ }
247+
248+ setImageUrl ( url : string ) {
249+ this . native . setImageUrl ( url ) ;
250+ return this ;
251+ }
252+
253+ setImageResource ( value : number ) {
254+ this . native . setImageResource ( value ) ;
255+ return this ;
256+ }
257+
258+ setImageURI ( value : android . net . Uri ) {
259+ this . native . setImageURI ( value ) ;
260+ return this ;
261+ }
262+
263+ setImageBitmap ( value : android . graphics . Bitmap ) {
264+ this . native . setImageBitmap ( value ) ;
265+ return this ;
266+ }
146267}
147268
148269export class ImageView extends RemoteViews {
149270 constructor ( id ?: string ) {
150271 super ( new org . nativescript . widgets . RemoteViews . ImageView ( id ?? null ) ) ;
151272 }
273+
274+ get native ( ) {
275+ return this . _remoteViews as org . nativescript . widgets . RemoteViews . ImageView ;
276+ }
277+
278+ setImageUrl ( url : string ) {
279+ this . native . setImageUrl ( url ) ;
280+ return this ;
281+ }
282+
283+ setImageResource ( value : number ) {
284+ this . native . setImageResource ( value ) ;
285+ return this ;
286+ }
287+
288+ setImageURI ( value : android . net . Uri ) {
289+ this . native . setImageURI ( value ) ;
290+ return this ;
291+ }
292+
293+ setImageBitmap ( value : android . graphics . Bitmap ) {
294+ this . native . setImageBitmap ( value ) ;
295+ return this ;
296+ }
152297}
153298
154299export class LinearLayout extends RemoteViews {
@@ -173,12 +318,20 @@ export class ListView extends RemoteViews {
173318 constructor ( id ?: string ) {
174319 super ( new org . nativescript . widgets . RemoteViews . ListView ( id ?? null ) ) ;
175320 }
321+
322+ get native ( ) {
323+ return this . _remoteViews as org . nativescript . widgets . RemoteViews . ListView ;
324+ }
176325}
177326
178327export class ProgressBar extends RemoteViews {
179328 constructor ( id ?: string ) {
180329 super ( new org . nativescript . widgets . RemoteViews . ProgressBar ( id ?? null ) ) ;
181330 }
331+
332+ get native ( ) {
333+ return this . _remoteViews as org . nativescript . widgets . RemoteViews . ProgressBar ;
334+ }
182335}
183336
184337export class RelativeLayout extends RemoteViews {
@@ -221,12 +374,40 @@ export class TextView extends RemoteViews {
221374 constructor ( id ?: string ) {
222375 super ( new org . nativescript . widgets . RemoteViews . TextView ( id ?? null ) ) ;
223376 }
377+
378+ get native ( ) {
379+ return this . _remoteViews as org . nativescript . widgets . RemoteViews . TextView ;
380+ }
381+
382+ setText ( value : string ) {
383+ this . native . setText ( value ) ;
384+ return this ;
385+ }
386+
387+ setTextColor ( value : number ) {
388+ this . native . setTextColor ( value ) ;
389+ return this ;
390+ }
224391}
225392
226393export class TextClock extends RemoteViews {
227394 constructor ( id ?: string ) {
228395 super ( new org . nativescript . widgets . RemoteViews . TextClock ( id ?? null ) ) ;
229396 }
397+
398+ get native ( ) {
399+ return this . _remoteViews as org . nativescript . widgets . RemoteViews . TextClock ;
400+ }
401+
402+ setText ( value : string ) {
403+ this . native . setText ( value ) ;
404+ return this ;
405+ }
406+
407+ setTextColor ( value : number ) {
408+ this . native . setTextColor ( value ) ;
409+ return this ;
410+ }
230411}
231412
232413export function registerWidgetListener ( provider : string , listener : IWidgetListener ) {
0 commit comments