Wait until updateItems is called to perform addStaticViews.
This is more consistent with pre-LayoutTransition approach, and should behave more reliably on phones. Flag: com.android.window.flags.enable_taskbar_recents_layout_transition Bug: 343521765 Test: go/testedequals Change-Id: Ib758b1e44c3b87d6d2ff71425ed40ff621261104
This commit is contained in:
@@ -129,7 +129,7 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
|
||||
|
||||
private final int mAllAppsButtonTranslationOffset;
|
||||
|
||||
private final int mNumStaticViews;
|
||||
private int mNumStaticViews;
|
||||
|
||||
private Set<GroupTask> mPrevRecentTasks = Collections.emptySet();
|
||||
private Set<GroupTask> mPrevOverflowTasks = Collections.emptySet();
|
||||
@@ -199,8 +199,6 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
|
||||
|
||||
// TODO: Disable touch events on QSB otherwise it can crash.
|
||||
mQsb = LayoutInflater.from(context).inflate(R.layout.search_container_hotseat, this, false);
|
||||
|
||||
mNumStaticViews = ENABLE_TASKBAR_RECENTS_LAYOUT_TRANSITION.isTrue() ? addStaticViews() : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -448,6 +446,10 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
|
||||
private void updateItemsWithLayoutTransition(
|
||||
ItemInfo[] hotseatItemInfos, List<GroupTask> recentTasks) {
|
||||
|
||||
if (mNumStaticViews == 0) {
|
||||
mNumStaticViews = addStaticViews();
|
||||
}
|
||||
|
||||
// Skip static views and potential All Apps divider, if they are on the left.
|
||||
mNextViewIndex = mIsRtl ? 0 : mNumStaticViews;
|
||||
if (getChildAt(mNextViewIndex) == mTaskbarDividerContainer && !mAddedDividerForRecents) {
|
||||
|
||||
Reference in New Issue
Block a user