diff options
-rw-r--r-- | res/drawable-hdpi/workspace_bg.9.png | bin | 344 -> 226 bytes | |||
-rw-r--r-- | res/drawable-land-hdpi/workspace_bg.9.png | bin | 315 -> 222 bytes | |||
-rw-r--r-- | res/drawable-land-mdpi/workspace_bg.9.png | bin | 278 -> 201 bytes | |||
-rw-r--r-- | res/drawable-land-xhdpi/workspace_bg.9.png | bin | 363 -> 235 bytes | |||
-rw-r--r-- | res/drawable-mdpi/workspace_bg.9.png | bin | 309 -> 213 bytes | |||
-rw-r--r-- | res/drawable-xhdpi/workspace_bg.9.png | bin | 411 -> 255 bytes | |||
-rw-r--r-- | res/values-cs/strings.xml | 2 | ||||
-rw-r--r-- | res/values-in/strings.xml | 6 | ||||
-rw-r--r-- | res/values-ms/strings.xml | 6 | ||||
-rw-r--r-- | res/values-sw720dp/dimens.xml | 1 | ||||
-rw-r--r-- | res/values-zh-rCN/strings.xml | 6 | ||||
-rw-r--r-- | src/com/android/launcher2/AppsCustomizePagedView.java | 4 | ||||
-rw-r--r-- | src/com/android/launcher2/CellLayout.java | 31 | ||||
-rw-r--r-- | src/com/android/launcher2/DragLayer.java | 11 | ||||
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 47 |
15 files changed, 85 insertions, 29 deletions
diff --git a/res/drawable-hdpi/workspace_bg.9.png b/res/drawable-hdpi/workspace_bg.9.png Binary files differindex eeed8e720..5bbfa4fff 100644 --- a/res/drawable-hdpi/workspace_bg.9.png +++ b/res/drawable-hdpi/workspace_bg.9.png diff --git a/res/drawable-land-hdpi/workspace_bg.9.png b/res/drawable-land-hdpi/workspace_bg.9.png Binary files differindex 069bb1f5b..1a58144aa 100644 --- a/res/drawable-land-hdpi/workspace_bg.9.png +++ b/res/drawable-land-hdpi/workspace_bg.9.png diff --git a/res/drawable-land-mdpi/workspace_bg.9.png b/res/drawable-land-mdpi/workspace_bg.9.png Binary files differindex 611bd5b67..a12519ebd 100644 --- a/res/drawable-land-mdpi/workspace_bg.9.png +++ b/res/drawable-land-mdpi/workspace_bg.9.png diff --git a/res/drawable-land-xhdpi/workspace_bg.9.png b/res/drawable-land-xhdpi/workspace_bg.9.png Binary files differindex a1f60c645..ce414549a 100644 --- a/res/drawable-land-xhdpi/workspace_bg.9.png +++ b/res/drawable-land-xhdpi/workspace_bg.9.png diff --git a/res/drawable-mdpi/workspace_bg.9.png b/res/drawable-mdpi/workspace_bg.9.png Binary files differindex a30d9922b..2856e0985 100644 --- a/res/drawable-mdpi/workspace_bg.9.png +++ b/res/drawable-mdpi/workspace_bg.9.png diff --git a/res/drawable-xhdpi/workspace_bg.9.png b/res/drawable-xhdpi/workspace_bg.9.png Binary files differindex ceac4f2ee..72269f207 100644 --- a/res/drawable-xhdpi/workspace_bg.9.png +++ b/res/drawable-xhdpi/workspace_bg.9.png diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml index 3daad844e..3ad9f9b30 100644 --- a/res/values-cs/strings.xml +++ b/res/values-cs/strings.xml @@ -20,7 +20,7 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="application_name" msgid="8424725141379931883">"Launcher"</string> - <string name="home" msgid="5921706419368316758">"Domovská stránka"</string> + <string name="home" msgid="5921706419368316758">"Plocha"</string> <string name="uid_name" msgid="3371120195364560632">"Android Core Apps"</string> <string name="folder_name" msgid="8551881338202938211"></string> <string name="chooser_wallpaper" msgid="6063168087625352235">"Vybrat tapetu z"</string> diff --git a/res/values-in/strings.xml b/res/values-in/strings.xml index 4e534ead5..77bca536a 100644 --- a/res/values-in/strings.xml +++ b/res/values-in/strings.xml @@ -87,11 +87,9 @@ <string name="uninstall_system_app_text" msgid="6429814133777046491">"Ini adalah apl sistem dan tidak dapat dicopot pemasangannya."</string> <string name="dream_name" msgid="2847171357608437154">"Rocket Launcher"</string> <string name="folder_hint_text" msgid="8633351560105748141">"Folder Tanpa Nama"</string> - <!-- no translation found for workspace_description_format (2968608205939373034) --> - <skip /> + <string name="workspace_description_format" msgid="2968608205939373034">"Layar utama %1$d"</string> <string name="default_scroll_format" msgid="4057140866420001240">"Laman %1$d dari %2$d"</string> - <!-- no translation found for workspace_scroll_format (1704767047951143301) --> - <skip /> + <string name="workspace_scroll_format" msgid="1704767047951143301">"Layar utama %1$d dari %2$d"</string> <string name="apps_customize_apps_scroll_format" msgid="5494241912377704885">"Laman apl %1$d dari %2$d"</string> <string name="apps_customize_widgets_scroll_format" msgid="5383009742241717437">"Laman widget %1$d dari %2$d"</string> <string name="workspace_cling_title" msgid="738396473989890567">"Anggap rumah sendiri"</string> diff --git a/res/values-ms/strings.xml b/res/values-ms/strings.xml index 42d689254..1c9a0dcc5 100644 --- a/res/values-ms/strings.xml +++ b/res/values-ms/strings.xml @@ -87,11 +87,9 @@ <string name="uninstall_system_app_text" msgid="6429814133777046491">"Ini adalah aplikasi sistem dan tidak boleh dinyahpasang."</string> <string name="dream_name" msgid="2847171357608437154">"Pelancar Roket"</string> <string name="folder_hint_text" msgid="8633351560105748141">"Folder Tanpa Nama"</string> - <!-- no translation found for workspace_description_format (2968608205939373034) --> - <skip /> + <string name="workspace_description_format" msgid="2968608205939373034">"Skrin utama %1$d"</string> <string name="default_scroll_format" msgid="4057140866420001240">"Halaman %1$d dari %2$d"</string> - <!-- no translation found for workspace_scroll_format (1704767047951143301) --> - <skip /> + <string name="workspace_scroll_format" msgid="1704767047951143301">"Skrin utama %1$d dari %2$d"</string> <string name="apps_customize_apps_scroll_format" msgid="5494241912377704885">"Halaman apl %1$d dari %2$d"</string> <string name="apps_customize_widgets_scroll_format" msgid="5383009742241717437">"Halaman widget %1$d dari %2$d"</string> <string name="workspace_cling_title" msgid="738396473989890567">"Buat diri anda seperti di rumah"</string> diff --git a/res/values-sw720dp/dimens.xml b/res/values-sw720dp/dimens.xml index c1b1e3164..48c729d69 100644 --- a/res/values-sw720dp/dimens.xml +++ b/res/values-sw720dp/dimens.xml @@ -15,6 +15,7 @@ --> <resources> + <dimen name="app_icon_size">72dp</dimen> <!-- QSB --> <dimen name="toolbar_button_vertical_padding">12dip</dimen> <dimen name="toolbar_button_horizontal_padding">12dip</dimen> diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index aa24ae8aa..4d7348667 100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -87,11 +87,9 @@ <string name="uninstall_system_app_text" msgid="6429814133777046491">"这是系统应用,无法卸载。"</string> <string name="dream_name" msgid="2847171357608437154">"Rocket Launcher"</string> <string name="folder_hint_text" msgid="8633351560105748141">"未命名文件夹"</string> - <!-- no translation found for workspace_description_format (2968608205939373034) --> - <skip /> + <string name="workspace_description_format" msgid="2968608205939373034">"主屏幕第 %1$d 页"</string> <string name="default_scroll_format" msgid="4057140866420001240">"第 %1$d 页,共 %2$d 页"</string> - <!-- no translation found for workspace_scroll_format (1704767047951143301) --> - <skip /> + <string name="workspace_scroll_format" msgid="1704767047951143301">"主屏幕第 %1$d 页,共 %2$d 页"</string> <string name="apps_customize_apps_scroll_format" msgid="5494241912377704885">"应用:第 %1$d 页,共 %2$d 页"</string> <string name="apps_customize_widgets_scroll_format" msgid="5383009742241717437">"窗口小部件:第 %1$d 页,共 %2$d 页"</string> <string name="workspace_cling_title" msgid="738396473989890567">"随意浏览"</string> diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java index 5bd0ac655..54af0803e 100644 --- a/src/com/android/launcher2/AppsCustomizePagedView.java +++ b/src/com/android/launcher2/AppsCustomizePagedView.java @@ -524,6 +524,10 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen mPressedIcon.lockDrawableState(); } + // NOTE: We want all transitions from launcher to act as if the wallpaper were enabled + // to be consistent. So re-enable the flag here, and we will re-disable it as necessary + // when Launcher resumes and we are still in AllApps. + mLauncher.updateWallpaperVisibility(true); mLauncher.startActivitySafely(v, appInfo.intent, appInfo); } else if (v instanceof PagedViewWidget) { diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java index d4a2c8458..ece187023 100644 --- a/src/com/android/launcher2/CellLayout.java +++ b/src/com/android/launcher2/CellLayout.java @@ -17,6 +17,8 @@ package com.android.launcher2; import android.animation.Animator; +import android.animation.AnimatorSet; +import android.animation.ObjectAnimator; import android.animation.AnimatorListenerAdapter; import android.animation.TimeInterpolator; import android.animation.ValueAnimator; @@ -147,7 +149,7 @@ public class CellLayout extends ViewGroup { static final int LANDSCAPE = 0; static final int PORTRAIT = 1; - private static final float REORDER_HINT_MAGNITUDE = 0.27f; + private static final float REORDER_HINT_MAGNITUDE = 0.10f; private static final int REORDER_ANIMATION_DURATION = 150; private float mReorderHintAnimationMagnitude; @@ -1921,7 +1923,7 @@ public class CellLayout extends ViewGroup { View child; float deltaX; float deltaY; - private static final int DURATION = 140; + private static final int DURATION = 300; private int repeatCount; private boolean cancelOnCycleComplete = false; ValueAnimator va; @@ -1950,6 +1952,8 @@ public class CellLayout extends ViewGroup { deltaY = (int) (Math.sin(angle) * mReorderHintAnimationMagnitude); } } + child.setPivotY(child.getMeasuredHeight() * 0.5f); + child.setPivotX(child.getMeasuredWidth() * 0.5f); this.child = child; } @@ -1965,7 +1969,7 @@ public class CellLayout extends ViewGroup { va = ValueAnimator.ofFloat(0f, 1f); va.setRepeatMode(ValueAnimator.REVERSE); va.setRepeatCount(ValueAnimator.INFINITE); - va.setDuration(DURATION); + va.setDuration((int) (DURATION * (1.0f + Math.random()*.08f))); va.addUpdateListener(new AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { @@ -1974,6 +1978,10 @@ public class CellLayout extends ViewGroup { float y = r * deltaY; child.setTranslationX(x); child.setTranslationY(y); + float sf = 4.0f / child.getWidth(); + float s = 1.0f - r * sf; + child.setScaleX(s); + child.setScaleY(s); } }); va.addListener(new AnimatorListenerAdapter() { @@ -1994,6 +2002,21 @@ public class CellLayout extends ViewGroup { private void completeAnimation() { cancelOnCycleComplete = true; } + private void completeAnimationImmediately() { + va.cancel(); + + AnimatorSet s = new AnimatorSet(); + s.playTogether( + ObjectAnimator.ofFloat(child, "scaleX", 1f), + ObjectAnimator.ofFloat(child, "scaleY", 1f), + ObjectAnimator.ofFloat(child, "translationX", 0f), + ObjectAnimator.ofFloat(child, "translationX", 0f) + ); + s.setDuration(REORDER_ANIMATION_DURATION); + s.setInterpolator(new android.view.animation.DecelerateInterpolator(1.5f)); + s.start(); + } + // Returns the time required to complete the current oscillating animation private int completionTime() { @@ -2007,7 +2030,7 @@ public class CellLayout extends ViewGroup { private void completeAndClearReorderHintAnimations() { for (ReorderHintAnimation a: mShakeAnimators.values()) { - a.completeAnimation(); + a.completeAnimationImmediately(); } mShakeAnimators.clear(); } diff --git a/src/com/android/launcher2/DragLayer.java b/src/com/android/launcher2/DragLayer.java index b31666571..4be1914e0 100644 --- a/src/com/android/launcher2/DragLayer.java +++ b/src/com/android/launcher2/DragLayer.java @@ -462,7 +462,16 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang float scale = getDescendantCoordRelativeToSelf((View) child.getParent(), coord); int toX = coord[0]; int toY = coord[1]; - if (child instanceof FolderIcon) { + if (child instanceof TextView) { + TextView tv = (TextView) child; + + // The child may be scaled (always about the center of the view) so to account for it, + // we have to offset the position by the scaled size. Once we do that, we can center + // the drag view about the scaled child view. + toY += Math.round(scale * tv.getPaddingTop()); + toY -= dragView.getMeasuredHeight() * (1 - scale) / 2; + toX -= (dragView.getMeasuredWidth() - Math.round(scale * child.getMeasuredWidth())) / 2; + } else if (child instanceof FolderIcon) { // Account for holographic blur padding on the drag view toY -= Workspace.DRAG_BITMAP_PADDING / 2; // Center in the x coordinate about the target's drawable diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 6025c701f..74ec6f3b5 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -1204,12 +1204,7 @@ public final class Launcher extends Activity mWorkspace.post(new Runnable() { @Override public void run() { - if (mState == State.APPS_CUSTOMIZE) { - if (mAppsCustomizeTabHost != null && - !mAppsCustomizeTabHost.isTransitioning()) { - updateWallpaperVisibility(false); - } - } + disableWallpaperIfInAllApps(); } }); @@ -1862,7 +1857,7 @@ public final class Launcher extends Activity if (activityName != null) { intent.setPackage(activityName.getPackageName()); } - startActivitySafely(null, intent, "onClickVoiceButton"); + startActivity(null, intent, "onClickVoiceButton"); } catch (ActivityNotFoundException e) { Intent intent = new Intent(RecognizerIntent.ACTION_WEB_SEARCH); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK @@ -1919,7 +1914,7 @@ public final class Launcher extends Activity } } - boolean startActivitySafely(View v, Intent intent, Object tag) { + boolean startActivity(View v, Intent intent, Object tag) { intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); try { @@ -1936,9 +1931,6 @@ public final class Launcher extends Activity startActivity(intent); } return true; - } catch (ActivityNotFoundException e) { - Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT).show(); - Log.e(TAG, "Unable to launch. tag=" + tag + " intent=" + intent, e); } catch (SecurityException e) { Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT).show(); Log.e(TAG, "Launcher does not have the permission to launch " + intent + @@ -1949,6 +1941,17 @@ public final class Launcher extends Activity return false; } + boolean startActivitySafely(View v, Intent intent, Object tag) { + boolean success = false; + try { + success = startActivity(v, intent, tag); + } catch (ActivityNotFoundException e) { + Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT).show(); + Log.e(TAG, "Unable to launch. tag=" + tag + " intent=" + intent, e); + } + return success; + } + void startActivityForResultSafely(Intent intent, int requestCode) { try { startActivityForResult(intent, requestCode); @@ -2183,6 +2186,16 @@ public final class Launcher extends Activity view.setPivotY(view.getHeight() / 2.0f); } + void disableWallpaperIfInAllApps() { + // Only disable it if we are in all apps + if (mState == State.APPS_CUSTOMIZE) { + if (mAppsCustomizeTabHost != null && + !mAppsCustomizeTabHost.isTransitioning()) { + updateWallpaperVisibility(false); + } + } + } + void updateWallpaperVisibility(boolean visible) { int wpflags = visible ? WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER : 0; int curflags = getWindow().getAttributes().flags @@ -2526,6 +2539,18 @@ public final class Launcher extends Activity } } + @Override + public void onWindowFocusChanged(boolean hasFocus) { + if (!hasFocus) { + // When another window occludes launcher (like the notification shade, or recents), + // ensure that we enable the wallpaper flag so that transitions are done correctly. + updateWallpaperVisibility(true); + } else { + // When launcher has focus again, disable the wallpaper if we are in AllApps + disableWallpaperIfInAllApps(); + } + } + void showWorkspace(boolean animated) { showWorkspace(animated, null); } |