diff options
author | Adam Cohen <adamcohen@google.com> | 2012-05-02 14:26:51 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-05-02 14:26:51 -0700 |
commit | 31f231e7d612947e6b5f93501b60901e9abf619a (patch) | |
tree | 1656e35ea9cce8ff0596bbe48949eda4e38f5e37 | |
parent | f3b8f7afa14542a5d786d6b44a22eb3334c87022 (diff) | |
parent | 850d2e718560cb12ae73292e9d39f21a93d3c2c1 (diff) | |
download | packages_apps_trebuchet-31f231e7d612947e6b5f93501b60901e9abf619a.zip packages_apps_trebuchet-31f231e7d612947e6b5f93501b60901e9abf619a.tar.gz packages_apps_trebuchet-31f231e7d612947e6b5f93501b60901e9abf619a.tar.bz2 |
Merge "Support split status bar in launcher" into jb-dev
-rw-r--r-- | res/values-sw600dp/dimens.xml | 19 | ||||
-rw-r--r-- | res/values-sw720dp/dimens.xml | 1 | ||||
-rw-r--r-- | src/com/android/launcher2/CellLayout.java | 22 | ||||
-rw-r--r-- | src/com/android/launcher2/FolderIcon.java | 12 | ||||
-rw-r--r-- | src/com/android/launcher2/Hotseat.java | 2 |
5 files changed, 29 insertions, 27 deletions
diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml index 0797632..1b86670 100644 --- a/res/values-sw600dp/dimens.xml +++ b/res/values-sw600dp/dimens.xml @@ -16,26 +16,25 @@ <resources> <dimen name="app_icon_size">72dp</dimen> - <integer name="app_icon_hotseat_scale_percent">78</integer> + <integer name="app_icon_hotseat_scale_percent">75</integer> <dimen name="app_icon_drawable_padding">3dp</dimen> <dimen name="app_icon_padding_top">4dp</dimen> <!-- Hotseat --> <dimen name="hotseat_width_gap">-1dp</dimen> <dimen name="hotseat_height_gap">-1dp</dimen> - <dimen name="button_bar_height">94dip</dimen> - <dimen name="button_bar_height_bottom_padding">9dp</dimen> - <dimen name="button_bar_height_top_padding">9dp</dimen> - <dimen name="button_bar_width_left_padding">9dp</dimen> - <dimen name="button_bar_width_right_padding">9dp</dimen> - <dimen name="button_bar_height_plus_padding">94dp</dimen> + <dimen name="button_bar_height">82dip</dimen> + <dimen name="button_bar_height_bottom_padding">0dp</dimen> + <dimen name="button_bar_height_top_padding">0dp</dimen> + <dimen name="button_bar_width_left_padding">33dp</dimen> + <dimen name="button_bar_width_right_padding">33dp</dimen> + <dimen name="button_bar_height_plus_padding">82dp</dimen> <!-- Folders --> <!-- The size of the image which sits behind the preview of the folder contents --> - <dimen name="folder_preview_size">75dp</dimen> + <dimen name="folder_preview_size">72dp</dimen> <dimen name="folder_cell_width">96dp</dimen> <dimen name="folder_cell_height">96dp</dimen> - <dimen name="folder_icon_padding_top">0dp</dimen> <!-- AppsCustomize --> <dimen name="apps_customize_cell_width">96dp</dimen> @@ -55,6 +54,6 @@ <dimen name="workspace_width_gap_land">32dp</dimen> <dimen name="workspace_width_gap_port">0dp</dimen> <dimen name="workspace_height_gap_land">0dp</dimen> - <dimen name="workspace_height_gap_port">32dp</dimen> + <dimen name="workspace_height_gap_port">28dp</dimen> </resources> diff --git a/res/values-sw720dp/dimens.xml b/res/values-sw720dp/dimens.xml index 37f62b8..04937cd 100644 --- a/res/values-sw720dp/dimens.xml +++ b/res/values-sw720dp/dimens.xml @@ -27,6 +27,7 @@ <dimen name="folder_cell_width">96dp</dimen> <dimen name="folder_cell_height">96dp</dimen> + <dimen name="folder_preview_size">75dp</dimen> <!-- AppsCustomize --> <integer name="apps_customize_maxCellCountX">-1</integer> diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java index 1223d1c..6f4759d 100644 --- a/src/com/android/launcher2/CellLayout.java +++ b/src/com/android/launcher2/CellLayout.java @@ -447,6 +447,8 @@ public class CellLayout extends ViewGroup { } } + int previewOffset = FolderRingAnimator.sPreviewSize; + // The folder outer / inner ring image(s) for (int i = 0; i < mFolderOuterRings.size(); i++) { FolderRingAnimator fra = mFolderOuterRings.get(i); @@ -458,7 +460,7 @@ public class CellLayout extends ViewGroup { cellToPoint(fra.mCellX, fra.mCellY, mTempLocation); int centerX = mTempLocation[0] + mCellWidth / 2; - int centerY = mTempLocation[1] + FolderRingAnimator.sPreviewSize / 2; + int centerY = mTempLocation[1] + previewOffset / 2; canvas.save(); canvas.translate(centerX - width / 2, centerY - height / 2); @@ -473,7 +475,7 @@ public class CellLayout extends ViewGroup { cellToPoint(fra.mCellX, fra.mCellY, mTempLocation); centerX = mTempLocation[0] + mCellWidth / 2; - centerY = mTempLocation[1] + FolderRingAnimator.sPreviewSize / 2; + centerY = mTempLocation[1] + previewOffset / 2; canvas.save(); canvas.translate(centerX - width / 2, centerY - width / 2); d.setBounds(0, 0, width, height); @@ -488,7 +490,7 @@ public class CellLayout extends ViewGroup { cellToPoint(mFolderLeaveBehindCell[0], mFolderLeaveBehindCell[1], mTempLocation); int centerX = mTempLocation[0] + mCellWidth / 2; - int centerY = mTempLocation[1] + FolderRingAnimator.sPreviewSize / 2; + int centerY = mTempLocation[1] + previewOffset / 2; canvas.save(); canvas.translate(centerX - width / 2, centerY - width / 2); @@ -570,12 +572,8 @@ public class CellLayout extends ViewGroup { return mIsHotseat ? mHotseatChildScale : mChildScale; } - public boolean addViewToCellLayout( - View child, int index, int childId, LayoutParams params, boolean markCells) { - return addViewToCellLayout(child, index, childId, params, markCells, false); - } - private void scaleChild(BubbleTextView bubbleChild, float pivot, float scale) { + private void scaleChild(BubbleTextView bubbleChild, float scale) { // If we haven't measured the child yet, do it now // (this happens if we're being dropped from all-apps if (bubbleChild.getLayoutParams() instanceof LayoutParams && @@ -595,7 +593,7 @@ public class CellLayout extends ViewGroup { } public boolean addViewToCellLayout(View child, int index, int childId, LayoutParams params, - boolean markCells, boolean allApps) { + boolean markCells) { final LayoutParams lp = params; // Hotseat icons - scale down and remove text @@ -608,14 +606,14 @@ public class CellLayout extends ViewGroup { // Start the child with 100% scale and visible text resetChild(bubbleChild); - if (mIsHotseat && !allApps && mHotseatChildScale >= 0) { + if (mIsHotseat && mHotseatChildScale >= 0) { // Scale/make transparent for a hotseat - scaleChild(bubbleChild, 0f, mHotseatChildScale); + scaleChild(bubbleChild, mHotseatChildScale); bubbleChild.setTextColor(getResources().getColor(android.R.color.transparent)); } else if (mChildScale >= 0) { // Else possibly still scale it if we need to for smaller icons - scaleChild(bubbleChild, 0f, mChildScale); + scaleChild(bubbleChild, mChildScale); } } diff --git a/src/com/android/launcher2/FolderIcon.java b/src/com/android/launcher2/FolderIcon.java index 4a71329..d643084 100644 --- a/src/com/android/launcher2/FolderIcon.java +++ b/src/com/android/launcher2/FolderIcon.java @@ -198,11 +198,13 @@ public class FolderIcon extends LinearLayout implements FolderListener { } mAcceptAnimator = ValueAnimator.ofFloat(0f, 1f); mAcceptAnimator.setDuration(CONSUMPTION_ANIMATION_DURATION); + + final int previewSize = sPreviewSize; mAcceptAnimator.addUpdateListener(new AnimatorUpdateListener() { public void onAnimationUpdate(ValueAnimator animation) { final float percent = (Float) animation.getAnimatedValue(); - mOuterRingSize = (1 + percent * OUTER_RING_GROWTH_FACTOR) * sPreviewSize; - mInnerRingSize = (1 + percent * INNER_RING_GROWTH_FACTOR) * sPreviewSize; + mOuterRingSize = (1 + percent * OUTER_RING_GROWTH_FACTOR) * previewSize; + mInnerRingSize = (1 + percent * INNER_RING_GROWTH_FACTOR) * previewSize; if (mCellLayout != null) { mCellLayout.invalidate(); } @@ -225,11 +227,13 @@ public class FolderIcon extends LinearLayout implements FolderListener { } mNeutralAnimator = ValueAnimator.ofFloat(0f, 1f); mNeutralAnimator.setDuration(CONSUMPTION_ANIMATION_DURATION); + + final int previewSize = sPreviewSize; mNeutralAnimator.addUpdateListener(new AnimatorUpdateListener() { public void onAnimationUpdate(ValueAnimator animation) { final float percent = (Float) animation.getAnimatedValue(); - mOuterRingSize = (1 + (1 - percent) * OUTER_RING_GROWTH_FACTOR) * sPreviewSize; - mInnerRingSize = (1 + (1 - percent) * INNER_RING_GROWTH_FACTOR) * sPreviewSize; + mOuterRingSize = (1 + (1 - percent) * OUTER_RING_GROWTH_FACTOR) * previewSize; + mInnerRingSize = (1 + (1 - percent) * INNER_RING_GROWTH_FACTOR) * previewSize; if (mCellLayout != null) { mCellLayout.invalidate(); } diff --git a/src/com/android/launcher2/Hotseat.java b/src/com/android/launcher2/Hotseat.java index a6c9fb2..15d606d 100644 --- a/src/com/android/launcher2/Hotseat.java +++ b/src/com/android/launcher2/Hotseat.java @@ -132,6 +132,6 @@ public class Hotseat extends FrameLayout { int y = getCellYFromOrder(mAllAppsButtonRank); CellLayout.LayoutParams lp = new CellLayout.LayoutParams(x,y,1,1); lp.canReorder = false; - mContent.addViewToCellLayout(allAppsButton, -1, 0, lp, true, true); + mContent.addViewToCellLayout(allAppsButton, -1, 0, lp, true); } } |