-1

Tried solution provided Draw line along points using finger , it works but not getting results similar to below image.

With solution provided above. Can get class to draw lines, however how to add effect similar to below image. As I understand we can not add button view into canvas.

PS - I'm not looking for complete code.. just looking for starting points as i have limited knowledge with canvas and surfaceviews

Source -

I think app is designed in unity. Looking for android (java) solution using SurfaceView , android-canvas or any other solution.

Amod Gokhale
  • 2,346
  • 4
  • 17
  • 32

1 Answers1

3

You should use a custom viewGroup for your purpose. Your custom view can extend another layout like FrameLayout. In your custom viewGroup you will use dispatchDraw(Canvas canvas) callback. In this method, the viewGroup gets child views to draw. In your case, you should call super before the line drawing operation so childViews(like buttons) draw themself then you draw your line on top of them. For line drawing effects you should play with the Paint object.

M.ekici
  • 765
  • 4
  • 10
  • I have tried that approach but was having trouble including multiple objects/buttons.. I solve the issue by drawing image view inside of buttons in canvas. – Amod Gokhale Aug 23 '19 at 17:06
  • I don't understand your trouble can you explain in detail. – M.ekici Aug 23 '19 at 17:26