keep history after reset to git reset to 8246a1434c12b607743222c22285b72c9a96497b
diff --git a/Android.mk b/Android.mk
index 3bd20a7..3b1a244 100644
--- a/Android.mk
+++ b/Android.mk
@@ -37,7 +37,7 @@
LOCAL_PACKAGE_NAME := Launcher3
#LOCAL_CERTIFICATE := shared
-LOCAL_OVERRIDES_PACKAGES := Launcher2
+LOCAL_OVERRIDES_PACKAGES := Home
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
diff --git a/res/layout-port/workspace_cling.xml b/res/layout-port/workspace_cling.xml
index 9c000cb..b926ca9 100644
--- a/res/layout-port/workspace_cling.xml
+++ b/res/layout-port/workspace_cling.xml
@@ -62,8 +62,8 @@
android:id="@+id/focused_hotseat_app_bubble"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="bottom|right"
- android:layout_marginRight="25dp"
+ android:layout_gravity="bottom|left"
+ android:layout_marginLeft="25dp"
android:layout_marginBottom="90dp"
android:orientation="vertical"
android:visibility="gone">
@@ -90,8 +90,8 @@
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="right"
- android:layout_marginRight="80dp"
+ android:layout_gravity="left"
+ android:layout_marginLeft="78dp"
android:src="@drawable/cling_arrow_down" />
</LinearLayout>
</FrameLayout>
@@ -101,7 +101,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
- android:layout_marginLeft="20dp"
- android:layout_gravity="bottom|left"
+ android:layout_marginRight="20dp"
+ android:layout_gravity="bottom|right"
android:onClick="dismissWorkspaceCling" />
</com.android.launcher3.Cling>
diff --git a/res/values-sw720dp/styles.xml b/res/values-sw720dp/styles.xml
index 7269e8d..9738a12 100644
--- a/res/values-sw720dp/styles.xml
+++ b/res/values-sw720dp/styles.xml
@@ -53,6 +53,8 @@
<!-- Workspace -->
<style name="Theme" parent="android:Theme.Holo.Wallpaper.NoTitleBar">
<item name="android:windowActionModeOverlay">true</item>
+ <item name="android:windowTranslucentStatus">true</item>
+ <item name="android:windowTranslucentNavigation">true</item>
</style>
<style name="TabIndicator.AppsCustomize">
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 287bb50..8dab943 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -109,9 +109,8 @@
LauncherAppState app = LauncherAppState.getInstance();
DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
- setCompoundDrawablesWithIntrinsicBounds(null,
- new FastBitmapDrawable(b),
- null, null);
+ setCompoundDrawables(null,
+ Utilities.createIconDrawable(b), null, null);
setCompoundDrawablePadding((int) ((grid.folderIconSizePx - grid.iconSizePx) / 2f));
setText(info.title);
setTag(info);
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java
index 5231aac..69d9a3d 100644
--- a/src/com/android/launcher3/Folder.java
+++ b/src/com/android/launcher3/Folder.java
@@ -532,8 +532,8 @@
protected boolean createAndAddShortcut(ShortcutInfo item) {
final BubbleTextView textView =
(BubbleTextView) mInflater.inflate(R.layout.application, this, false);
- textView.setCompoundDrawablesWithIntrinsicBounds(null,
- new FastBitmapDrawable(item.getIcon(mIconCache)), null, null);
+ textView.setCompoundDrawables(null,
+ Utilities.createIconDrawable(item.getIcon(mIconCache)), null, null);
textView.setText(item.title);
textView.setTag(item);
textView.setTextColor(getResources().getColor(R.color.folder_items_text_color));
diff --git a/src/com/android/launcher3/FolderIcon.java b/src/com/android/launcher3/FolderIcon.java
index 7e1e350..cd1ff2c 100644
--- a/src/com/android/launcher3/FolderIcon.java
+++ b/src/com/android/launcher3/FolderIcon.java
@@ -98,6 +98,7 @@
private int mPreviewOffsetY;
private float mMaxPerspectiveShift;
boolean mAnimating = false;
+ private Rect mOldBounds = new Rect();
private PreviewItemDrawingParams mParams = new PreviewItemDrawingParams(0, 0, 0, 0);
private PreviewItemDrawingParams mAnimParams = new PreviewItemDrawingParams(0, 0, 0, 0);
@@ -534,6 +535,7 @@
Drawable d = params.drawable;
if (d != null) {
+ mOldBounds.set(d.getBounds());
d.setBounds(0, 0, mIntrinsicIconSize, mIntrinsicIconSize);
d.setFilterBitmap(true);
d.setColorFilter(Color.argb(params.overlayAlpha, 255, 255, 255),
@@ -541,6 +543,7 @@
d.draw(canvas);
d.clearColorFilter();
d.setFilterBitmap(false);
+ d.setBounds(mOldBounds);
}
canvas.restore();
}
diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java
index 2aab64d..094e188 100644
--- a/src/com/android/launcher3/Hotseat.java
+++ b/src/com/android/launcher3/Hotseat.java
@@ -150,7 +150,7 @@
TextView allAppsButton = (TextView)
inflater.inflate(R.layout.all_apps_button, mContent, false);
Drawable d = context.getResources().getDrawable(R.drawable.all_apps_button_icon);
- d.setBounds(0, 0, Utilities.sIconTextureWidth, Utilities.sIconTextureHeight);
+ Utilities.resizeIconDrawable(d);
allAppsButton.setCompoundDrawables(null, d, null, null);
allAppsButton.setContentDescription(context.getString(R.string.all_apps_button_label));
diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java
index 1797826..543b8ee 100644
--- a/src/com/android/launcher3/IconCache.java
+++ b/src/com/android/launcher3/IconCache.java
@@ -29,6 +29,8 @@
import android.graphics.drawable.Drawable;
import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map.Entry;
/**
* Cache of application icons. Icons can be made from any thread.
@@ -147,6 +149,21 @@
}
/**
+ * Empty out the cache that aren't of the correct grid size
+ */
+ public void flushInvalidIcons(DeviceProfile grid) {
+ synchronized (mCache) {
+ Iterator<Entry<ComponentName, CacheEntry>> it = mCache.entrySet().iterator();
+ while (it.hasNext()) {
+ final CacheEntry e = it.next().getValue();
+ if (e.icon.getWidth() != grid.iconSizePx || e.icon.getHeight() != grid.iconSizePx) {
+ it.remove();
+ }
+ }
+ }
+ }
+
+ /**
* Fill in "application" with the icon and label for "info."
*/
public void getTitleAndIcon(AppInfo application, ResolveInfo info,
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index ee13f29..b0e4968 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -402,6 +402,7 @@
Context.MODE_PRIVATE);
mModel = app.setLauncher(this);
mIconCache = app.getIconCache();
+ mIconCache.flushInvalidIcons(grid);
mDragController = new DragController(this);
mInflater = getLayoutInflater();
diff --git a/src/com/android/launcher3/PagedViewIcon.java b/src/com/android/launcher3/PagedViewIcon.java
index c6d5e49..8bfe42d 100644
--- a/src/com/android/launcher3/PagedViewIcon.java
+++ b/src/com/android/launcher3/PagedViewIcon.java
@@ -69,7 +69,8 @@
PagedViewIcon.PressedCallback cb) {
mIcon = info.iconBitmap;
mPressedCallback = cb;
- setCompoundDrawablesWithIntrinsicBounds(null, new FastBitmapDrawable(mIcon), null, null);
+ setCompoundDrawables(null, Utilities.createIconDrawable(mIcon),
+ null, null);
setText(info.title);
setTag(info);
}
diff --git a/src/com/android/launcher3/SearchDropTargetBar.java b/src/com/android/launcher3/SearchDropTargetBar.java
index e681aa1..435dbda 100644
--- a/src/com/android/launcher3/SearchDropTargetBar.java
+++ b/src/com/android/launcher3/SearchDropTargetBar.java
@@ -138,7 +138,8 @@
* Shows and hides the search bar.
*/
public void showSearchBar(boolean animated) {
- if (!mIsSearchBarHidden) return;
+ boolean needToCancelOngoingAnimation = mQSBSearchBarAnim.isRunning() && !animated;
+ if (!mIsSearchBarHidden && !needToCancelOngoingAnimation) return;
if (animated) {
prepareStartAnimation(mQSBSearchBar);
mQSBSearchBarAnim.reverse();
@@ -153,7 +154,8 @@
mIsSearchBarHidden = false;
}
public void hideSearchBar(boolean animated) {
- if (mIsSearchBarHidden) return;
+ boolean needToCancelOngoingAnimation = mQSBSearchBarAnim.isRunning() && !animated;
+ if (mIsSearchBarHidden && !needToCancelOngoingAnimation) return;
if (animated) {
prepareStartAnimation(mQSBSearchBar);
mQSBSearchBarAnim.start();
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index 2cb9314..21c546d 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -66,6 +66,23 @@
static int sColorIndex = 0;
/**
+ * Returns a FastBitmapDrawable with the icon, accurately sized.
+ */
+ static Drawable createIconDrawable(Bitmap icon) {
+ FastBitmapDrawable d = new FastBitmapDrawable(icon);
+ d.setFilterBitmap(true);
+ resizeIconDrawable(d);
+ return d;
+ }
+
+ /**
+ * Resizes an icon drawable to the correct icon size.
+ */
+ static void resizeIconDrawable(Drawable icon) {
+ icon.setBounds(0, 0, sIconTextureWidth, sIconTextureHeight);
+ }
+
+ /**
* Returns a bitmap suitable for the all apps view. Used to convert pre-ICS
* icon bitmaps that are stored in the database (which were 74x74 pixels at hdpi size)
* to the proper size (48dp)
diff --git a/src/com/android/launcher3/WallpaperCropActivity.java b/src/com/android/launcher3/WallpaperCropActivity.java
index 79cc88e..30ec340 100644
--- a/src/com/android/launcher3/WallpaperCropActivity.java
+++ b/src/com/android/launcher3/WallpaperCropActivity.java
@@ -87,9 +87,15 @@
mCropView = (CropView) findViewById(R.id.cropView);
- Intent cropIntent = this.getIntent();
+ Intent cropIntent = getIntent();
final Uri imageUri = cropIntent.getData();
+ if (imageUri == null) {
+ Log.e(LOGTAG, "No URI passed in intent, exiting WallpaperCropActivity");
+ finish();
+ return;
+ }
+
int rotation = getRotationFromExif(this, imageUri);
mCropView.setTileSource(new BitmapRegionTileSource(this, imageUri, 1024, rotation), null);
mCropView.setTouchEnabled(true);
diff --git a/src/com/android/launcher3/WallpaperPickerActivity.java b/src/com/android/launcher3/WallpaperPickerActivity.java
index 9bf3c77..e71a26b 100644
--- a/src/com/android/launcher3/WallpaperPickerActivity.java
+++ b/src/com/android/launcher3/WallpaperPickerActivity.java
@@ -16,6 +16,7 @@
package com.android.launcher3;
+import android.animation.Animator;
import android.animation.LayoutTransition;
import android.app.ActionBar;
import android.app.Activity;
@@ -54,6 +55,7 @@
import android.view.ViewTreeObserver;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.view.accessibility.AccessibilityEvent;
+import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.widget.BaseAdapter;
import android.widget.FrameLayout;
@@ -215,12 +217,21 @@
if (mAnim != null) {
mAnim.cancel();
}
- if (mWallpaperStrip.getTranslationY() == 0) {
+ if (mWallpaperStrip.getAlpha() == 1f) {
mIgnoreNextTap = true;
}
mAnim = new LauncherViewPropertyAnimator(mWallpaperStrip);
- mAnim.translationY(mWallpaperStrip.getHeight()).alpha(0f)
- .setInterpolator(new DecelerateInterpolator(0.75f));
+ mAnim.alpha(0f)
+ .setDuration(150)
+ .addListener(new Animator.AnimatorListener() {
+ public void onAnimationStart(Animator animator) { }
+ public void onAnimationEnd(Animator animator) {
+ mWallpaperStrip.setVisibility(View.INVISIBLE);
+ }
+ public void onAnimationCancel(Animator animator) { }
+ public void onAnimationRepeat(Animator animator) { }
+ });
+ mAnim.setInterpolator(new AccelerateInterpolator(0.75f));
mAnim.start();
}
@Override
@@ -235,9 +246,11 @@
if (mAnim != null) {
mAnim.cancel();
}
+ mWallpaperStrip.setVisibility(View.VISIBLE);
mAnim = new LauncherViewPropertyAnimator(mWallpaperStrip);
- mAnim.translationY(0f).alpha(1f)
- .setInterpolator(new DecelerateInterpolator(0.75f));
+ mAnim.alpha(1f)
+ .setDuration(150)
+ .setInterpolator(new DecelerateInterpolator(0.75f));
mAnim.start();
}
}
@@ -489,9 +502,9 @@
protected void onStop() {
super.onStop();
mWallpaperStrip = findViewById(R.id.wallpaper_strip);
- if (mWallpaperStrip.getTranslationY() > 0f) {
- mWallpaperStrip.setTranslationY(0f);
+ if (mWallpaperStrip.getAlpha() < 1f) {
mWallpaperStrip.setAlpha(1f);
+ mWallpaperStrip.setVisibility(View.VISIBLE);
}
}
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 1d5b5ac..908a61e 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -1446,6 +1446,12 @@
}
if (Float.compare(progress, mLastCustomContentScrollProgress) == 0) return;
+
+ CellLayout cc = mWorkspaceScreens.get(CUSTOM_CONTENT_SCREEN_ID);
+ if (progress > 0 && cc.getVisibility() != VISIBLE && !isSmall()) {
+ cc.setVisibility(VISIBLE);
+ }
+
mLastCustomContentScrollProgress = progress;
setBackgroundAlpha(progress * 0.8f);
@@ -3046,7 +3052,9 @@
private void cleanupFolderCreation() {
if (mDragFolderRingAnimator != null) {
mDragFolderRingAnimator.animateToNaturalState();
+ mDragFolderRingAnimator = null;
}
+ mFolderCreationAlarm.setOnAlarmListener(null);
mFolderCreationAlarm.cancelAlarm();
}
@@ -3390,9 +3398,11 @@
}
public void onAlarm(Alarm alarm) {
- if (mDragFolderRingAnimator == null) {
- mDragFolderRingAnimator = new FolderRingAnimator(mLauncher, null);
+ if (mDragFolderRingAnimator != null) {
+ // This shouldn't happen ever, but just in case, make sure we clean up the mess.
+ mDragFolderRingAnimator.animateToNaturalState();
}
+ mDragFolderRingAnimator = new FolderRingAnimator(mLauncher, null);
mDragFolderRingAnimator.setCell(cellX, cellY);
mDragFolderRingAnimator.setCellLayout(layout);
mDragFolderRingAnimator.animateToAcceptState();