-1

I am making a live wallpaper app in android studio in which i need bubble effect like in this gif bubble effect

I am developing it naively i.e. no library. What I have tried is creating several hundred rect object and drawing bitmap with different destination rect as time passes. Problem with this approach is that I will have to create several thousands of rect objects to achieve this effect. Any Suggestion. I need this effect on touch.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Salman Khalid
  • 543
  • 5
  • 23
  • Have a look at [This awesome blog](https://medium.com/@patrick_iv/continuous-animation-using-timeanimator-5b8a903603fb) see if this work out for you. Cause i do not have much idea a How LiveWallpaper works .. – ADM Feb 27 '19 at 06:43
  • you have `SurfaceHolder` so you can use its `lockCanvas()` method and draw whatever you want - it does not have to be `Bitmap` only – pskink Feb 27 '19 at 06:49
  • pskink yes i am able to draw bitmaps, but as you can see i need to draw scalling bitmaps to achieve animation effect. – Salman Khalid Feb 27 '19 at 06:53
  • check [Canvas](https://developer.android.com/reference/android/graphics/Canvas) API documentation – pskink Feb 27 '19 at 06:54
  • pskink can you please tell me about some method which may be helpful? – Salman Khalid Feb 27 '19 at 06:57
  • for example `drawBitmap(Bitmap bitmap, Rect src, RectF dst, Paint paint)` – pskink Feb 27 '19 at 07:02
  • pskink I have tried this method already. for this method i will have to create thousands of (rectf dst) objects as rect objects have fixed coordinates to draw but i need to draw at different places – Salman Khalid Feb 27 '19 at 07:06
  • `RectF#set`? why dont you read the official documentation? – pskink Feb 27 '19 at 07:10

1 Answers1

0

I used Matrix for scaling and for other things.

Salman Khalid
  • 543
  • 5
  • 23