summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/AppsCustomizeTabHost.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-06-27 19:08:49 -0700
committerWinson Chung <winsonc@google.com>2011-07-25 13:48:59 -0700
commit5a808358f1a773dab8babae44899ffd4ed1810c1 (patch)
tree51da799b228afea0af7fad593b6f6899fb3c0ab4 /src/com/android/launcher2/AppsCustomizeTabHost.java
parenta22194bd9ff845775f91bff719322aba2522d32c (diff)
downloadandroid_packages_apps_Trebuchet-5a808358f1a773dab8babae44899ffd4ed1810c1.tar.gz
android_packages_apps_Trebuchet-5a808358f1a773dab8babae44899ffd4ed1810c1.tar.bz2
android_packages_apps_Trebuchet-5a808358f1a773dab8babae44899ffd4ed1810c1.zip
Adding menu to jump to shortcuts page in widgets tab
- Fixing bug in PagedView when setting the current page - Fixing small visual issue with flashing scroll indicator - Fixing slightly offset holographic icons Change-Id: Ic6ce6365daca41cb5a73706c7c4b078f33a4e39c
Diffstat (limited to 'src/com/android/launcher2/AppsCustomizeTabHost.java')
-rw-r--r--src/com/android/launcher2/AppsCustomizeTabHost.java38
1 files changed, 32 insertions, 6 deletions
diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/android/launcher2/AppsCustomizeTabHost.java
index d3215f093..c2d13410d 100644
--- a/src/com/android/launcher2/AppsCustomizeTabHost.java
+++ b/src/com/android/launcher2/AppsCustomizeTabHost.java
@@ -52,12 +52,29 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
}
/**
- * Convenience methods to select specific tabs
+ * Convenience methods to select specific tabs. We want to set the content type immediately
+ * in these cases, but we note that we still call setCurrentTabByTag() so that the tab view
+ * reflects the new content (but doesn't do the animation and logic associated with changing
+ * tabs manually).
*/
+ private void setContentTypeImmediate(AppsCustomizePagedView.ContentType type) {
+ onTabChangedStart();
+ onTabChangedEnd(type);
+ }
void selectAppsTab() {
+ setContentTypeImmediate(AppsCustomizePagedView.ContentType.Applications);
setCurrentTabByTag(APPS_TAB_TAG);
}
void selectWidgetsTab() {
+ setContentTypeImmediate(AppsCustomizePagedView.ContentType.Widgets);
+ mAppsCustomizePane.setCurrentPageToWidgets();
+
+ setCurrentTabByTag(WIDGETS_TAB_TAG);
+ }
+ void selectShortcutsTab() {
+ setContentTypeImmediate(AppsCustomizePagedView.ContentType.Widgets);
+ mAppsCustomizePane.setCurrentPageToShortcuts();
+
setCurrentTabByTag(WIDGETS_TAB_TAG);
}
@@ -135,6 +152,13 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
return super.onTouchEvent(event);
}
+ private void onTabChangedStart() {
+ mAppsCustomizePane.hideScrollingIndicator(false);
+ }
+ private void onTabChangedEnd(AppsCustomizePagedView.ContentType type) {
+ mAppsCustomizePane.setContentType(type);
+ }
+
@Override
public void onTabChanged(String tabId) {
final AppsCustomizePagedView.ContentType type = getContentTypeForTabTag(tabId);
@@ -148,11 +172,11 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
anim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(android.animation.Animator animation) {
- mAppsCustomizePane.hideScrollingIndicator(false);
+ onTabChangedStart();
}
@Override
public void onAnimationEnd(android.animation.Animator animation) {
- mAppsCustomizePane.setContentType(type);
+ onTabChangedEnd(type);
ObjectAnimator anim = ObjectAnimator.ofFloat(mAppsCustomizePane, "alpha", 1f);
anim.setDuration(duration);
@@ -206,7 +230,7 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
/* LauncherTransitionable overrides */
@Override
- public void onLauncherTransitionStart(Animator animation) {
+ public void onLauncherTransitionStart(Animator animation, boolean toWorkspace) {
// isHardwareAccelerated() checks if we're attached to a window and if that
// window is HW accelerated-- we were sometimes not attached to a window
// and buildLayer was throwing an IllegalStateException
@@ -221,11 +245,13 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
}
@Override
- public void onLauncherTransitionEnd(Animator animation) {
+ public void onLauncherTransitionEnd(Animator animation, boolean toWorkspace) {
if (animation != null) {
setLayerType(LAYER_TYPE_NONE, null);
}
- mAppsCustomizePane.flashScrollingIndicator();
+ if (!toWorkspace) {
+ mAppsCustomizePane.flashScrollingIndicator();
+ }
}
}