diff options
author | Dake Gu <dake@google.com> | 2017-08-01 13:42:42 -0700 |
---|---|---|
committer | Dake Gu <dake@google.com> | 2017-08-01 14:17:39 -0700 |
commit | 43ad57e548b86daf50e0ebfde440fe431a41cb1e (patch) | |
tree | 2c09104bc88416e16b6326d437f40971f746aebc /tools/aapt2/java/JavaClassGenerator_test.cpp | |
parent | 0d7ff5328e15a1de752dcb483f9aca0e55a44118 (diff) |
View: fix setTransientState
Following four steps with RecyclerView - CardView - ImageView:
a. fade in imageview in onBind:
calling imageView.setTransientState(true)
b. RecyclerView animate the item: calling
cardView.setTransientState(true)
c. fade-in finishes, calling imageView.setTransientState(false)
d. RecyclerView animation finishes: calling
cardView.setTransientState(false)
After these four steps, RecyclerView unexpectedly has transient
state.
The problem is in step b, when calling cardView.setTransientState()
it incorrectly calls parent.childHasTransientStateChanged(this, true)
which causes RecyclerView's mChildCountWithTransientState increased
to 2. And it's decreased to 1 in step d and stay as 1 forever.
The child should only call childHasTransientStateChanged() when
actual hasTransientState() changed.
Bug: 64235615
Test: ViewTransientStateTest
Change-Id: I99ed35cc9c49e54d36590d8f1d206501fd3288f2
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions