Implement dark background, adjust spacing, remove skia scaling for performance during zoom.
diff --git a/src/com/android/launcher2/AllAppsGridView.java b/src/com/android/launcher2/AllAppsGridView.java
index 6606cc9..71cd952 100644
--- a/src/com/android/launcher2/AllAppsGridView.java
+++ b/src/com/android/launcher2/AllAppsGridView.java
@@ -66,7 +66,7 @@
app = new ApplicationInfo(app);
mDragController.startDrag(view, this, app, DragController.DRAG_ACTION_COPY);
- mLauncher.closeAllApps(true);
+ mLauncher.closeAllApps();
mDraw = false;
invalidate();
return true;
@@ -84,7 +84,7 @@
}
public void onDropCompleted(View target, boolean success) {
- mLauncher.closeAllApps(false);
+ mLauncher.closeAllApps();
}
void setLauncher(Launcher launcher) {
diff --git a/src/com/android/launcher2/AllAppsView.java b/src/com/android/launcher2/AllAppsView.java
index 03734c0..9f9018e 100644
--- a/src/com/android/launcher2/AllAppsView.java
+++ b/src/com/android/launcher2/AllAppsView.java
@@ -131,6 +131,7 @@
setOnClickListener(this);
setOnLongClickListener(this);
setOnTop(true);
+ getHolder().setFormat(PixelFormat.TRANSLUCENT);
}
public AllAppsView(Context context, AttributeSet attrs, int defStyle) {
@@ -277,7 +278,7 @@
left, top, Defines.ICON_WIDTH_PX, Defines.ICON_HEIGHT_PX,
this, app, DragController.DRAG_ACTION_COPY);
- mLauncher.closeAllApps(true);
+ mLauncher.closeAllApps();
}
return true;
}
@@ -289,6 +290,12 @@
public void onDropCompleted(View target, boolean success) {
}
+ public void setZoom(float v) {
+ mRollo.mState.zoom = v;
+ mRollo.mState.save();
+ mRollo.mInvokeZoom.execute();
+ }
+
public void setScale(float amount) {
cancelLongPress();
mRollo.mState.read();
@@ -306,6 +313,7 @@
mLocks &= ~LOCK_ZOOMING;
}
mRollo.mState.save();
+ mRollo.mInvokeZoom.execute();
}
public boolean isZooming() {
@@ -364,6 +372,7 @@
private Script.Invokable mInvokeMove;
private Script.Invokable mInvokeFling;
+ private Script.Invokable mInvokeZoom;
private Sampler mSampler;
private Sampler mSamplerText;
@@ -576,6 +585,7 @@
sb.setType(mState.mType, "state", Defines.ALLOC_STATE);
mInvokeMove = sb.addInvokable("move");
mInvokeFling = sb.addInvokable("fling");
+ mInvokeZoom = sb.addInvokable("setZoomTarget");
mScript = sb.create();
mScript.setClearColor(0.0f, 0.0f, 0.0f, 0.0f);
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 3e3ff06..3813afe 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -193,7 +193,7 @@
private boolean mHomeDown;
private boolean mBackDown;
-
+
private Bundle mSavedInstanceState;
private LauncherModel mModel;
@@ -245,7 +245,7 @@
private void checkForLocaleChange() {
final LocaleConfiguration localeConfiguration = new LocaleConfiguration();
readConfiguration(this, localeConfiguration);
-
+
final Configuration configuration = getResources().getConfiguration();
final String previousLocale = localeConfiguration.locale;
@@ -274,7 +274,7 @@
public int mcc = -1;
public int mnc = -1;
}
-
+
private static void readConfiguration(Context context, LocaleConfiguration configuration) {
DataInputStream in = null;
try {
@@ -397,7 +397,7 @@
mModel.startLoader(this, true);
mRestoring = false;
}
-
+
// If this was a new intent (i.e., the mIsNewIntent flag got set to true by
// onNewIntent), then close the search dialog if needed, because it probably
// came from the user pressing 'home' (rather than, for example, pressing 'back').
@@ -412,18 +412,18 @@
searchManagerService.stopSearch();
} catch (RemoteException e) {
e(LOG_TAG, "error stopping search", e);
- }
+ }
}
});
}
-
+
mIsNewIntent = false;
}
@Override
protected void onPause() {
super.onPause();
- closeAllApps(false);
+ closeAllApps();
}
@Override
@@ -557,7 +557,7 @@
dragController.setDragScoller(workspace);
dragController.setDragListener(deleteZone);
dragController.setScrollView(dragLayer);
-
+
// The order here is bottom to top.
dragController.addDropTarget(workspace);
dragController.addDropTarget(deleteZone);
@@ -784,7 +784,7 @@
// Close the menu
if (Intent.ACTION_MAIN.equals(intent.getAction())) {
getWindow().closeAllPanels();
-
+
// Set this flag so that onResume knows to close the search dialog if it's open,
// because this was a new intent (thus a press of 'home' or some such) rather than
// for example onResume being called when the user pressed the 'back' button.
@@ -811,7 +811,7 @@
mWorkspace.moveToDefaultScreen();
}
- closeAllApps(true);
+ closeAllApps();
final View v = getWindow().peekDecorView();
if (v != null && v.getWindowToken() != null) {
@@ -820,7 +820,7 @@
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
}
} else {
- closeAllApps(false);
+ closeAllApps();
}
}
}
@@ -906,7 +906,7 @@
public void startSearch(String initialQuery, boolean selectInitialQuery,
Bundle appSearchData, boolean globalSearch) {
- closeAllApps(false);
+ closeAllApps();
// Slide the search widget to the top, if it's on the current screen,
// otherwise show the search dialog immediately.
@@ -1283,7 +1283,7 @@
if (!event.isCanceled()) {
mWorkspace.dispatchKeyEvent(event);
if (isAllAppsVisible()) {
- closeAllApps(true);
+ closeAllApps();
} else {
closeFolder();
}
@@ -1343,9 +1343,9 @@
} else if (v == mHandleView) {
Log.d(TAG, "onClick");
if (isAllAppsVisible()) {
- closeAllApps(true);
+ closeAllApps();
} else {
- showAllApps(true);
+ showAllApps();
}
}
}
@@ -1607,33 +1607,24 @@
return mAllAppsGrid.isZooming() || mAllAppsGrid.isVisible();
}
- void showAllApps(boolean animated) {
+ void showAllApps() {
if (mMode == MODE_ALL_APPS) {
return;
}
mSwipeController.setRange(-1, 0);
- if (animated) {
- mSwipeController.animate(-1);
- } else {
- mSwipeController.setImmediate(-1);
- }
-
+ mSwipeController.setImmediate(-1);
mWorkspace.hide();
-
+
// TODO: fade these two too
mDeleteZone.setVisibility(View.GONE);
//mHandleView.setVisibility(View.GONE);
}
- void closeAllApps(boolean animated) {
+ void closeAllApps() {
if (mAllAppsGrid.isVisible()) {
mSwipeController.setRange(0, 1);
- if (animated) {
- mSwipeController.animate(1);
- } else {
- mSwipeController.setImmediate(1);
- }
+ mSwipeController.setImmediate(1);
mWorkspace.getChildAt(mWorkspace.getCurrentScreen()).requestFocus();
// TODO: fade these two too
@@ -1850,7 +1841,7 @@
} else {
mWorkspace.setVisibility(View.VISIBLE);
}
- mWorkspace.setScale(1-amount);
+ //mWorkspace.setScale(1-amount);
mAllAppsGrid.setScale(amount);
}
@@ -2001,7 +1992,7 @@
final boolean allApps = mSavedState.getBoolean(RUNTIME_STATE_ALL_APPS_FOLDER, false);
if (allApps) {
- showAllApps(false);
+ showAllApps();
}
mSavedState = null;
diff --git a/src/com/android/launcher2/Utilities.java b/src/com/android/launcher2/Utilities.java
index ec9fb79..dbb5ac6 100644
--- a/src/com/android/launcher2/Utilities.java
+++ b/src/com/android/launcher2/Utilities.java
@@ -93,7 +93,7 @@
* @param context The application's context.
*
* @return A thumbnail for the specified icon or the icon itself if the
- * thumbnail could not be created.
+ * thumbnail could not be created.
*/
static Drawable createIconThumbnail(Drawable icon, Context context) {
synchronized (sCanvas) { // we share the statics :-(
@@ -411,11 +411,11 @@
if (lineCount > MAX_LINES) {
lineCount = MAX_LINES;
}
- if (!TEXT_BURN && lineCount > 0) {
- RectF bubbleRect = mBubbleRect;
- bubbleRect.bottom = height(lineCount);
- c.drawRoundRect(bubbleRect, mCornerRadius, mCornerRadius, mRectPaint);
- }
+ //if (!TEXT_BURN && lineCount > 0) {
+ //RectF bubbleRect = mBubbleRect;
+ //bubbleRect.bottom = height(lineCount);
+ //c.drawRoundRect(bubbleRect, mCornerRadius, mCornerRadius, mRectPaint);
+ //}
for (int i=0; i<lineCount; i++) {
int x = (int)((mBubbleRect.width() - layout.getLineMax(i)) / 2.0f);
int y = mFirstLineY + (i * mLineHeight);