blob: 023946b26e1a74a239e4e320b88b0371251ab9a0 [file] [log] [blame]
Winson Chung785d2eb2011-04-14 16:08:02 -07001/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.launcher2;
18
Winson Chungf0ea4d32011-06-06 14:27:16 -070019import android.animation.Animator;
Winson Chungb44b5242011-06-13 11:32:14 -070020import android.animation.AnimatorListenerAdapter;
Winson Chungf314b0e2011-08-16 11:54:27 -070021import android.animation.AnimatorSet;
Winson Chungb44b5242011-06-13 11:32:14 -070022import android.animation.ObjectAnimator;
Winson Chung785d2eb2011-04-14 16:08:02 -070023import android.content.Context;
24import android.content.res.Resources;
25import android.util.AttributeSet;
26import android.view.LayoutInflater;
Winson Chung4179b4e2011-05-31 17:28:12 -070027import android.view.MotionEvent;
Winson Chung785d2eb2011-04-14 16:08:02 -070028import android.view.View;
29import android.view.ViewGroup;
Michael Jurka141dbd02011-11-03 13:50:45 -070030import android.widget.FrameLayout;
Michael Jurka1899a362011-11-03 13:50:45 -070031import android.widget.LinearLayout;
Winson Chung785d2eb2011-04-14 16:08:02 -070032import android.widget.TabHost;
Winson Chungfaa13252011-06-13 18:15:54 -070033import android.widget.TabWidget;
Winson Chung785d2eb2011-04-14 16:08:02 -070034import android.widget.TextView;
35
36import com.android.launcher.R;
37
Michael Jurka141dbd02011-11-03 13:50:45 -070038import java.util.ArrayList;
39
Winson Chung785d2eb2011-04-14 16:08:02 -070040public class AppsCustomizeTabHost extends TabHost implements LauncherTransitionable,
41 TabHost.OnTabChangeListener {
42 static final String LOG_TAG = "AppsCustomizeTabHost";
43
44 private static final String APPS_TAB_TAG = "APPS";
45 private static final String WIDGETS_TAB_TAG = "WIDGETS";
46
47 private final LayoutInflater mLayoutInflater;
Winson Chungf0ea4d32011-06-06 14:27:16 -070048 private ViewGroup mTabs;
Winson Chungfd3385f2011-06-15 19:51:24 -070049 private ViewGroup mTabsContainer;
Winson Chung4179b4e2011-05-31 17:28:12 -070050 private AppsCustomizePagedView mAppsCustomizePane;
Adam Cohen0cd3b642011-10-14 14:58:00 -070051 private boolean mSuppressContentCallback = false;
Michael Jurka141dbd02011-11-03 13:50:45 -070052 private FrameLayout mAnimationBuffer;
Michael Jurka1899a362011-11-03 13:50:45 -070053 private LinearLayout mContent;
Winson Chung785d2eb2011-04-14 16:08:02 -070054
Winson Chungc100e8e2011-08-09 16:02:43 -070055 private boolean mInTransition;
56 private boolean mResetAfterTransition;
57
Winson Chung785d2eb2011-04-14 16:08:02 -070058 public AppsCustomizeTabHost(Context context, AttributeSet attrs) {
59 super(context, attrs);
60 mLayoutInflater = LayoutInflater.from(context);
61 }
62
Winson Chungf0ea4d32011-06-06 14:27:16 -070063 /**
Winson Chung5a808352011-06-27 19:08:49 -070064 * Convenience methods to select specific tabs. We want to set the content type immediately
65 * in these cases, but we note that we still call setCurrentTabByTag() so that the tab view
66 * reflects the new content (but doesn't do the animation and logic associated with changing
67 * tabs manually).
Winson Chungf0ea4d32011-06-06 14:27:16 -070068 */
Winson Chung5a808352011-06-27 19:08:49 -070069 private void setContentTypeImmediate(AppsCustomizePagedView.ContentType type) {
70 onTabChangedStart();
71 onTabChangedEnd(type);
72 }
Winson Chung55b65502011-05-26 12:03:43 -070073 void selectAppsTab() {
Winson Chung5a808352011-06-27 19:08:49 -070074 setContentTypeImmediate(AppsCustomizePagedView.ContentType.Applications);
Winson Chung55b65502011-05-26 12:03:43 -070075 setCurrentTabByTag(APPS_TAB_TAG);
76 }
77 void selectWidgetsTab() {
Winson Chung5a808352011-06-27 19:08:49 -070078 setContentTypeImmediate(AppsCustomizePagedView.ContentType.Widgets);
Winson Chung5a808352011-06-27 19:08:49 -070079 setCurrentTabByTag(WIDGETS_TAB_TAG);
80 }
Winson Chung55b65502011-05-26 12:03:43 -070081
Winson Chung785d2eb2011-04-14 16:08:02 -070082 /**
83 * Setup the tab host and create all necessary tabs.
84 */
85 @Override
86 protected void onFinishInflate() {
87 // Setup the tab host
88 setup();
89
Winson Chungfd3385f2011-06-15 19:51:24 -070090 final ViewGroup tabsContainer = (ViewGroup) findViewById(R.id.tabs_container);
Winson Chungfaa13252011-06-13 18:15:54 -070091 final TabWidget tabs = (TabWidget) findViewById(com.android.internal.R.id.tabs);
Winson Chung4179b4e2011-05-31 17:28:12 -070092 final AppsCustomizePagedView appsCustomizePane = (AppsCustomizePagedView)
Winson Chung785d2eb2011-04-14 16:08:02 -070093 findViewById(R.id.apps_customize_pane_content);
Winson Chungf0ea4d32011-06-06 14:27:16 -070094 mTabs = tabs;
Winson Chungfd3385f2011-06-15 19:51:24 -070095 mTabsContainer = tabsContainer;
Winson Chung4179b4e2011-05-31 17:28:12 -070096 mAppsCustomizePane = appsCustomizePane;
Michael Jurka141dbd02011-11-03 13:50:45 -070097 mAnimationBuffer = (FrameLayout) findViewById(R.id.animation_buffer);
Michael Jurka1899a362011-11-03 13:50:45 -070098 mContent = (LinearLayout) findViewById(R.id.apps_customize_content);
Winson Chung4179b4e2011-05-31 17:28:12 -070099 if (tabs == null || mAppsCustomizePane == null) throw new Resources.NotFoundException();
Winson Chung785d2eb2011-04-14 16:08:02 -0700100
101 // Configure the tabs content factory to return the same paged view (that we change the
102 // content filter on)
103 TabContentFactory contentFactory = new TabContentFactory() {
104 public View createTabContent(String tag) {
Winson Chung4179b4e2011-05-31 17:28:12 -0700105 return appsCustomizePane;
Winson Chung785d2eb2011-04-14 16:08:02 -0700106 }
107 };
108
109 // Create the tabs
110 TextView tabView;
Winson Chungd2c1f802011-10-14 12:26:54 -0700111 String label;
112 label = mContext.getString(R.string.all_apps_button_label);
Winson Chung785d2eb2011-04-14 16:08:02 -0700113 tabView = (TextView) mLayoutInflater.inflate(R.layout.tab_widget_indicator, tabs, false);
Winson Chungd2c1f802011-10-14 12:26:54 -0700114 tabView.setText(label);
115 tabView.setContentDescription(label);
Winson Chung785d2eb2011-04-14 16:08:02 -0700116 addTab(newTabSpec(APPS_TAB_TAG).setIndicator(tabView).setContent(contentFactory));
Winson Chungd2c1f802011-10-14 12:26:54 -0700117 label = mContext.getString(R.string.widgets_tab_label);
Winson Chung785d2eb2011-04-14 16:08:02 -0700118 tabView = (TextView) mLayoutInflater.inflate(R.layout.tab_widget_indicator, tabs, false);
Winson Chungd2c1f802011-10-14 12:26:54 -0700119 tabView.setText(label);
120 tabView.setContentDescription(label);
Winson Chung785d2eb2011-04-14 16:08:02 -0700121 addTab(newTabSpec(WIDGETS_TAB_TAG).setIndicator(tabView).setContent(contentFactory));
Winson Chung785d2eb2011-04-14 16:08:02 -0700122 setOnTabChangedListener(this);
Winson Chungfaa13252011-06-13 18:15:54 -0700123
124 // Setup the key listener to jump between the last tab view and the market icon
125 AppsCustomizeTabKeyEventListener keyListener = new AppsCustomizeTabKeyEventListener();
126 View lastTab = tabs.getChildTabViewAt(tabs.getTabCount() - 1);
127 lastTab.setOnKeyListener(keyListener);
128 View shopButton = findViewById(R.id.market_button);
129 shopButton.setOnKeyListener(keyListener);
Winson Chungfd3385f2011-06-15 19:51:24 -0700130
131 // Hide the tab bar until we measure
132 mTabsContainer.setAlpha(0f);
Winson Chungf0ea4d32011-06-06 14:27:16 -0700133 }
Winson Chung785d2eb2011-04-14 16:08:02 -0700134
Winson Chungf0ea4d32011-06-06 14:27:16 -0700135 @Override
136 protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
137 boolean remeasureTabWidth = (mTabs.getLayoutParams().width <= 0);
138 super.onMeasure(widthMeasureSpec, heightMeasureSpec);
139
140 // Set the width of the tab list to the content width
141 if (remeasureTabWidth) {
Winson Chungfd3385f2011-06-15 19:51:24 -0700142 int contentWidth = mAppsCustomizePane.getPageContentWidth();
Michael Jurka141dbd02011-11-03 13:50:45 -0700143 if (contentWidth > 0 && mTabs.getLayoutParams().width != contentWidth) {
144 // Set the width and show the tab bar
Winson Chungfd3385f2011-06-15 19:51:24 -0700145 mTabs.getLayoutParams().width = contentWidth;
Michael Jurkac57b7a82011-08-09 22:02:20 -0700146 post(new Runnable() {
147 public void run() {
148 mTabs.requestLayout();
Winson Chung7ed37742011-09-08 15:45:51 -0700149 mTabsContainer.setAlpha(1f);
Michael Jurkac57b7a82011-08-09 22:02:20 -0700150 }
151 });
Winson Chungfd3385f2011-06-15 19:51:24 -0700152 }
Winson Chungf0ea4d32011-06-06 14:27:16 -0700153 }
Winson Chungfd3385f2011-06-15 19:51:24 -0700154 super.onMeasure(widthMeasureSpec, heightMeasureSpec);
Winson Chung4179b4e2011-05-31 17:28:12 -0700155 }
156
157 @Override
158 public boolean onTouchEvent(MotionEvent event) {
159 // Intercept all touch events up to the bottom of the AppsCustomizePane so they do not fall
160 // through to the workspace and trigger showWorkspace()
161 if (event.getY() < mAppsCustomizePane.getBottom()) {
162 return true;
163 }
164 return super.onTouchEvent(event);
Winson Chung785d2eb2011-04-14 16:08:02 -0700165 }
166
Winson Chung5a808352011-06-27 19:08:49 -0700167 private void onTabChangedStart() {
168 mAppsCustomizePane.hideScrollingIndicator(false);
169 }
Adam Cohen0cd3b642011-10-14 14:58:00 -0700170
Winson Chung097e6c72011-10-20 13:58:30 -0700171 private void reloadCurrentPage() {
172 if (!LauncherApplication.isScreenLarge()) {
Michael Jurkab737ee62011-11-15 15:57:22 -0800173 mAppsCustomizePane.flashScrollingIndicator(true);
Winson Chung097e6c72011-10-20 13:58:30 -0700174 }
175 mAppsCustomizePane.loadAssociatedPages(mAppsCustomizePane.getCurrentPage());
176 mAppsCustomizePane.requestFocus();
177 }
178
Winson Chung5a808352011-06-27 19:08:49 -0700179 private void onTabChangedEnd(AppsCustomizePagedView.ContentType type) {
180 mAppsCustomizePane.setContentType(type);
181 }
182
Winson Chung785d2eb2011-04-14 16:08:02 -0700183 @Override
184 public void onTabChanged(String tabId) {
Winson Chungb44b5242011-06-13 11:32:14 -0700185 final AppsCustomizePagedView.ContentType type = getContentTypeForTabTag(tabId);
Adam Cohen0cd3b642011-10-14 14:58:00 -0700186 if (mSuppressContentCallback) {
187 mSuppressContentCallback = false;
188 return;
Winson Chungb44b5242011-06-13 11:32:14 -0700189 }
Adam Cohen0cd3b642011-10-14 14:58:00 -0700190
191 // Animate the changing of the tab content by fading pages in and out
192 final Resources res = getResources();
193 final int duration = res.getInteger(R.integer.config_tabTransitionDuration);
194
195 // We post a runnable here because there is a delay while the first page is loading and
196 // the feedback from having changed the tab almost feels better than having it stick
197 post(new Runnable() {
198 @Override
199 public void run() {
Winson Chung097e6c72011-10-20 13:58:30 -0700200 if (mAppsCustomizePane.getMeasuredWidth() <= 0 ||
201 mAppsCustomizePane.getMeasuredHeight() <= 0) {
202 reloadCurrentPage();
203 return;
204 }
205
Michael Jurka141dbd02011-11-03 13:50:45 -0700206 // Take the visible pages and re-parent them temporarily to mAnimatorBuffer
207 // and then cross fade to the new pages
Winson Chungc6f10b92011-11-14 11:39:07 -0800208 int[] visiblePageRange = new int[2];
209 mAppsCustomizePane.getVisiblePages(visiblePageRange);
210 if (visiblePageRange[0] == -1 && visiblePageRange[1] == -1) {
211 // If we can't get the visible page ranges, then just skip the animation
212 reloadCurrentPage();
213 return;
214 }
215 ArrayList<View> visiblePages = new ArrayList<View>();
216 for (int i = visiblePageRange[0]; i <= visiblePageRange[1]; i++) {
217 visiblePages.add(mAppsCustomizePane.getPageAt(i));
218 }
Michael Jurka141dbd02011-11-03 13:50:45 -0700219
220 // We want the pages to be rendered in exactly the same way as they were when
221 // their parent was mAppsCustomizePane -- so set the scroll on mAnimationBuffer
222 // to be exactly the same as mAppsCustomizePane, and below, set the left/top
223 // parameters to be correct for each of the pages
224 mAnimationBuffer.scrollTo(mAppsCustomizePane.getScrollX(), 0);
225
Michael Jurka141dbd02011-11-03 13:50:45 -0700226 // mAppsCustomizePane renders its children in reverse order, so
227 // add the pages to mAnimationBuffer in reverse order to match that behavior
228 for (int i = visiblePages.size() - 1; i >= 0; i--) {
229 View child = visiblePages.get(i);
Winson Chungc6f10b92011-11-14 11:39:07 -0800230 if (child instanceof PagedViewCellLayout) {
231 ((PagedViewCellLayout) child).resetChildrenOnKeyListeners();
232 } else if (child instanceof PagedViewGridLayout) {
233 ((PagedViewGridLayout) child).resetChildrenOnKeyListeners();
234 }
Michael Jurka141dbd02011-11-03 13:50:45 -0700235 PagedViewWidget.setDeletePreviewsWhenDetachedFromWindow(false);
236 mAppsCustomizePane.removeView(child);
237 PagedViewWidget.setDeletePreviewsWhenDetachedFromWindow(true);
238 mAnimationBuffer.setAlpha(1f);
239 mAnimationBuffer.setVisibility(View.VISIBLE);
240 LayoutParams p = new FrameLayout.LayoutParams(child.getWidth(),
241 child.getHeight());
242 p.setMargins((int) child.getLeft(), (int) child.getTop(), 0, 0);
243 mAnimationBuffer.addView(child, p);
244 }
Adam Cohen0cd3b642011-10-14 14:58:00 -0700245
246 // Toggle the new content
247 onTabChangedStart();
248 onTabChangedEnd(type);
249
250 // Animate the transition
251 ObjectAnimator outAnim = ObjectAnimator.ofFloat(mAnimationBuffer, "alpha", 0f);
252 outAnim.addListener(new AnimatorListenerAdapter() {
253 @Override
254 public void onAnimationEnd(Animator animation) {
255 mAnimationBuffer.setVisibility(View.GONE);
Michael Jurka141dbd02011-11-03 13:50:45 -0700256 mAnimationBuffer.removeAllViews();
257 }
258 @Override
259 public void onAnimationCancel(Animator animation) {
260 mAnimationBuffer.setVisibility(View.GONE);
261 mAnimationBuffer.removeAllViews();
Adam Cohen0cd3b642011-10-14 14:58:00 -0700262 }
263 });
264 ObjectAnimator inAnim = ObjectAnimator.ofFloat(mAppsCustomizePane, "alpha", 1f);
265 inAnim.addListener(new AnimatorListenerAdapter() {
266 @Override
267 public void onAnimationEnd(Animator animation) {
Winson Chung097e6c72011-10-20 13:58:30 -0700268 reloadCurrentPage();
Adam Cohen0cd3b642011-10-14 14:58:00 -0700269 }
270 });
271 AnimatorSet animSet = new AnimatorSet();
272 animSet.playTogether(outAnim, inAnim);
273 animSet.setDuration(duration);
274 animSet.start();
275 }
276 });
277 }
278
279 public void setCurrentTabFromContent(AppsCustomizePagedView.ContentType type) {
280 mSuppressContentCallback = true;
281 setCurrentTabByTag(getTabTagForContentType(type));
Winson Chung785d2eb2011-04-14 16:08:02 -0700282 }
283
284 /**
285 * Returns the content type for the specified tab tag.
286 */
287 public AppsCustomizePagedView.ContentType getContentTypeForTabTag(String tag) {
288 if (tag.equals(APPS_TAB_TAG)) {
289 return AppsCustomizePagedView.ContentType.Applications;
290 } else if (tag.equals(WIDGETS_TAB_TAG)) {
291 return AppsCustomizePagedView.ContentType.Widgets;
292 }
293 return AppsCustomizePagedView.ContentType.Applications;
294 }
295
296 /**
Winson Chungfc79c802011-05-02 13:35:34 -0700297 * Returns the tab tag for a given content type.
298 */
299 public String getTabTagForContentType(AppsCustomizePagedView.ContentType type) {
300 if (type == AppsCustomizePagedView.ContentType.Applications) {
301 return APPS_TAB_TAG;
302 } else if (type == AppsCustomizePagedView.ContentType.Widgets) {
303 return WIDGETS_TAB_TAG;
304 }
305 return APPS_TAB_TAG;
306 }
307
308 /**
Winson Chung785d2eb2011-04-14 16:08:02 -0700309 * Disable focus on anything under this view in the hierarchy if we are not visible.
310 */
311 @Override
312 public int getDescendantFocusability() {
313 if (getVisibility() != View.VISIBLE) {
314 return ViewGroup.FOCUS_BLOCK_DESCENDANTS;
315 }
316 return super.getDescendantFocusability();
317 }
318
Winson Chungc100e8e2011-08-09 16:02:43 -0700319 void reset() {
320 if (mInTransition) {
321 // Defer to after the transition to reset
322 mResetAfterTransition = true;
323 } else {
324 // Reset immediately
325 mAppsCustomizePane.reset();
326 }
327 }
328
Michael Jurka1899a362011-11-03 13:50:45 -0700329 private void enableAndBuildHardwareLayer() {
Michael Jurka19e0fc52011-07-22 18:00:21 -0700330 // isHardwareAccelerated() checks if we're attached to a window and if that
331 // window is HW accelerated-- we were sometimes not attached to a window
332 // and buildLayer was throwing an IllegalStateException
Michael Jurka1899a362011-11-03 13:50:45 -0700333 if (isHardwareAccelerated()) {
Winson Chungf0ea4d32011-06-06 14:27:16 -0700334 // Turn on hardware layers for performance
335 setLayerType(LAYER_TYPE_HARDWARE, null);
336
Michael Jurka1899a362011-11-03 13:50:45 -0700337 // force building the layer, so you don't get a blip early in an animation
338 // when the layer is created layer
Winson Chungf0ea4d32011-06-06 14:27:16 -0700339 buildLayer();
340 }
Michael Jurka1899a362011-11-03 13:50:45 -0700341 }
342
Michael Jurka2a4b1a82011-12-07 14:00:02 -0800343 @Override
344 public View getContent() {
345 return mContent;
Michael Jurka1899a362011-11-03 13:50:45 -0700346 }
347
348 /* LauncherTransitionable overrides */
349 @Override
Michael Jurka2a4b1a82011-12-07 14:00:02 -0800350 public void onLauncherTransitionStart(Launcher l, Animator animation, boolean toWorkspace) {
Michael Jurka1899a362011-11-03 13:50:45 -0700351 mInTransition = true;
Michael Jurka3d845e82011-11-15 17:04:31 -0800352 boolean animated = (animation != null);
Michael Jurka1899a362011-11-03 13:50:45 -0700353
Michael Jurka3d845e82011-11-15 17:04:31 -0800354 mContent.setVisibility(VISIBLE);
355
Michael Jurkae326f182011-11-21 14:05:46 -0800356 if (!toWorkspace) {
357 // Make sure the current page is loaded (we start loading the side pages after the
358 // transition to prevent slowing down the animation)
359 mAppsCustomizePane.loadAssociatedPages(mAppsCustomizePane.getCurrentPage(), true);
360 }
Michael Jurka2a4b1a82011-12-07 14:00:02 -0800361 if (animated) {
Michael Jurka3d845e82011-11-15 17:04:31 -0800362 enableAndBuildHardwareLayer();
Michael Jurka1899a362011-11-03 13:50:45 -0700363 }
364
Michael Jurka430e8a52011-08-08 15:52:14 -0700365 if (!toWorkspace && !LauncherApplication.isScreenLarge()) {
366 mAppsCustomizePane.showScrollingIndicator(false);
367 }
Winson Chungc100e8e2011-08-09 16:02:43 -0700368 if (mResetAfterTransition) {
369 mAppsCustomizePane.reset();
370 mResetAfterTransition = false;
371 }
Winson Chung785d2eb2011-04-14 16:08:02 -0700372 }
Winson Chungf0ea4d32011-06-06 14:27:16 -0700373
Winson Chung785d2eb2011-04-14 16:08:02 -0700374 @Override
Winson Chung7d7541e2011-09-16 20:14:36 -0700375 public void onLauncherTransitionEnd(Launcher l, Animator animation, boolean toWorkspace) {
Winson Chungc100e8e2011-08-09 16:02:43 -0700376 mInTransition = false;
Winson Chungf0ea4d32011-06-06 14:27:16 -0700377 if (animation != null) {
378 setLayerType(LAYER_TYPE_NONE, null);
379 }
Winson Chung3ac74c52011-06-30 17:39:37 -0700380
Winson Chung7d7541e2011-09-16 20:14:36 -0700381 if (!toWorkspace) {
Winson Chung3f4e1422011-11-17 14:58:51 -0800382 // Dismiss the workspace cling and show the all apps cling (if not already shown)
Winson Chung7d7541e2011-09-16 20:14:36 -0700383 l.dismissWorkspaceCling(null);
Winson Chung3f4e1422011-11-17 14:58:51 -0800384 mAppsCustomizePane.showAllAppsCling();
Michael Jurkae326f182011-11-21 14:05:46 -0800385 // Make sure adjacent pages are loaded (we wait until after the transition to
386 // prevent slowing down the animation)
387 mAppsCustomizePane.loadAssociatedPages(mAppsCustomizePane.getCurrentPage());
Winson Chung7d7541e2011-09-16 20:14:36 -0700388
389 if (!LauncherApplication.isScreenLarge()) {
390 mAppsCustomizePane.hideScrollingIndicator(false);
391 }
Winson Chung5a808352011-06-27 19:08:49 -0700392 }
Winson Chung785d2eb2011-04-14 16:08:02 -0700393 }
Winson Chung70d72102011-08-12 11:24:35 -0700394
Michael Jurka2a4b1a82011-12-07 14:00:02 -0800395 public void onWindowVisible() {
Michael Jurkae326f182011-11-21 14:05:46 -0800396 if (getVisibility() == VISIBLE) {
397 mContent.setVisibility(VISIBLE);
398 // We unload the widget previews when the UI is hidden, so need to reload pages
399 // Load the current page synchronously, and the neighboring pages asynchronously
400 mAppsCustomizePane.loadAssociatedPages(mAppsCustomizePane.getCurrentPage(), true);
401 mAppsCustomizePane.loadAssociatedPages(mAppsCustomizePane.getCurrentPage());
402 }
403 }
404
405 public void onTrimMemory() {
406 mContent.setVisibility(GONE);
407 // Clear the widget pages of all their subviews - this will trigger the widget previews
408 // to delete their bitmaps
409 mAppsCustomizePane.clearAllWidgetPages();
410 }
411
Winson Chung70d72102011-08-12 11:24:35 -0700412 boolean isTransitioning() {
413 return mInTransition;
414 }
Winson Chung785d2eb2011-04-14 16:08:02 -0700415}