Android 4 Color Gradient (Not linear) - android

Was wondering if its possible to create a gradient like this one in either XML or programmatically:
I've seen plenty of answers on how to create a linear 4-color gradient, however that is not what I'm looking for as this a not linear gradient but rather a corner gradient. Where every corner is a different color.
Thank you!

Related

How can I achieve curly or wavy borders for a view on Android?

There is the concept of rounded corners for views and drawables in Android, however, am working on an interface for a kids robot, and someone asked for curly borders - sort of like wavy (sine wave kind of thing). Now, how the heck can one achieve such a thing in either XML or Java - especially, without resorting to use of image overlays or backgrounds?
rounded corners aren't in fact rounded Views, its just a bit of transparency in corners. you can create some custom drawables/Bitmaps and set for your Views (as a background or use ImageView) or you can use custom programmatic drawing like HERE
Have tried to use images of that form and use them as background in a transparent container?

Customising top of DialogFragment

Maybe some kind of simple question to those who are skilled at android layouts, but what is the best approach to draw smth like this (maybe what widget to use) for positioning rounded area which spreads out of top border of dialogFragment and is horizontally centered like this:
You will have to create a custom layout for Dialogs.
In this case, you have all the control you want for defining dialogs layout, same as for any view.
If heart icon is all you have, create an xml for white circle and use it as a background for the heart, set it to top of parent, center it horizontally.
As you will have exact height of circle, you can set half of it as top margin for the rest of the layout below to make circle look like a hump (as on screenshot).
You can use a 9 patch as the background of you dialog. Define the stretch areas and the content area and you should be good :
And for exemple use this 9 patch file:

Creating non-traditional shape tooltip in android with border

Hello fellow Android designers,
I am struggling right now to create xml tooltip that would look like the one on this picture:
Unfortunately it seems like a hell of a work. Till now I was only able to create a simple rounded rectangle like that:
Is it actually possible to create such a shape I have presented on the first photo using xml styling or should I try to create it programatically (which will probably take huge amount of time and creating border would be really hard)? Or maybe the simplest solution is the best and I should use partially transparent png image with the shape of my choosing?
Any advice would be much appreciated.
You can draw it using stretchable 9-patch drawable.
You can specify there which parts are fixed (the little knob on the left and corners) and which are stretchable (all other parts)

Gridlayout with borders

I'm a new Android developer, and I'm just trying to improve my skill by reading some samples, I want to design a new interface using GridLayout, I've checked a lot of samples but I can't seem to draw borders between the GridLayout cells. What could I be missing?
Here is a link that I went through it, but the borders didn't show up!
http://developer.samsung.com/android/technical-docs/GridLayout-in-Android#
I appreciate your care in advance.
Android Layout containers don't draw borders. Still:
You can set background of each cell's View to an xml Drawable resource,
which describes a transparent rectangle with borders.
Give a background color to GridView's parent View, and set each GridView cell View's background to a different color.
Both of these can also be applied as a Style.

Making a background rectangle with different colors in android

Is there way to make and Android background have different colored sides by using android:shape="rectangle" ? Right now I have it set but all the side of my view are the same color. Thanks very much.
You can use a gradient color to fill your shape, meaning one side will have one color and the other side will have another color, with the color blending between the two sides.
A way to have 4 sides with different colors is use a nine-patch drawable, this isn't a shape anymore.

Categories

Resources