summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/AllAppsTabbed.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2010-08-09 16:03:15 -0700
committerWinson Chung <winsonc@google.com>2010-08-16 15:51:43 -0700
commit80baf5a6b3c62a62265f626d43d1167783c94131 (patch)
treeda3dba4d3920ffbae802ab256c19d5f0b590089b /src/com/android/launcher2/AllAppsTabbed.java
parent321e9ee68848d9e782fd557f69cc070308ffbc9c (diff)
downloadandroid_packages_apps_Trebuchet-80baf5a6b3c62a62265f626d43d1167783c94131.tar.gz
android_packages_apps_Trebuchet-80baf5a6b3c62a62265f626d43d1167783c94131.tar.bz2
android_packages_apps_Trebuchet-80baf5a6b3c62a62265f626d43d1167783c94131.zip
Adding paging for the widget/shortcut/folder customization area and fixing bugs.
Adding pages for customization drawer with initial implementation of proposed flow layout for widgets. Fixes for keeping all apps, and widgets in sync with Launcher Model, optimizations for reloading all apps pages when invalidating. Adding some animations for tab transitions and feedback when long pressing to add certain items. Change-Id: I8d51749f3a91c964bed35681f3a9192200b0d93e
Diffstat (limited to 'src/com/android/launcher2/AllAppsTabbed.java')
-rw-r--r--src/com/android/launcher2/AllAppsTabbed.java43
1 files changed, 32 insertions, 11 deletions
diff --git a/src/com/android/launcher2/AllAppsTabbed.java b/src/com/android/launcher2/AllAppsTabbed.java
index 0470cee3e..114da4ed2 100644
--- a/src/com/android/launcher2/AllAppsTabbed.java
+++ b/src/com/android/launcher2/AllAppsTabbed.java
@@ -18,6 +18,10 @@ package com.android.launcher2;
import java.util.ArrayList;
+import android.animation.Animatable;
+import android.animation.AnimatableListenerAdapter;
+import android.animation.Animator;
+import android.animation.PropertyAnimator;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Color;
@@ -96,16 +100,30 @@ public class AllAppsTabbed extends TabHost implements AllAppsView {
setOnTabChangedListener(new OnTabChangeListener() {
public void onTabChanged(String tabId) {
- String tag = getCurrentTabTag();
- if (tag == TAG_ALL) {
- mAllApps.setAppFilter(AllAppsPagedView.ALL_APPS_FLAG);
- } else if (tag == TAG_APPS) {
- mAllApps.setAppFilter(ApplicationInfo.APP_FLAG);
- } else if (tag == TAG_GAMES) {
- mAllApps.setAppFilter(ApplicationInfo.GAME_FLAG);
- } else if (tag == TAG_DOWNLOADED) {
- mAllApps.setAppFilter(ApplicationInfo.DOWNLOADED_FLAG);
- }
+ // animate the changing of the tab content by fading pages in and out
+ final int duration = 150;
+ final float alpha = mAllApps.getAlpha();
+ Animator alphaAnim = new PropertyAnimator(duration, mAllApps, "alpha", alpha, 0.0f);
+ alphaAnim.addListener(new AnimatableListenerAdapter() {
+ public void onAnimationEnd(Animatable animation) {
+ String tag = getCurrentTabTag();
+ if (tag == TAG_ALL) {
+ mAllApps.setAppFilter(AllAppsPagedView.ALL_APPS_FLAG);
+ } else if (tag == TAG_APPS) {
+ mAllApps.setAppFilter(ApplicationInfo.APP_FLAG);
+ } else if (tag == TAG_GAMES) {
+ mAllApps.setAppFilter(ApplicationInfo.GAME_FLAG);
+ } else if (tag == TAG_DOWNLOADED) {
+ mAllApps.setAppFilter(ApplicationInfo.DOWNLOADED_FLAG);
+ }
+
+ final float alpha = mAllApps.getAlpha();
+ Animator alphaAnim =
+ new PropertyAnimator(duration, mAllApps, "alpha", alpha, 1.0f);
+ alphaAnim.start();
+ }
+ });
+ alphaAnim.start();
}
});
@@ -135,9 +153,12 @@ public class AllAppsTabbed extends TabHost implements AllAppsView {
@Override
public void setVisibility(int visibility) {
+ final boolean isVisible = (visibility == View.VISIBLE);
super.setVisibility(visibility);
- float zoom = visibility == View.VISIBLE ? 1.0f : 0.0f;
+ float zoom = (isVisible ? 1.0f : 0.0f);
mAllApps.zoom(zoom, false);
+ if (!isVisible)
+ mAllApps.cleanup();
}
@Override