diff options
author | Winson Chung <winsonc@google.com> | 2011-06-13 11:32:14 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2011-06-23 11:26:17 -0700 |
commit | b44b52439d155f570db7d6d0b80fdd3350e35685 (patch) | |
tree | d07c95c4a43b7bfb1504b1a521e097f238f6eb77 /src/com/android/launcher2/AppsCustomizeTabHost.java | |
parent | 4b825dcd5f64a5ebb60271844fbc5257374422bc (diff) | |
download | android_packages_apps_Trebuchet-b44b52439d155f570db7d6d0b80fdd3350e35685.tar.gz android_packages_apps_Trebuchet-b44b52439d155f570db7d6d0b80fdd3350e35685.tar.bz2 android_packages_apps_Trebuchet-b44b52439d155f570db7d6d0b80fdd3350e35685.zip |
Loading previews and holographic icons in background thread using AsyncTasks.
- Adding back animation between tabs
Change-Id: I1a49bfca4f85f579e232861aa02d08fb25d0aafc
Diffstat (limited to 'src/com/android/launcher2/AppsCustomizeTabHost.java')
-rw-r--r-- | src/com/android/launcher2/AppsCustomizeTabHost.java | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/android/launcher2/AppsCustomizeTabHost.java index 51db66c73..87c154b47 100644 --- a/src/com/android/launcher2/AppsCustomizeTabHost.java +++ b/src/com/android/launcher2/AppsCustomizeTabHost.java @@ -17,6 +17,8 @@ package com.android.launcher2; import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; +import android.animation.ObjectAnimator; import android.content.Context; import android.content.res.Resources; import android.util.AttributeSet; @@ -24,6 +26,7 @@ import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; +import android.view.ViewPropertyAnimator; import android.widget.TabHost; import android.widget.TabWidget; import android.widget.TextView; @@ -121,7 +124,26 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona @Override public void onTabChanged(String tabId) { - mAppsCustomizePane.setContentType(getContentTypeForTabTag(tabId)); + final AppsCustomizePagedView.ContentType type = getContentTypeForTabTag(tabId); + if (!mAppsCustomizePane.isContentType(type)) { + // Animate the changing of the tab content by fading pages in and out + final Resources res = getResources(); + final int duration = res.getInteger(R.integer.config_tabTransitionDuration); + + ObjectAnimator anim = ObjectAnimator.ofFloat(mAppsCustomizePane, "alpha", 0f); + anim.setDuration(duration); + anim.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(android.animation.Animator animation) { + mAppsCustomizePane.setContentType(type); + + ObjectAnimator anim = ObjectAnimator.ofFloat(mAppsCustomizePane, "alpha", 1f); + anim.setDuration(duration); + anim.start(); + } + }); + anim.start(); + } } /** |