public class TimelineView
extends View
TimelineActivity| Constructor and Description |
|---|
TimelineView(Context context)
Constructor, setting the various color and stroke characteristics for the timeline
|
TimelineView(Context context,
AttributeSet attrs)
Constructor, setting the various color and stroke characteristics for the timeline
|
| Modifier and Type | Method and Description |
|---|---|
void |
onDraw(Canvas canvas)
Called by the UI thread to draw the timeline view
|
void |
pushAverage(float voltage)
Pushes a point (y=voltage) of the average line from far left to far right, which is then later drawn by the onDraw() function
|
void |
pushGrid()
Pushes the path information for the grid to be drawn
|
void |
pushPath(long time,
float voltage)
Push a timeline point (x=time, y=voltage) to the path, which is then later drawn by the onDraw() function
|
void |
setMainColor(int color)
sets the main color of the path
|
void |
setMinMax(float min,
float max,
long minX,
long maxX)
Sets the min/max information for the timeline view so that the values are properly scaled when pushPath() is called
|
void |
setProgressBar(ProgressBar progress)
Store a reference to the
ProgressBar that is shown during drawing |
public TimelineView(Context context)
context - Reference to the calling Contextpublic TimelineView(Context context,
AttributeSet attrs)
context - Reference to the calling Contextattrs - Reference to the AttributeSet of the layout drawn forpublic void onDraw(Canvas canvas)
canvas - Reference to the Canvas drawn onpublic void pushPath(long time,
float voltage)
time - current time of the pointvoltage - current y value of the pointpublic void pushAverage(float voltage)
voltage - current y value of the pointpublic void pushGrid()
public void setMinMax(float min,
float max,
long minX,
long maxX)
min - minimal y valuemax - maximum y valueminX - minimal x valuemaxX - maximum x valuepublic void setProgressBar(ProgressBar progress)
ProgressBar that is shown during drawingprogress - public void setMainColor(int color)
color - color code