diff options
-rw-r--r-- | res/drawable-hdpi/hotseat_scrubber_holo.9.png | bin | 0 -> 184 bytes | |||
-rw-r--r-- | res/drawable-hdpi/hotseat_track_holo.9.png | bin | 0 -> 174 bytes | |||
-rw-r--r-- | res/drawable-hdpi/paged_view_indicator.9.png | bin | 358 -> 0 bytes | |||
-rw-r--r-- | res/drawable-mdpi/hotseat_scrubber_holo.9.png | bin | 0 -> 173 bytes | |||
-rw-r--r-- | res/drawable-mdpi/hotseat_track_holo.9.png | bin | 0 -> 157 bytes | |||
-rw-r--r-- | res/layout-land/launcher.xml | 10 | ||||
-rw-r--r-- | res/layout-port/launcher.xml | 13 | ||||
-rw-r--r-- | res/layout/apps_customize_pane.xml | 9 | ||||
-rw-r--r-- | src/com/android/launcher2/AppsCustomizeTabHost.java | 8 | ||||
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 16 | ||||
-rw-r--r-- | src/com/android/launcher2/PagedView.java | 49 | ||||
-rw-r--r-- | src/com/android/launcher2/Workspace.java | 3 |
12 files changed, 93 insertions, 15 deletions
diff --git a/res/drawable-hdpi/hotseat_scrubber_holo.9.png b/res/drawable-hdpi/hotseat_scrubber_holo.9.png Binary files differnew file mode 100644 index 000000000..78b540d47 --- /dev/null +++ b/res/drawable-hdpi/hotseat_scrubber_holo.9.png diff --git a/res/drawable-hdpi/hotseat_track_holo.9.png b/res/drawable-hdpi/hotseat_track_holo.9.png Binary files differnew file mode 100644 index 000000000..ca495ffac --- /dev/null +++ b/res/drawable-hdpi/hotseat_track_holo.9.png diff --git a/res/drawable-hdpi/paged_view_indicator.9.png b/res/drawable-hdpi/paged_view_indicator.9.png Binary files differdeleted file mode 100644 index 9fd357a88..000000000 --- a/res/drawable-hdpi/paged_view_indicator.9.png +++ /dev/null diff --git a/res/drawable-mdpi/hotseat_scrubber_holo.9.png b/res/drawable-mdpi/hotseat_scrubber_holo.9.png Binary files differnew file mode 100644 index 000000000..8b7e109bd --- /dev/null +++ b/res/drawable-mdpi/hotseat_scrubber_holo.9.png diff --git a/res/drawable-mdpi/hotseat_track_holo.9.png b/res/drawable-mdpi/hotseat_track_holo.9.png Binary files differnew file mode 100644 index 000000000..a542cb7b9 --- /dev/null +++ b/res/drawable-mdpi/hotseat_track_holo.9.png diff --git a/res/layout-land/launcher.xml b/res/layout-land/launcher.xml index 3c5e0df36..d2f52c839 100644 --- a/res/layout-land/launcher.xml +++ b/res/layout-land/launcher.xml @@ -39,6 +39,14 @@ <include android:id="@+id/cell4" layout="@layout/workspace_screen" /> <include android:id="@+id/cell5" layout="@layout/workspace_screen" /> </com.android.launcher2.Workspace> + + <ImageView + android:id="@+id/paged_view_indicator_track" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + android:scaleType="fitXY" + android:src="@drawable/hotseat_track_holo" /> <ImageView android:id="@+id/paged_view_indicator" android:layout_width="wrap_content" @@ -47,7 +55,7 @@ android:visibility="gone" android:alpha="0" android:scaleType="fitXY" - android:src="@drawable/paged_view_indicator" /> + android:src="@drawable/hotseat_scrubber_holo" /> <include layout="@layout/qsb_bar" android:id="@+id/qsb_bar" diff --git a/res/layout-port/launcher.xml b/res/layout-port/launcher.xml index d2b9275ef..acb3b474b 100644 --- a/res/layout-port/launcher.xml +++ b/res/layout-port/launcher.xml @@ -37,16 +37,25 @@ <include android:id="@+id/cell4" layout="@layout/workspace_screen" /> <include android:id="@+id/cell5" layout="@layout/workspace_screen" /> </com.android.launcher2.Workspace> + + <ImageView + android:id="@+id/paged_view_indicator_track" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + android:layout_marginBottom="@dimen/button_bar_height" + android:scaleType="fitXY" + android:src="@drawable/hotseat_track_holo" /> <ImageView android:id="@+id/paged_view_indicator" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom" + android:layout_marginBottom="@dimen/button_bar_height" android:visibility="gone" - android:paddingBottom="@dimen/button_bar_height" android:alpha="0" android:scaleType="fitXY" - android:src="@drawable/paged_view_indicator" /> + android:src="@drawable/hotseat_scrubber_holo" /> <include layout="@layout/qsb_bar" android:id="@+id/qsb_bar" diff --git a/res/layout/apps_customize_pane.xml b/res/layout/apps_customize_pane.xml index b45515328..ecb10ec34 100644 --- a/res/layout/apps_customize_pane.xml +++ b/res/layout/apps_customize_pane.xml @@ -76,6 +76,13 @@ launcher:widgetCountY="@integer/apps_customize_widget_cell_count_y" launcher:maxGap="@dimen/workspace_max_gap" /> <ImageView + android:id="@+id/paged_view_indicator_track" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + android:scaleType="fitXY" + android:src="@drawable/hotseat_track_holo" /> + <ImageView android:id="@+id/paged_view_indicator" android:layout_width="wrap_content" android:layout_height="wrap_content" @@ -83,7 +90,7 @@ android:visibility="gone" android:alpha="0" android:scaleType="fitXY" - android:src="@drawable/paged_view_indicator" /> + android:src="@drawable/hotseat_scrubber_holo" /> </FrameLayout> </LinearLayout> </com.android.launcher2.AppsCustomizeTabHost> diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/android/launcher2/AppsCustomizeTabHost.java index 587a3eb5f..262358600 100644 --- a/src/com/android/launcher2/AppsCustomizeTabHost.java +++ b/src/com/android/launcher2/AppsCustomizeTabHost.java @@ -152,6 +152,12 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona ObjectAnimator anim = ObjectAnimator.ofFloat(mAppsCustomizePane, "alpha", 1f); anim.setDuration(duration); + anim.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(android.animation.Animator animation) { + mAppsCustomizePane.flashScrollingIndicator(); + } + }); anim.start(); } }); @@ -212,5 +218,7 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona if (animation != null) { setLayerType(LAYER_TYPE_NONE, null); } + + mAppsCustomizePane.flashScrollingIndicator(); } } diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 54b7b9c2c..0fb24f6e6 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -2387,6 +2387,10 @@ public final class Launcher extends Activity toView.setTranslationY(0.0f); toView.setVisibility(View.VISIBLE); toView.bringToFront(); + + // Hide the workspace scrollbar + mWorkspace.hideScrollingIndicator(true); + mWorkspace.hideScrollIndicatorTrack(); } @Override public void onAnimationEnd(Animator animation) { @@ -2418,6 +2422,10 @@ public final class Launcher extends Activity if (toView instanceof LauncherTransitionable) { ((LauncherTransitionable) toView).onLauncherTransitionStart(null); ((LauncherTransitionable) toView).onLauncherTransitionEnd(null); + + // Hide the workspace scrollbar + mWorkspace.hideScrollingIndicator(true); + mWorkspace.hideScrollIndicatorTrack(); } } } @@ -2475,6 +2483,10 @@ public final class Launcher extends Activity fromView.setVisibility(View.GONE); if (fromView instanceof LauncherTransitionable) { ((LauncherTransitionable) fromView).onLauncherTransitionEnd(alphaAnim); + + // Show the workspace scrollbar + mWorkspace.showScrollIndicatorTrack(); + mWorkspace.flashScrollingIndicator(); } } }); @@ -2486,6 +2498,10 @@ public final class Launcher extends Activity if (fromView instanceof LauncherTransitionable) { ((LauncherTransitionable) fromView).onLauncherTransitionStart(null); ((LauncherTransitionable) fromView).onLauncherTransitionEnd(null); + + // Show the workspace scrollbar + mWorkspace.showScrollIndicatorTrack(); + mWorkspace.flashScrollingIndicator(); } } } diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java index 9ca2f90ff..a90d32fbf 100644 --- a/src/com/android/launcher2/PagedView.java +++ b/src/com/android/launcher2/PagedView.java @@ -162,10 +162,12 @@ public abstract class PagedView extends ViewGroup { // Scrolling indicator private ImageView mScrollIndicator; + private ImageView mScrollTrack; private boolean mHasScrollIndicator = true; private static final int sScrollIndicatorFadeInDuration = 150; private static final int sScrollIndicatorFastFadeOutDuration = 50; private static final int sScrollIndicatorFadeOutDuration = 650; + private static final int sScrollIndicatorFlashDuration = 650; // If set, will defer loading associated pages until the scrolling settles private boolean mDeferLoadAssociatedPagesUntilScrollCompletes; @@ -1606,8 +1608,6 @@ public abstract class PagedView extends ViewGroup { } if (mContentIsRefreshable) { - hideScrollingIndicator(true); - // Update all the pages syncPages(); @@ -1644,6 +1644,16 @@ public abstract class PagedView extends ViewGroup { return true; } + protected void flashScrollingIndicator() { + showScrollingIndicator(); + postDelayed(new Runnable() { + @Override + public void run() { + hideScrollingIndicator(false); + } + }, sScrollIndicatorFlashDuration); + } + protected void showScrollingIndicator() { if (LauncherApplication.isScreenLarge()) return; if (getChildCount() <= 1) return; @@ -1651,13 +1661,9 @@ public abstract class PagedView extends ViewGroup { getScrollingIndicator(); if (mScrollIndicator != null) { - // Update the width of the indicator to the approx. width of each page in the full bar - mScrollIndicator.getLayoutParams().width = getPageWidthForScrollingIndicator() / getChildCount(); - mScrollIndicator.requestLayout(); - // Fade the indicator in updateScrollingIndicatorPosition(); - mScrollIndicator.animate().alpha(1f).setDuration(sScrollIndicatorFadeInDuration); + mScrollIndicator.animate().alpha(1f).setDuration(sScrollIndicatorFadeInDuration).start(); } } @@ -1671,7 +1677,7 @@ public abstract class PagedView extends ViewGroup { // Fade the indicator out updateScrollingIndicatorPosition(); mScrollIndicator.animate().alpha(0f).setDuration(immediately ? - sScrollIndicatorFastFadeOutDuration : sScrollIndicatorFadeOutDuration); + sScrollIndicatorFastFadeOutDuration : sScrollIndicatorFadeOutDuration).start(); } } @@ -1700,6 +1706,33 @@ public abstract class PagedView extends ViewGroup { int indicatorCenterOffset = indicatorWidth / 2 - mScrollIndicator.getMeasuredWidth() / 2; int indicatorPos = (int) (offset * pageWidth) + pageOffset + indicatorCenterOffset; mScrollIndicator.setTranslationX(indicatorPos); + mScrollIndicator.invalidate(); + } + + private ImageView getScrollingIndicatorTrack() { + if (mScrollTrack == null) { + ViewGroup parent = (ViewGroup) getParent(); + mScrollTrack = (ImageView) (parent.findViewById(R.id.paged_view_indicator_track)); + } + return mScrollTrack; + } + + public void showScrollIndicatorTrack() { + if (!LauncherApplication.isScreenLarge()) { + getScrollingIndicatorTrack(); + if (mScrollTrack != null) { + mScrollTrack.setVisibility(View.VISIBLE); + } + } + } + + public void hideScrollIndicatorTrack() { + if (!LauncherApplication.isScreenLarge()) { + getScrollingIndicatorTrack(); + if (mScrollTrack != null) { + mScrollTrack.setVisibility(View.GONE); + } + } } /* Accessibility */ diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index 5ba9fd7af..2b799ee63 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -1381,9 +1381,6 @@ public class Workspace extends SmoothPagedView // Stop any scrolling, move to the current page right away setCurrentPage((mNextPage != INVALID_PAGE) ? mNextPage : mCurrentPage); - // Hide the scrollbar - hideScrollingIndicator(true); - CellLayout currentPage = (CellLayout) getChildAt(mCurrentPage); if (currentPage == null) { Log.w(TAG, "currentPage is NULL! mCurrentPage " + mCurrentPage |