title: ImageView in Fragment of ViewPager(animation / rotate)
body: <p>I have ViewPager with some Fragments. In one of them I have ImageView. I want to rotate that ImageView gradually when user scroll the pages from one to another! Here below you can see example. I want to have same effect as in the second page here.</p>
  
  <p>I tried to use these code, but it rotate instantly not gradually.</p>
  
  <pre><code> @Override
   public void transformPage(View page, float position) {
          if (position &lt; -1) { // [-Infinity,-1)
          // This page is way off-screen to the left.
          page.setAlpha(0);
          } else if (position &lt;= 1) {
                ImageView imageView = (ImageView) page.findViewById(R.id.news_content);
                if (imageView != null) {
                    for(int angle=0; angle&lt;180; angle++){
                              ViewCompat.setRotation(imageView, angle);
                    }
                }
            }
   }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/DFHpw.gif" alt="enter image description here"></p>
  
  <p>Thanks for any help!</p>