summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Bird <sbird@cyngn.com>2015-06-08 21:08:13 (GMT)
committerGerrit Code Review <gerrit@cyanogenmod.org>2015-06-11 17:41:13 (GMT)
commitf7c091a7b4ababf293f2a8b2260d6e28720669bb (patch)
treee7e6869d80dc5454c1e4b8596d4ac7aadb4fe7e3
parent12302cb4ac405f2f88d12a93ea8687e4d2ae838c (diff)
downloadandroid_packages_apps_Trebuchet-f7c091a7b4ababf293f2a8b2260d6e28720669bb.zip
android_packages_apps_Trebuchet-f7c091a7b4ababf293f2a8b2260d6e28720669bb.tar.gz
android_packages_apps_Trebuchet-f7c091a7b4ababf293f2a8b2260d6e28720669bb.tar.bz2
Protected Apps: Fix OutOfBounds error when all apps are protected
Change-Id: Ifebad499b03887a4f5e40502c994e5b0e80506f0
-rw-r--r--src/com/android/launcher3/AppDrawerScrubber.java24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/com/android/launcher3/AppDrawerScrubber.java b/src/com/android/launcher3/AppDrawerScrubber.java
index 0ace60d..db1aa61 100644
--- a/src/com/android/launcher3/AppDrawerScrubber.java
+++ b/src/com/android/launcher3/AppDrawerScrubber.java
@@ -83,17 +83,23 @@ public class AppDrawerScrubber extends LinearLayout {
}
resetScrubber();
- String section = String.valueOf(mSections[progress]);
-
- if (mScrubberIndicator != null) {
- float translateX = (progress * seekBar.getWidth()) / mSections.length;
- translateX -= (mScrubberIndicator.getWidth() / 6); // offset for alignment
- mScrubberIndicator.setTranslationX(translateX);
- mScrubberIndicator.setText(section);
+ if (mSections.length == 0) {
+ updateSections();
}
- mLayoutManager.smoothScrollToPosition(mListView, null,
- mAdapter.getPositionForSection(progress));
+ if (mSections.length > 0) {
+ String section = String.valueOf(mSections[progress]);
+
+ if (mScrubberIndicator != null) {
+ float translateX = (progress * seekBar.getWidth()) / mSections.length;
+ translateX -= (mScrubberIndicator.getWidth() / 6); // offset for alignment
+ mScrubberIndicator.setTranslationX(translateX);
+ mScrubberIndicator.setText(section);
+ }
+
+ mLayoutManager.smoothScrollToPosition(mListView, null,
+ mAdapter.getPositionForSection(progress));
+ }
}
@Override