public class Bar
extends java.lang.Object
| Constructor and Description |
|---|
Bar(android.content.Context ctx,
float x,
float y,
float length,
int tickCount,
float tickHeight,
float barWeight,
int barColor,
boolean isBarRounded)
Bar constructor
|
Bar(android.content.Context ctx,
float x,
float y,
float length,
int tickCount,
float tickHeight,
float barWeight,
int barColor,
boolean isBarRounded,
int tickLabelColor,
int tickLabelSelectedColor,
java.lang.CharSequence[] tickTopLabels,
java.lang.CharSequence[] tickBottomLabels,
java.lang.String tickDefaultLabel,
float tickLabelSize)
Bar constructor
|
Bar(android.content.Context ctx,
float x,
float y,
float length,
int tickCount,
float tickHeight,
int tickDefaultColor,
float barWeight,
int barColor,
boolean isBarRounded)
Bar constructor
|
Bar(android.content.Context ctx,
float x,
float y,
float length,
int tickCount,
float tickHeight,
int tickDefaultColor,
float barWeight,
int barColor,
boolean isBarRounded,
int tickLabelColor,
int tickLabelSelectedColor,
java.lang.CharSequence[] tickTopLabels,
java.lang.CharSequence[] tickBottomLabels,
java.lang.String tickDefaultLabel,
float tickLabelSize)
Bar constructor
|
Bar(android.content.Context ctx,
float x,
float y,
float length,
int tickCount,
float tickHeight,
int tickDefaultColor,
java.util.List<java.lang.Integer> tickColors,
float barWeight,
int barColor,
boolean isBarRounded,
int tickLabelColor,
int tickLabelSelectedColor,
java.lang.CharSequence[] tickTopLabels,
java.lang.CharSequence[] tickBottomLabels,
java.lang.String tickDefaultLabel,
float tickLabelSize)
Bar constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
draw(android.graphics.Canvas canvas)
Draws the bar on the given Canvas.
|
void |
drawTicks(android.graphics.Canvas canvas,
float pinRadius,
com.appyvet.materialrangebar.PinView rightThumb)
Draws the tick marks on the bar.
|
void |
drawTicks(android.graphics.Canvas canvas,
float pinRadius,
com.appyvet.materialrangebar.PinView rightThumb,
com.appyvet.materialrangebar.PinView leftThumb) |
float |
getLeftX()
Get the x-coordinate of the left edge of the bar.
|
float |
getNearestTickCoordinate(com.appyvet.materialrangebar.PinView thumb)
Gets the x-coordinate of the nearest tick to the given x-coordinate.
|
int |
getNearestTickIndex(com.appyvet.materialrangebar.PinView thumb)
Gets the zero-based index of the nearest tick to the given thumb.
|
float |
getRightX()
Get the x-coordinate of the right edge of the bar.
|
float |
getTickX(int tickIndex) |
void |
setTickCount(int tickCount)
Set the number of ticks that will appear in the RangeBar.
|
public Bar(android.content.Context ctx,
float x,
float y,
float length,
int tickCount,
float tickHeight,
float barWeight,
int barColor,
boolean isBarRounded)
ctx - the contextx - the start x co-ordinatey - the y co-ordinatelength - the length of the bar in pxtickCount - the number of ticks on the bartickHeight - the height of each tickbarWeight - the weight of the barbarColor - the color of the barisBarRounded - if the bar has rounded edges or notpublic Bar(android.content.Context ctx,
float x,
float y,
float length,
int tickCount,
float tickHeight,
int tickDefaultColor,
float barWeight,
int barColor,
boolean isBarRounded)
ctx - the contextx - the start x co-ordinatey - the y co-ordinatelength - the length of the bar in pxtickCount - the number of ticks on the bartickHeight - the height of each ticktickDefaultColor - the color of all ticksbarWeight - the weight of the barbarColor - the color of the barisBarRounded - if the bar has rounded edges or notpublic Bar(android.content.Context ctx,
float x,
float y,
float length,
int tickCount,
float tickHeight,
float barWeight,
int barColor,
boolean isBarRounded,
int tickLabelColor,
int tickLabelSelectedColor,
java.lang.CharSequence[] tickTopLabels,
java.lang.CharSequence[] tickBottomLabels,
java.lang.String tickDefaultLabel,
float tickLabelSize)
ctx - the contextx - the start x co-ordinatey - the y co-ordinatelength - the length of the bar in pxtickCount - the number of ticks on the bartickHeight - the height of each tickbarWeight - the weight of the barbarColor - the color of the barisBarRounded - if the bar has rounded edges or nottickLabelColor - the color of each tick's labeltickTopLabels - the top label of each ticktickBottomLabels - the top label of each tickpublic Bar(android.content.Context ctx,
float x,
float y,
float length,
int tickCount,
float tickHeight,
int tickDefaultColor,
float barWeight,
int barColor,
boolean isBarRounded,
int tickLabelColor,
int tickLabelSelectedColor,
java.lang.CharSequence[] tickTopLabels,
java.lang.CharSequence[] tickBottomLabels,
java.lang.String tickDefaultLabel,
float tickLabelSize)
ctx - the contextx - the start x co-ordinatey - the y co-ordinatelength - the length of the bar in pxtickCount - the number of ticks on the bartickHeight - the height of each ticktickDefaultColor - the default color of all ticksbarWeight - the weight of the barbarColor - the color of the barisBarRounded - if the bar has rounded edges or nottickLabelColor - the color of each tick's labeltickTopLabels - the top label of each ticktickBottomLabels - the top label of each tickpublic Bar(android.content.Context ctx,
float x,
float y,
float length,
int tickCount,
float tickHeight,
int tickDefaultColor,
java.util.List<java.lang.Integer> tickColors,
float barWeight,
int barColor,
boolean isBarRounded,
int tickLabelColor,
int tickLabelSelectedColor,
java.lang.CharSequence[] tickTopLabels,
java.lang.CharSequence[] tickBottomLabels,
java.lang.String tickDefaultLabel,
float tickLabelSize)
ctx - the contextx - the start x co-ordinatey - the y co-ordinatelength - the length of the bar in pxtickCount - the number of ticks on the bartickHeight - the height of each ticktickDefaultColor - defualt tick colortickColors - the colors of each tickbarWeight - the weight of the barbarColor - the color of the barisBarRounded - if the bar has rounded edges or nottickLabelColor - the color of each tick's labeltickTopLabels - the top label of each ticktickBottomLabels - the top label of each tickpublic void draw(android.graphics.Canvas canvas)
canvas - Canvas to draw on; should be the Canvas passed into {#link
View#onDraw()}public float getLeftX()
public float getRightX()
public float getNearestTickCoordinate(com.appyvet.materialrangebar.PinView thumb)
thumb - the thumb to find the nearest tick forpublic int getNearestTickIndex(com.appyvet.materialrangebar.PinView thumb)
thumb - the Thumb to find the nearest tick forpublic float getTickX(int tickIndex)
public void setTickCount(int tickCount)
tickCount - the number of tickspublic void drawTicks(android.graphics.Canvas canvas,
float pinRadius,
com.appyvet.materialrangebar.PinView rightThumb)
canvas - Canvas to draw on; should be the Canvas passed into {#link
View#onDraw()}public void drawTicks(android.graphics.Canvas canvas,
float pinRadius,
com.appyvet.materialrangebar.PinView rightThumb,
com.appyvet.materialrangebar.PinView leftThumb)