IZI_Shadow_IZI
IZI_Shadow_IZI

Reputation: 1931

Create custom styled buttons class like the new Android Market has?

Would it be possible to create a class which you could pass four or so variables into that would create a button that looks similar to the new Android 3.0 Market link buttons? I am trying to learn all aspects of Android design. The button in question is below:

enter image description here

I think it would be cool if you could in your code create a new button that looks similar to this by going.

myButton = new myButton(hex value, mainText, subText, image resource);

The hex would determine the color bar, the mainText the Title(Apps), etc.

Is this possible? Thanks...any similar examples would be great

Upvotes: 1

Views: 351

Answers (1)

Kumar Bibek
Kumar Bibek

Reputation: 9117

Yup, Create a composite view which exposes all these functionalities.

  • Extend a View class (CustomButton).
  • Create a layout with all these sub-widgets ( 2 textviews + 1 image)
  • Inlfate the layout and add it to your CustomButton
  • Expose methods in your Custombutton class which interact with the sub-widgets (2 TVs + 1 IV)

Upvotes: 1

Related Questions