nativehtml icon indicating copy to clipboard operation
nativehtml copied to clipboard

List bulletpoints display glitch.

Open MartB opened this issue 7 years ago • 7 comments

The bulletpoints stay visible about one second after i called supportFinishAfterTransition(). I guess onDraw is still getting called during the animation?

How can i disable this behaviour?

Even better would be an implementation with the help of BulletSpan instead of the custom logic. However im not sure how flexible BulletSpan in regards to multiple bulletpoint display styles.

MartB avatar Oct 25 '17 19:10 MartB

The problem might be related to the fact that the bullet points are drawn by the containing component... Would it be feasible to include this in the animation? I am not exactly sure what you are trying to do and how O:)

stefanhaustein avatar Oct 25 '17 21:10 stefanhaustein

The simplest way i can describe it is the following:

Im using a shared element transition on an image element Fragment => Activity. I call supportPostponeEnterTransition() in onCreate and then start it when the image is done loading and is rendered on screen. This works just fine!

If i scroll down to the Bulletpoints and press the back key on my actionbar / hw key. I use supportFinishAfterTransition() to return back to the fragment with an animation. However during that last part the bullet points are still visible until the animation is done but all the other content besides the image that has the shared element transition is hidden.

MartB avatar Oct 25 '17 21:10 MartB

The bullets are drawn in AndroidContainerElement.onDraw. One possible issue might be that some aspect of the state is not properly taken into account in canvas.drawText at the end of this method? c

stefanhaustein avatar Oct 28 '17 12:10 stefanhaustein

Im not too familiar with this but i will check what kind of state i might need to check

MartB avatar Oct 28 '17 15:10 MartB

Hmm bad news from me i found no way to fix this. As onDraw is called on every invalidation of the view it obviously gets called during the finishTransition and ends up drawing the dots.

I can workaround that by setting the htmlview to invisible before i call supportFinishAfterTransition() it looks kinda weird and totally defeats the purpose of the FinishAfterTransition but atleast it doesnt glitch out anymore.

Im not aware of any check that would help in the onDraw logic, maybe you can come up with something.

MartB avatar Oct 29 '17 04:10 MartB

Additional state could be the opacity / visibility of the corresponding child?

Maybe another option would be to move bullet drawing from the ol/ul element to the corresponding li?

stefanhaustein avatar Oct 29 '17 09:10 stefanhaustein

I think i tried the thing you mentioned in your first sentence i did check.

if (component.getVisibility() != View.VISIBLE) {
    continue;
}

and getAlpha() within the for loop and it did not change the behaviour.

However i noticed the following when i fire up my finish Animation:

D/ViewRootImpl[ArticleDetailActivity_]: changeCanvasOpacity: opaque=false
E/Calling animation: Finish
D/ViewRootImpl[ArticleDetailActivity_]: changeCanvasOpacity: opaque=false
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState0
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState0
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState0
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState0
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState0
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState0
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState0
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState0
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState0
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState0
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState0
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState0
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState0
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState0
D/ViewRootImpl[ArticleDetailActivity_]: changeCanvasOpacity: opaque=false
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState4
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState4
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState4
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState4
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState4
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState4
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState4
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState4
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState4
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState4
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState4
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState4
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState4
E/debug_main_container: alpha:1.0visibleState0
E/debug: alpha:1.0visibleState4

this is produced by image

This seems to indicate that moving the onDraw logic to the li element might fix it ? Please correct me if iam wrong. I also noticed that the bulletpoints render before the animation is done and the rest of the htmlcontainer is visible on the screen. So it seems to be decoupled from all the other elements for some reason ?

MartB avatar Oct 29 '17 15:10 MartB