Simulate stack view in Android 2 (API 5)?

2019-04-27 05:54发布

My App must have a widget that can show cards and user can turn over cards. StackWidget sample (in Android's resources) has a good widget:

enter image description here

But there is a StackView in layout of widget and it is available since API Level 11 and I have to implement my App for API level 5.

Also I saw this widget that works API level 7 and upper, and I guess uses OpenGL ES:

enter image description here

Finally how we can simulate stack view in Android 2 (API 5)? Or how we can implement a widget like second image (above)?

1条回答
劫难
2楼-- · 2019-04-27 06:35

It is absolutely impossible to use custom views in widgets because of security. You can only use system ones marked with a @RemoteView annotation.

Those fancy animated scrollable 3D widgets OEMs used to put in their firmwares only work with their custom launchers because they are aware of those custom views and allow them to be inflated. Alternatively, these widgets can as well be a part of said custom launchers.

查看更多
登录 后发表回答