0

Does any one have any idea of creating a custom component like the below image instead of using the image itself. I know how to create a rectangle (a rounded one using the xml and not in java) which was discussed in the link here but i am not able to work with something like the pointer part.

does anyone have an idea to do this i would be happy if i am suggested.

enter image description here

Community
  • 1
  • 1
G_S
  • 7,068
  • 2
  • 21
  • 51
  • May be using a image on the bottom of a a layeredview. Take a look at http://stackoverflow.com/questions/961944/overlapping-views-in-android – Lobo Dec 03 '12 at 16:10
  • Thanks for the reply but i was not looking for something that works out with images but looking for a way to draw this one so that i can change the colors when ever i need by just passing a parameter of the color code. – G_S Dec 03 '12 at 16:18

2 Answers2

0

You can make use of customized popup window. I never tried it before but you can give a try If you succeed please share it here....

android.fryo
  • 1,469
  • 1
  • 14
  • 18
  • Thanks for the response.I didnt get any idea to work out this. So thought of taking some help. And actually that's not a pop up like dialog but just a way to display a message. – G_S Dec 03 '12 at 16:07
0

Create a class that extends PopupWindow and set the background through code so that you can replace its color.

Here is a easy sample PopupWindow: http://www.ceveni.com/2009/09/popup-window-in-android-sample-program.html

See this post to know how to change/replace colors in a drawable: How to change colors of a Drawable in Android?

The adjust() method from that post is enough for you.
Create a new PopupWindow, load the bg drawable, change its color and set the new drawable to the popupWindow.

Community
  • 1
  • 1
Ron
  • 24,175
  • 8
  • 56
  • 97
  • This is almost what i am looking for. You helped me to make my work easy :) The adjust() method didnt help me but i got an idea from the link you suggested. Thank you Very Much userSeven7s. – G_S Dec 06 '12 at 16:25