public class FlatMerryGoRoundTransformer extends java.lang.Object implements CarouselView.ViewTransformer
setNumPies(int)
number of item views to be distributed across the circle evenly. Default 7setHorizontalViewPort(double)
% of parent width to be used for display. Default 80%setViewPerspective(double)
normalized camera height. Default 0.6setFarScale(double)
scale of itemview when it is layout at a far distance (y = 0). Default 0.35setFarAlpha(double)
alpha of itemview when it is layout at a far distance (y = 0). Default 0Constructor and Description |
---|
FlatMerryGoRoundTransformer() |
Modifier and Type | Method and Description |
---|---|
double |
getFarAlpha() |
double |
getFarScale() |
double |
getHorizontalViewPort() |
int |
getNumPies() |
double |
getViewPerspective() |
void |
onAttach(CarouselLayoutManager layoutManager)
Called when attaching the transformer to a CarouselLayoutManager.
|
void |
setFarAlpha(double farAlpha) |
void |
setFarScale(double farScale) |
void |
setHorizontalViewPort(double horizontalViewPort) |
void |
setNumPies(int numPies) |
void |
setViewPerspective(double viewPerspective) |
void |
transform(android.view.View view,
float position)
Transform a given item view based on position.
|
public void onAttach(CarouselLayoutManager layoutManager)
CarouselView.ViewTransformer
onAttach
in interface CarouselView.ViewTransformer
CarouselLayoutManager#setDrawOrder(DrawOrder)
,
CarouselLayoutManager#setScroller(Scroller)
public int getNumPies()
public void setNumPies(int numPies)
public double getHorizontalViewPort()
public void setHorizontalViewPort(double horizontalViewPort)
public double getViewPerspective()
public void setViewPerspective(double viewPerspective)
public double getFarAlpha()
public void setFarAlpha(double farAlpha)
public double getFarScale()
public void setFarScale(double farScale)
public void transform(android.view.View view, float position)
CarouselView.ViewTransformer
transform
in interface CarouselView.ViewTransformer
view
- Item viewposition
- For example, 0 for the current center-most item at a stable position;
4 for 4-th item at the right to the current item;
-3 for 3-rd item at the left to the current item;
0.1 for the current item with 10% offset right to its stable position.