Simulate stack view in Android 2 (API 5)?
Asked Answered
M

1

6

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)?

Mihe answered 5/9, 2012 at 17:11 Comment(10)
When you looked at the source code for StackView, what did you learn about its implementation and how easily it could be backported?Jacquie
@Jacquie I did not see it's source code.Please tell me where is it.Mihe
github.com/android/platform_frameworks_base/blob/master/core/… Based on a cursory analysis, you might be able to backport this using NineOldAndroids for the animation portions. Nobody appears to have backported it yet, and note that the backport can only be used in an activity, not a home screen app widget.Jacquie
@Jacquie so how we can implement app widget that user can turn over it's cards?Mihe
It is completely impossible in an app widget prior to API Level 11.Jacquie
@Jacquie Do you see any snippet code that help me to implement an app widget like second image?Mihe
Unless you see that from an app in the Play Store, that is most likely not an app widget, but a feature of that particular home screen.Jacquie
@Jacquie I recently see Timescape.It has a widget with 3D animation.It REQUIRES ANDROID:2.1 Do you believe that It is completely impossible in an app widget prior to API Level 11?Mihe
Timescape is not an app widget. It is part of Sony's (or Sony Ericsson's) version of Android, mostly seen as a custom home screen. "It has a widget with 3D animation" -- no, the home screen has a 3D animation. "It REQUIRES ANDROID:2.1" -- no, it requires whatever version of Android Sony ships it on for a given device.Jacquie
@Jacquie Thank you.I asked another question that is in about APP Widget,but it did not received any answer.I guess you can answer to it,because your experiences on this topic.My question is here: https://mcmap.net/q/1920018/-android-force-appwidget-to-work-from-sd-card/1043882Mihe
E
0

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.

Ency answered 16/9, 2015 at 3:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.