Add animation to recyclerView like this
recyclerView = (RecyclerView) findViewById(R.id.rv); recyclerView.setHasFixedSize(true); llm = new LinearLayoutManager(getApplicationContext()); recyclerView.setLayoutManager(llm); AnimationSet set = new AnimationSet(true); Animation animation = new AlphaAnimation(0.0f, 1.0f); animation.setDuration(500); set.addAnimation(animation); animation = new TranslateAnimation( Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f ); animation.setDuration(100); set.addAnimation(animation); controller = new LayoutAnimationController(set, 0.5f); adapter = new RecycleViewAdapter(poetNameSetGets, this); recyclerView.setLayoutAnimation(controller);
source share