summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/CacheManager.cpp
diff options
context:
space:
mode:
authorHai Zhang <zhanghai@google.com>2021-05-11 23:20:48 -0700
committerHai Zhang <zhanghai@google.com>2021-05-13 11:24:48 -0700
commit32a20b392c0fa87abb4b636352f0afb2f431406d (patch)
tree78f19ac7b26deb874d4aa8f694a95a16004c7320 /libs/hwui/renderthread/CacheManager.cpp
parent15bfc8ac912a57d0a7958674ad52fea2f9663c3e (diff)
Improve SettingsTransitionActivity for standalone usage.
- Allow subclass to override when the transition should be enabled, because we may not want to enable it on other form factors, e.g. on wear. - Retrieve the Toolbar instance by overriding setActionBar() which should be called by any activity using Toolbar as its action bar. Even if there's any activity not using Toolbar as action bar, it won't behave well with our transition anyway. - Refactored ActivityOptions Bundle creation logic to simplify the code. I did the refactoring originally for sharing it with a new SettingsTransitionFragment, but then realized doing it in fragment would be very tedious and unreliable. Still the refactoring looks a good simplification to me. - Don't override onOptionsItemSelected() in SettingsTransitionActivity because different form factors might be expecting different behaviors for the home/up indicator on Toolbar, e.g. we might expand/collapse a drawer or do something else instead of finishing the current activity on Tablet. The original implementation that calls onBackPressed() is also technically incorrect because pressing up is a different action. The reason the original implementation did so is probably for enabling transition upon activity finish, but that should actually be done by calling finishAfterTransition(), so I've fixed the CollapsingToolbarBaseActivity to call finishAfterTransition() instead of finish(). This shouldn't bring any regression to existing users of SettingsTransitionActivity as well because currently the only user of it is CollapsingToolbarBaseActivity. Bug: 177638625 Test: manually on R and S platforms Change-Id: I3c5955db3753f00604b625bd21bf7e78f237ec15
Diffstat (limited to 'libs/hwui/renderthread/CacheManager.cpp')
0 files changed, 0 insertions, 0 deletions