From fea0a5f629f7bc59117401b744ed334cf33a7ae0 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Thu, 19 May 2016 11:27:55 -0700 Subject: [PATCH] Add more null checks for page indicators. Change-Id: Id86d4827c9079abfb236f956e531f0e29edfc54e --- src/com/android/launcher3/Workspace.java | 4 +++- .../android/launcher3/WorkspaceStateTransitionAnimation.java | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index f8eff6987a..29ebeb9df5 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -1337,7 +1337,9 @@ public class Workspace extends PagedView // different effects based on device performance. On at least one relatively high-end // device I've tried, translating the launcher causes things to get quite laggy. setTranslationAndAlpha(mLauncher.getSearchDropTargetBar(), transX, alpha); - setTranslationAndAlpha(getPageIndicator().getView(), transX, alpha); + if (getPageIndicator() != null) { + setTranslationAndAlpha(getPageIndicator().getView(), transX, alpha); + } setTranslationAndAlpha(getChildAt(getCurrentPage()), transX, alpha); setTranslationAndAlpha(mLauncher.getHotseat(), transX, alpha); diff --git a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java index 60070a8107..38a578c857 100644 --- a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java +++ b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java @@ -357,7 +357,8 @@ public class WorkspaceStateTransitionAnimation { final ViewGroup overviewPanel = mLauncher.getOverviewPanel(); final View hotseat = mLauncher.getHotseat(); - final View pageIndicator = mWorkspace.getPageIndicator().getView(); + final View pageIndicator = mWorkspace.getPageIndicator() == null ? null + : mWorkspace.getPageIndicator().getView(); if (animated) { LauncherViewPropertyAnimator scale = new LauncherViewPropertyAnimator(mWorkspace); scale.scaleX(mNewScale)