How to draw scrollbar at particular position in a surfaceview in android - android

I am taking a surfaceview in xml file and drawing text,rectangle on the surfaceview by overriding ondraw() method and I want to make some part as a scrollable at surfaceview.
for reference--
https://www.youtube.com/watch?v=ycYp356qrno
in this app one page where all task are display and progress status is scrollable
pls help...

Related

SurfaceView won't draw while under image view

I have a function that will keep on drawing on the surfaceView to simulate the animation of a character on the surfaceView. But after adding a imageView on top of the SurfaceView, the SurfaceView stop drawing.
setZOrderOnTop(true) you have added in the surfaceview init.
because surfaceview should be always on top to draw anything,
Although after that you can't put image on top of that, for that you can use other question ref
add image to surface view in android
for that. let me know if that helps

Android: Drawing on Continuous ScrollView

My requirement is similar (not the same, of course) to the GuitarTuna app. I want to draw on an infinite vertical ScrollView as follows:
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?
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!

Talkback with ExploreByTouchHelper doesn't show green square on SurfaceView inside dynamic loaded Fragment

I have a dynamic loaded fragment inside the activity. The fragment contains one SurfaceView in the bottom and it contains some text image. I used ExploreByTouchHelper for Talkback. It can read the context but can't draw the green square on SurfaceView. But if the activity contains some components(like buttons) below this SurfaceView then the green square can be drawn.
So it seems that the Application doesn't know that the space on screen for SurfaceView belongs to this Application. If some components added below, only then it knows that itself owns that space.
So anything I can do to get this green square back?
Many thanks.
It seems that SurfaceView by default will not enable drawing on it's surface so the talkback can't draw on it's surface. To enable this you have to call setWillNotDraw(false).

How to add scroll-end hightlight to SurfaceView?

In my application I have a SurfaceView with dynamically created image. This image can be scrolled inside SurfaceView. Inside SurfaceView's drawing thread I know size of the image and I disable scrolling when it touch the boundaries. Also I want to highlight one of the side of SurfaceView when scrolling touch this boundary (like in ListView). How to implement this?

Make surface view transparent to current layout only

In my app i am using surface view for drawing perspective and some buttons on the same layout.
I am done with the drawing part but don't know how to make surface view transparent for the current layout only.
When i use holder.setFormat(PixelFormat.TRANSLUCENT); it shows my previous screen.
I have also tried the setZOrderOnTop(true); method but it makes my other buttons hidden/covered when drawing.
And using setZOrderMediaOverlay(true); put the view beyond current layout, if i am moving my finger over the screen it is drawing there as i can see the saved file, but not showing on screen.
I want to make it transparent for current screen without setting the z order.
Forks, help me to make this happen.
Thanks in advance.

Categories

Resources