resizeAnimation | Playing with Qt widget animation & graphics effect | Animation library
kandi X-RAY | resizeAnimation Summary
kandi X-RAY | resizeAnimation Summary
#resizeAnimation ##Shaking ##Table animation ##Flash animation ##Flowlayout animation ##Slide text animation ##Slide widget animation.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of resizeAnimation
resizeAnimation Key Features
resizeAnimation Examples and Code Snippets
Community Discussions
Trending Discussions on resizeAnimation
QUESTION
I am struggling for hours with some problem I encountered while creating a simple animation in my app.
I have a LinearLayout with elements inside that is hidden behind an Image View and which should be shown (by animating on layouts width) on the click event. If I delete elements from inside the LinearLayout everything performs well, but because the children of the layout are pushing its width (which means that even if layouts width is set to 0 it is still pushed to width +/- 100dp by the elements inside) I have problems with hiding the layout.
However it is not the case when animation is performed - when I am animating layout to go to width 0 it properly crops the children. But as soon as animation is done - the layout is pushed by the children. I had an idea to make layout crop its children by default, but I have tried multiple solutions and none of them worked. Then I thought that maybe I will just hide elements (visibility gone) after animation is done. And it "kinda" solved the problem - but I am still having a problem with first occurrence of "showing" animation.
What I am doing is - at the start I am setting layouts width to 0 and hiding it along with its children (setting their to visibility gone). Then on "showing" animation I am making layout and its children visible in onAnimationStart method and then the animation increases layouts width from 0 to 156dp. "Hiding" animation is reverted - I am decreasing layouts width to 0 and onAnimationEnd I am hiding the layout and its content. The problem is that for some reason the first time showing animation is invoked and I am making the layout and views visible in onAnimationStart, there is a gap between this code and the moment which animation actually starts, which makes views visible for a split second before the animation starts.
This is how it looks: hidden, shown. And here is the xml code for it:
...ANSWER
Answered 2020-May-21 at 10:18After a while I finally found a "solution" that does not require any operations on views visibility. It turns out that if layout width is 0dp, the views inside will keep pushing it, which makes layout be as wide as required to fit its children. But if I set the layout width to 1dp it actually cuts the views inside of it. So instead of animating layouts width from 156dp to 0dp on hide, I animate it from 156dp to 1dp and it works fine without any problems. Here is the working code for it:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install resizeAnimation
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page