Custom view widget - android

I was browsing internet for tutorial on custom view widget creatin, but they all were creating views of regular form, like rectangle, circle. But I need a widget that looks something like this:
Can you help me with brief overlook on how I create it? All that matters is outline form. I need it to be animated - I can extend it and shrink.

You can use shape drawables mentioned here: http://developer.android.com/guide/topics/resources/drawable-resource.html#Shape

If you are looking for making your own custom view by drawing the layouts on the canvas and providing it with the necessary functionalities you should look into this
Custom views

Related

Yahoo News App like slanted custom ImageView in Android

I know this question has been asked before and I am unable to get a good solution so far.
I need to create a custom ImageView like the one use in the yahoo news app like below screenshot.
In the View hierarchy in the right, you can see its an imageview only. Below there is a framelayout and I attached a screenshot of that as well.
I don't think this is achieved using a layer-list, which can draw custom shapes on top of views.
So how to create a custom imageview with custom shape like this in android?
Any suggestion is really appreciated.
Thanks.

Android : How to draw layout with slanting and curved edges like this?

I am unable to figure out how to design layout in android like the images shown below.
Please suggest some solutions in order to achieve the same.
This can be achieved in two ways:
1- Use images in the background and position them accordingly.
2- Write your own View class and override the onDraw(Canvas canvas) method. You can get help from Android documentation.
Creating Custom Views
Creating a View Class
OR
Check this solution for help:
Android custom shape
As the other answers said, you can create custom views in android.
The curves are called Bézier curves. Similar questions have been asked before.
This question and this tutorial might help you on how to implement the curved view.
You can use SVG wave for background, and you can use this link to make online.

Circular View with Button Press Effect

I am looking for a custom component to design a circular remote control view like the image below with different button and background color.
Each button should be touchable with proper press effect. I did find a useful library with this I am able to create somewhat similar design but still there are lots of improvement required like Press effect/ Inner and outer circle padding radius etc. Please help me to find the better option for this.
I think tihs is your answer.
You can download here.
https://code.google.com/p/radial-menu-widget/
You could make your own class extending view. You will then be able to override onDraw() and draw whatever you want.
You could also use default android Button with a custom xml selector defined with a different image ressource for pressed/not pressed states.

Draw circle in xml in android

I am trying to display my layout via android xml.
Here's what I want to do:
I have 12 buttons with a animals image like this one: , and the circle is the background.
I do not have any idea related to this, how should I start?
Please give me some suggestion so I can go ahead. What things should I use to do this?
You'd be looking for making a custom view. A good place to start is, as always, android's own development site: http://developer.android.com/training/custom-views/create-view.html
i think you can do this with xml. this need simple mathematic calculation that you can not do in xml.
you most extend View class and create your own View. then you can use it in xml.

design a custom view like a tool tip

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.
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.
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....

Categories

Resources