title: Android Animation - Error: animation Fade In/Out works only when I scroll down
body: <p>I'm using the CollapsingToolbarLayout (with AppBarLayout and Toolbar) and with NestedScrollView (to the content of the Activity). I'm trying to animate the ImageView, that's allocated in the middle (between NestedScroll and AppBar, but above them) like the image below. The error: The effect Fade In works, when I scroll down, but when I try to scroll up, the effect (Fade Out) doesn't work, the ImageView only goes. </p>
  
  <p><img src="https://i.stack.imgur.com/MG4JO.png" alt="enter image description here"></p>
  
  <blockquote>
    <p>SubscribeActivity</p>
  </blockquote>
  
  <pre><code>public class SubscribeActivity extends BaseActivity implements SubscribeMvpView {
  
      @BindView(R.id.nsv_subscribe)
      NestedScrollView nstScroll;
  
      @BindView(R.id.tlb_subscribe)
      Toolbar tbSubscribe;
  
      @BindView(R.id.imv_subscribe_avatar)
      CircularProfilePhoto ivProfilePhoto;
  
      @BindView(R.id.app_bar)
      AppBarLayout apl;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_subscribe);
  
          ButterKnife.bind(this);
  
          setUp();
      }
  
      @Override
      protected void setUp() {
          tbSubscribe.setTitle(R.string.str_subscribe_tlb);
          setSupportActionBar(tbSubscribe);
  
          ViewUtils.setStatusBarTranslucent(this, true);
          CommonUtils.showToolbar(this, R.id.tlb_subscribe, "", v -&gt; finish());
  
          apl.addOnOffsetChangedListener((appBarLayout, verticalOffset) -&gt; {
              if (verticalOffset &lt;= -95 &amp;&amp; verticalOffset &gt;= -110 ) {
                  ivProfilePhoto.animate().alpha(0).setDuration(300);
                  ivProfilePhoto.setVisibility(View.INVISIBLE);
              } else if (verticalOffset &gt;= -94) {
                  ivProfilePhoto.setVisibility(View.VISIBLE);
                  ivProfilePhoto.animate().alpha(1).setDuration(300);
              }
          });
      }
  }
  </code></pre>
  
  <blockquote>
    <p>activity_subscribe</p>
  </blockquote>
  
  <pre><code>&lt;android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@color/colorWhite"
      android:orientation="vertical"
      tools:actionBarNavMode="standard"&gt;
  
      &lt;!--HEADER--&gt;
      &lt;android.support.design.widget.AppBarLayout
          android:id="@+id/app_bar"
          android:layout_width="match_parent"
          android:layout_height="180dp"
          android:fitsSystemWindows="true"
          android:theme="@style/AppTheme.AppBarOverlay"&gt;
  
          &lt;android.support.design.widget.CollapsingToolbarLayout
              android:id="@+id/toolbar_layout"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:background="@drawable/herocortado"
              android:fitsSystemWindows="true"
              app:contentScrim="@android:color/transparent"
              app:layout_scrollFlags="scroll|exitUntilCollapsed"
              app:statusBarScrim="@color/colorTransparent"
              app:titleEnabled="false"
              app:toolbarId="@id/tlb_subscribe"&gt;
  
              &lt;android.support.v7.widget.Toolbar
                  android:id="@+id/tlb_subscribe"
                  android:layout_width="match_parent"
                  android:layout_height="?attr/actionBarSize"
                  app:layout_collapseMode="pin"
                  app:navigationIcon="@drawable/back"
                  app:popupTheme="@style/AppTheme.PopupOverlay"
                  app:title=""
                  app:titleTextColor="@color/colorWhite" /&gt;
  
          &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;android.support.v4.widget.NestedScrollView
          android:id="@+id/nsv_subscribe"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          app:layout_behavior="@string/appbar_scrolling_view_behavior"&gt;
  
          &lt;LinearLayout
              style="@style/stl_body"
              android:layout_marginTop="65dp"
              android:orientation="vertical"&gt;
  
              &lt;EditText
                  android:id="@+id/edt_subscribe_nome"
                  style="@style/stl_edt"
                  android:hint="@string/str_subscribe_hint_edt_name"
                  android:inputType="textPersonName" /&gt;
  
              &lt;TextView
                  android:id="@+id/tvw_subscribe_name_error"
                  style="@style/stl_msg_error_fields"
                  android:text="" /&gt;
  
               &lt;!— ANOTHERS FIELDS —&gt;
  
  &lt;/android.support.v4.widget.NestedScrollView&gt;
  
      &lt;com.test.me.utils.CircularProfilePhoto
          android:id="@+id/imv_subscribe_avatar"
          android:layout_width="140dp"
          android:layout_height="140dp"
          android:layout_margin="@dimen/fab_margin"
          app:layout_anchor="@id/app_bar"
          app:layout_anchorGravity="bottom|center_horizontal"
          app:srcCompat="@drawable/defaultavatar" /&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>