This app shows the evolution of writing a custom view by creating a graph view that takes in an array of floats and draws either a line or bar graph. The graph view also accepts touch inputs and draws a pointer with animations.
Each GraphView builds off of the previous one.
- GraphView - overrides onDraw to draw two lines to make the axes of the graph
- GraphView2 - adds public setData method and uses a Path object to draw the line graph
- GraphView3 - overrides onTouchEvent and draws a pointer for where the user is touching
- GraphView4 - adds animation with ValueAnimator to animate the pointer when a user touches the graph
- GraphView5 - adds custom attributes to control the graph view in xml and adds a bar type graph that can be selected with custom attribute
Created for a talk given at the OC Android Developer Meetup group.
