transitiondrawable

Is it possible to use TransitionDrawable on the ActionBar?

*爱你&永不变心* 提交于 2020-01-02 07:28:08
问题 I'm trying to do some color animation on the action bar by using a TransitionDrawable. The code I'm trying is pretty simple, during onCreate, I put the transition drawable as the actionbar background: Drawable d = getResources().getDrawable(R.drawable.actionbar); actionbarDrawable = new TransitionDrawable(new Drawable[] { d, d }); getActionBar().setBackgroundDrawable(actionbarDrawable); then on the event I replace the second drawable of the TransitionDrawable and ask to animate it.

Is it possible to use TransitionDrawable on the ActionBar?

我怕爱的太早我们不能终老 提交于 2019-12-06 03:05:48
I'm trying to do some color animation on the action bar by using a TransitionDrawable. The code I'm trying is pretty simple, during onCreate, I put the transition drawable as the actionbar background: Drawable d = getResources().getDrawable(R.drawable.actionbar); actionbarDrawable = new TransitionDrawable(new Drawable[] { d, d }); getActionBar().setBackgroundDrawable(actionbarDrawable); then on the event I replace the second drawable of the TransitionDrawable and ask to animate it. actionbarDrawable.setDrawableByLayerId(1, d); actionbarDrawable.startTransition(666); I've tried the same code on

Crossfading using TransitionDrawable not working on android

坚强是说给别人听的谎言 提交于 2019-11-30 05:58:43
I have two Images that I want to cross fade. Initially they both use imageview. I then use .getDrawable() to get the drawable of the images. This is the code I used Drawable backgrounds[] = new Drawable[2]; backgrounds[0] = BackgroundImage.getDrawable(); backgrounds[1] = BackgroundImageBlurred.getDrawable(); TransitionDrawable crossfader = new TransitionDrawable(backgrounds); crossfader.startTransition(3000); It only shows the image on the first array element, which it shows anyway since both images were set to visible in the XML. The transition doesn't start Any help would be appreciated :)

Crossfading using TransitionDrawable not working on android

隐身守侯 提交于 2019-11-29 05:07:23
问题 I have two Images that I want to cross fade. Initially they both use imageview. I then use .getDrawable() to get the drawable of the images. This is the code I used Drawable backgrounds[] = new Drawable[2]; backgrounds[0] = BackgroundImage.getDrawable(); backgrounds[1] = BackgroundImageBlurred.getDrawable(); TransitionDrawable crossfader = new TransitionDrawable(backgrounds); crossfader.startTransition(3000); It only shows the image on the first array element, which it shows anyway since both