ErickTreeTops
ErickTreeTops

Reputation: 55

confused about android controls

Can some one tell me what the difference is a between a widget and a control? One definitions says a widget is a full blown app that sits on a phones home page. Others state it's a simple control like a button. What is the real answer?

In addition where can I find a complete list of controls that are available for Android 4.0. I know there are buttons, checkboxes, textview, Listcontrol, etc. I assume there is not a treeview, but there doesn't seem to be any documentation that lists all of the available controls. In .net there are dozens of common controls and hundreds more if you include additional control libraries. I want a specific control and can't tell if it already exists or if I need to create it from scratch.

There is not a complete example, book, video on how to build a custom control (which I think is referred to as custom components and not a control) except for a reference to the classes you should use http://developer.android.com/guide/topics/ui/custom-components.html.

How do I draw it, how do I animate it based in user interaction. After searching the internet for a week I have come to the conclusion that it either it can't be done or no one has figured it out.

Upvotes: 0

Views: 284

Answers (1)

Ovidiu Latcu
Ovidiu Latcu

Reputation: 72331

There are 2 distinct packages:

  • android.widget which is a package that contains most of the UI 'controls' such as buttons, checkboxes, edittexts, listviews etc.
  • android.appwidget which is the package that contains all the components necessary to build an app widget, which can come with an application, and it is something that users can place on the homescreen, and usually dispalys brief information about the application (ex. the Weather Widget which gives you the current temperatures for your location.)

To build a custom control,there are various ways of doing this, you can extend View or create any Layout with multiple Views included in it, and based on user interaction you can change your Views appeareances, display Dialogs etc. You could also use StateListDrawables to give diffrent Drawables for diffrent states of your Views. There are a lot of ways in which you can create customs controls.

Upvotes: 5

Related Questions