I am working on android application in which on button click i am giving width and height to my linear layout to make it full screen and by clicking again i am giving its width and height to 1dp. I just need to animate this thing like when i press the button it will slowly animate to full screen and on again pressing of button it will slowly animate to 1dp width and height. I have used translate for this thing but it didn't work in this scenario.
btnResize.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {
                            if(resize==true){
                                otherLayout.setLayoutParams(new LayoutParams(1, 1));
                                resize=false;
                            }else{
                                resize=true;
                                int height = LayoutParams.WRAP_CONTENT;
                                int width = LayoutParams.MATCH_PARENT;
//                              ImageView imageView = (ImageView)findViewById(R.id.imageView);
//
//                              Animation animZoomin = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.zoom_in);
//
//                              imageView.startAnimation(animZoomin);
                                otherLayout.setLayoutParams(new LayoutParams(width, height));
                            }
                        }
                    });
 
     
    