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 most of the links 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.

Recommended Answers

All 8 Replies

9 patch image, mark streching part and you done, Android whatsup application using it...

Thanks for the reply.
But my problem is not with the image and making it .9.png format.
I want a way to design a view (custom view ) which resembles the image.

Either way your custom component will need to use that approach with strechable background image

Well i dont want to use the image at all.
I just need is the way to create some custom view to look like the image so that i can have a way to pass a parameter to the constructor or any method to create some other view with some different color instead of using the same image all the times. Hope i am clear now.

Then draw on canvas. Nevertheless you are overcomplicating simple thing that can be simple achieved by 9patch as background.

I know that the issue can be solved by using a 9 patch as background.
Suppose am using a 9patch as background.. could you help me in changing its color to someother (supposing that there are few buttons for changing colors).
And even am aware to draw it on canvas. The issue is how to do that as i am not able to find out how to draw the tip pointing onto the canvas

Tip point, just draw two lines that have different starting poinst but same meeting/ending point . As for different colors you can always provide number of different coloured images and based on that provide user with available colour options

I am already having many images which are having size of around 5 Mb. Adding few more images may increase the size. So is there any other alternative or could you suggest any sample for this if possible

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.