private void setUpLoggingListener() {
    if (mSettableDraweeHierarchy instanceof GenericDraweeHierarchy) {
      ((GenericDraweeHierarchy) mSettableDraweeHierarchy)
          .setOnFadeListener(
              new OnFadeListener() {
                @Override
                public void onFadeFinished() {
                  if (mLegacyOnFadeListener != null) {
                    mLegacyOnFadeListener.onFadeFinished(mId);
                  }
                }

                @Override
                public void onShownImmediately() {}

                @Override
                public void onFadeStarted() {
                  if (mLegacyOnFadeListener != null) {
                    mLegacyOnFadeListener.onFadeStarted(mId);
                  }
                }
              });
    }
  }
Sets the hierarchy.

<p>The controller should be detached when this method is called.

@param hierarchy This must be an instance of {@link SettableDraweeHierarchy}
drawee/src/main/java/com/facebook/drawee/controller/AbstractDraweeController.java