Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Drawing on Continuous ScrollView

Tags:

android

My requirement is similar (not the same, of course) to the GuitarTuna app. I want to draw on an infinite vertical ScrollView as follows:

enter image description here

A trail emanating from the bottom of the pin on the top of the screen can be seen in the image above. It keeps scrolling with the ScrollView and disappears (by scrolling out of the screen) if the drawing is stopped.

What is the best way to create a similar kind of drawing interface?

like image 854
androidnoob Avatar asked Jul 03 '17 07:07

androidnoob


1 Answers

EDITED

Hi!

Finally, i think, i understand what you need. I really don't know if is possible to achieve by this using the example that you mention.

I would try the option of using a SurfaceView. Here's what i have until now:

An interesting answer about how to draw inside scrollView:

How to draw on canvas greater than screen size and be able to scroll / pan horizontally and vertically in android?

How to draw in a SurfaceView: example 1 example 2

Complete example of draw using TouchListener in a SurfaceView

How to draw to Canvas from SurfaceView?

Good answers that explains how a SurfaceView works :

Android: How to draw on a Surfaceview which already is displaying a Camara Preview View and SurfaceView, which one is better?

Ideas on how to scroll a surfaceView?

Android SurfaceView scrolling

I wish to have more time to help you, and change my answer with some code.

Hope it helps!

like image 196
noe Avatar answered Nov 05 '22 00:11

noe