DavidAndroidDev
DavidAndroidDev

Reputation: 2414

Android View options - draw to a canvas directly or use views

I'm converting a project that I wrote in AIR a long time ago to native Android. In AIR, positioning views was fairly easy in x,y coordinate systems. With native Android though, I am trying to approach this in a correct way, but I'm unsure how to approach.

My view will consist of two circles in the background, with small objects within those circles that can roll around. There will be another view drawn on top of the circles to make it seem like there is glass over the circle, entrapping the small objects. The small objects are bound to the background circles.

I guess what I'm really asking is canvas drawing the best approach here, or is a view-based layout workable as well?

Upvotes: 0

Views: 318

Answers (1)

CaseyB
CaseyB

Reputation: 25058

It sounds like your best option would be to use a SurfaceView. This is basically a hardware accelerated canvas. On of the benefits is that you can overlay standard widgets over top of it if you need to so you can mix and match custom and standard components. Here is a link to a website that walks you through getting a SurfaceView up and running

Upvotes: 1

Related Questions