I want to make a list of items which are in a Scrollview. So I put a LinearLayout inside a Scrollview. There is already one item inside the linearLayout: a view to add items. I want that item to stay at the bottom of my list at all times. (which a accomplished)
But when I add an item by executing the code below, my item to add views goes out of the screen.
linearLayout.addView(theview, linearLayout.getChildCount() - 1);
The views get inserted animated:
screen.android:animateLayoutChanges="true"
So my Question is how I scroll my scrollView down during the animation, so my item stays on the screen.
These are some screenshots.
Thanx
Realization for a smooth scroll for
ScrollView
after layout animation ends.First add
LayoutTransition
type in the code, not in xmlThen create
LayoutTransition.TransitionListener
item to have ability to multiple adding/removing it. Also you need to remove transitionListener in the end of translation because endTransition() callback is called multiple times and it brokes smoothScroll.Finnaly add animation start point.