Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What views can i use in an appWidget?

Tags:

android

Can anyone tell me what views can I use in an appWidget?

Thank you!

like image 840
Ungureanu Liviu Avatar asked Dec 30 '22 06:12

Ungureanu Liviu


1 Answers

according to the official android API:

A RemoteViews object (and, consequently, an App Widget) can support the following layout classes:

  • FrameLayout
  • LinearLayout
  • RelativeLayout
  • GridLayout

And the following widget classes:

  • AnalogClock
  • Button
  • Chronometer
  • ImageButton
  • ImageView
  • ProgressBar
  • TextView
  • ViewFlipper
  • ListView
  • GridView
  • StackView
  • AdapterViewFlipper

Descendants of these classes are not supported.

RemoteViews also supports ViewStub, which is an invisible, zero-sized View you can use to lazily inflate layout resources at runtime.

Also starting with android 3.0 the next views are supported:

  • ListView - A view that shows items in a vertically scrolling list. For an example, see the Gmail app widget.
  • GridView - A view that shows items in two-dimensional scrolling grid. For an example, see the Bookmarks app widget.
  • StackView - A stacked card view (kind of like a rolodex), where the user can flick the front card up/down to see the previous/next card, respectively. Examples include the YouTube and Books app widgets.
  • AdapterViewFlipper - An adapter-backed simple ViewAnimator that animates between two or more views. Only one child is shown at a time.
like image 174
android developer Avatar answered Jan 08 '23 07:01

android developer