Strange "Clipping" when animating views

177 views Asked by At

I'm attempting to create the effect of toggling open/closed a group of Floating Action Buttons, and I'm getting a weird horizontal gray clipping artifact over the buttons that I can't figure out. It looks like a view with a non-transparent background is getting drawn over the buttons, but I can't figure out why. I believe I have all the relevant backgrounds set as android:color/transparent.

You can see an almost working example here: http://g.recordit.co/dunm1iKpFJ.gif

I lay these widgets out using a LinearLayout (too lazy to calculate positions... is this a bad idea?) and before it's drawn to screen, I grab the expanded positions and set in a "collapsed" state. From here I animate all elements together using an AnimatorSet to the expanded positions. I should also note that I'm using an update listener to update the height (similar to https://stackoverflow.com/a/16355027/413254).

I don't think this is the most elegant solution... should probably make this a custom view(group). I cannot bring myself to leave this without at least figuring out what's going on.

Note: I would use https://github.com/futuresimple/android-floating-action-button, but it doesn't support labels with FABs.

1

There are 1 answers

1
loeschg On

It seemed to be an issue with moving views and resizing the parent container simultaneously. I ended up working around this by resizing the bottom view's height.