开发者

Changing an imageView in an Android Widget onclick

开发者 https://www.devze.com 2023-02-21 18:14 出处:网络
I have a very simple widget that has a background image of a speech bubble and an imageView that contains a character standing next to it (as if he is saying something).

I have a very simple widget that has a background image of a speech bubble and an imageView that contains a character standing next to it (as if he is saying something). On top of the speech bubble i have a textView in which i show some text.

Basically all i want to do is so that when the user clicks on the character the image changes to show an animation of the character.

I did a simple app that animates an imageView (using the animation-list xml) when the image is clicked and that worked fine. So i was wondering if i could achieve the same thing with this widget.

I have seen some examples where by you can click on a widget (be it a button, image, whatever) and you can then load a config layout however i simply 开发者_Go百科cant figure out and i cant find anywhere if what i want can be done.

So basically what i need to know is: 1. can a widget have an animated imageView 2. What do i need to do so that when the imageView is clicked it loads the animation?

Can anyone point me in the right direction please?

Thanks in advance guys!!


Have you tried to use LayoutAnimation? See the related question here: Android Widgets: Animations on RemoteViews ?

0

精彩评论

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