| java.lang.Object | |
| ↳ | com.neomades.graphics.Background |
A background represents a non focusable rectangular region contained within a view.
It cannot be instantiated directly. Different types of backgrounds can be created by calling the following methods in this class.
|
[Expand]
Inherited Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.neomades.graphics.Anchor
| |||||||||||
From interface
com.neomades.graphics.ScaleType
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| static Background |
createWithImage(int resImage, int scaleType)
Create a background with an image.
| ||||||||||
| static Background |
createWithImage(Image resImage, int scaleType)
Create a background with an image.
| ||||||||||
| static Background |
createWithLinearGradient(int startAnchor, int endAnchor, Color startColor, Color endColor)
Create a linear gradient background.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Create a background with an image. The image will occupy the space available as defined by the scale type parameter.
| resImage | the image to display in background |
|---|---|
| scaleType | the scale type to apply: STRETCH,
SCALE_ASPECT_FILL or
SCALE_ASPECT_FIT |
Create a background with an image. The image will occupy the space available as defined by the scale type parameter.
Background can be created with null as image. In that case, if
applied, it will remove the current background of the component.
| resImage | the image to display in background |
|---|---|
| scaleType | the scale type to apply: STRETCH,
SCALE_ASPECT_FILL or
SCALE_ASPECT_FIT |
Create a linear gradient background. Colors could be only opaque.
To parameterize linear gradient, two points of color should be provided. Each point is located in the edge of the background. The linear gradient will be computed thanks to both points.
| startAnchor | first point location (e.g. TOP or
TOP|LEFT) |
|---|---|
| endAnchor | second point location (e.g. BOTTOM or
BOTTOM|RIGHT) |
| startColor | first point color (only opaque) |
| endColor | second point color (only opaque) |