Skip to content
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

Fix tint flicker in CardBrandView #3456

Merged
merged 1 commit into from
Mar 11, 2021
Merged

Conversation

mshafrir-stripe
Copy link
Collaborator

Summary

Previously, tint was first applied in onWindowFocusChanged(). This
is late enough after the view is first rendered that a noticeable
"flicker" is seen.

Use doOnNextLayout to resolve.

Screenshots

Before, the icon tint changes from black to gray.

Before After
before after

Previously, tint was first applied in `onWindowFocusChanged()`. This
is late enough after the view is first rendered that a noticable
"flicker" is seen.

Use `doOnNextLayout` to resolve.
@@ -6,6 +6,7 @@ import android.view.LayoutInflater
import android.widget.FrameLayout
import androidx.annotation.ColorInt
import androidx.core.graphics.drawable.DrawableCompat
import androidx.core.view.doOnNextLayout
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These extensions are great!

@mshafrir-stripe mshafrir-stripe merged commit 2e1ffc4 into master Mar 11, 2021
@mshafrir-stripe mshafrir-stripe deleted the fix-card-brand-view branch March 11, 2021 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants