I am trying to write a custom View with the ability of scroll horizontally. I have gone through many posts on the forums but I am still unable to get what I want.
I want a custom view on which I am plotting the pitch contour of an audio recording. The pitch contour is quite long to fit in the screen. So, I want to add a horizontal scroll to this.
As of now, I have created a customized view extending HorizontalScrollView
. Once the window has the focus, I invalidate()
the view and draw the pitch contour on the screen. After I complete drawing, I try to jump to the right most position by calling scrollTo(getRight(), 0)
. This doesn't change anything and the contour is exactly the same position. When I try to print the value using getRight()
, it gives me the value 1794
. I am using a Nexux 5 for testing. Can anyone give me any hints on this?
PS: The x pixel value for the last value in the contour is Last value of x for is:5499.3
.