I have a LinearLayout that expands to full screen, hiding all other layouts and views on onClick . There is a Relativelayout above LinearLayout
I want to apply custom animation to this. The size should increase slowly (for example, 500 milliseconds).
But I doubt that this is possible? Thanks.
That's what I'm doing onClick :
private void expandView (int viewId) { RelativeLayout relativeLayout = (RelativeLayout) ((LinearLayout) view.findViewById(viewId)).getParent(); ViewGroup.MarginLayoutParams rlMargin = (ViewGroup.MarginLayoutParams) relativeLayout.getLayoutParams(); rlMargin.setMargins(0, 0, 0, 0); relativeLayout.setLayoutParams(rlMargin); LinearLayout linearLayout = (LinearLayout) relativeLayout.getParent(); hideAllLinearLayoutExcept(linearLayout.getId()); hideAllTilesExcept(viewId); }
viewId is the LinearLayout identifier that I click. This function is called from onClick()
source share