Skip to content

SimpleDraweeView apply Fade.OUT transition without effect #2388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
b7woreo opened this issue Aug 11, 2019 · 4 comments
Closed

SimpleDraweeView apply Fade.OUT transition without effect #2388

b7woreo opened this issue Aug 11, 2019 · 4 comments
Assignees
Labels

Comments

@b7woreo
Copy link

b7woreo commented Aug 11, 2019

Description

Use TransitionManager.begainDelayTransition() apply Fade transition on SimpleDraweeView from visible to invisible. SimpleDraweeView disappear directly without fade out effect.

Reproduction

Sample Project

Solution

Before Android 7.0 ImageView will call Drawable.setVisible() method when setVisibility method called, so when call GenericDraweeView.setVisibility(INVISIBLE) method will lead RootDrawable to invisible.
When begin transition, Fade direct modify target view visibility flag to restore target view visibility, but it will not change RootDrawable to visiable.
And then when GenericDraweeView try to draw RootDrawable through RootDrawable.draw() method, it just return because it is invisiable.

There is a simple way to fix issue: just remove isVisible judgement in RootDrawable.draw() method, like this:

  public void draw(Canvas canvas) {
    if (mVisibilityCallback != null) {
      mVisibilityCallback.onDraw();
    }
    super.draw(canvas);
    if (mControllerOverlay != null) {
      mControllerOverlay.setBounds(getBounds());
      mControllerOverlay.draw(canvas);
    }
  }

I read most of Drawable source code, such as BitmapDrawable, ColorDrawable etc, none of drawable skip draw when it is invisible. When view is invisible who own drawable, it will skip draw and will not call Drawable.draw() method, so this modification will not increase performance overhead and can keep same draw behaviour with all other drawable.

May I open a pr to fix this issue?

Additional Information

  • Fresco version: 2.0.0
  • Platform version: Android 5.0
@defHLT defHLT self-assigned this Aug 12, 2019
@oprisnik
Copy link
Contributor

There's also lots of related discussion about transitions going on here: #1445

@b7woreo
Copy link
Author

b7woreo commented Aug 13, 2019

@oprisnik Yeh, but the problem has not been fixed. I read Drawable document about setVisiable method, it point out this method just a hint used by drawable, but does not impact drawable's behavior. So, I think RootDrawable.draw method is not correct.
There is my solution: #2391

@stale
Copy link

stale bot commented Aug 20, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "bug" or "enhancement" and I will leave it open. Thank you for your contributions.

@stale stale bot added the stale label Aug 20, 2019
@stale
Copy link

stale bot commented Aug 27, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to reopen with up-to-date information.

@stale stale bot closed this as completed Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants