开发者

Developing alternative UI for Android. Which way I should go?

I am developing an App for Android, in which I need an UI that requires following:

  1. Redraw at least 10fps

  2. Buttons on screen, but not in rectangular shape

  3. The whole screen (or at least the background, if its too heavy for the system) need to do some 'porter-duff' masking before render, on-the-fly

I curr开发者_运维技巧ently figured out two way to go, both have cons & pros:

  1. Start off from existing View - ViewGroup in the framework. Overriding onDraw to add the masking to it. This is easier to implement, but I am not sure if calling 'invalidate' that often will cause any trouble?

  2. Build an alternative View - ViewGroup structure, and do the rendering in SurfaceView. But then I realize I turn up a structure that looks quite close to the existing one in framework, which I feel doing something almost the same with the framework.

Any suggestion?

(ps. in either way, I am not sure how should I catch the button 'click' event, which is in irregular shape)


The button is easy. Just add a Button view to your layout and use XML to define your own custom image.

android:background="@drawable/my_button_background"

The boundary gets automatically defined as the bounds of the drawable. Simple and easy.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜