Implement dark background, adjust spacing, remove skia scaling for performance during zoom.

This commit is contained in:
Jason Sams committed 2009-09-20 17:24:16 -07:00
1 parent 86c87ed0a8
commit fd22dac33e
5 files changed
+125 -111

No files matched your search

@@ -66,7 +66,7 @@ public class AllAppsGridView extends GridView implements AdapterView.OnItemClick
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 class AllAppsGridView extends GridView implements AdapterView.OnItemClick
}
public void onDropCompleted(View target, boolean success) {
mLauncher.closeAllApps(false);
mLauncher.closeAllApps();
}
void setLauncher(Launcher launcher) {
+11 -1
View File
@@ -131,6 +131,7 @@ public class AllAppsView extends RSSurfaceView
setOnClickListener(this);
setOnLongClickListener(this);
setOnTop(true);
getHolder().setFormat(PixelFormat.TRANSLUCENT);
}
public AllAppsView(Context context, AttributeSet attrs, int defStyle) {
@@ -277,7 +278,7 @@ public class AllAppsView extends RSSurfaceView
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 class AllAppsView extends RSSurfaceView
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 @@ public class AllAppsView extends RSSurfaceView
mLocks &= ~LOCK_ZOOMING;
}
mRollo.mState.save();
mRollo.mInvokeZoom.execute();
}
public boolean isZooming() {
@@ -364,6 +372,7 @@ public class AllAppsView extends RSSurfaceView
private Script.Invokable mInvokeMove;
private Script.Invokable mInvokeFling;
private Script.Invokable mInvokeZoom;
private Sampler mSampler;
private Sampler mSamplerText;
@@ -576,6 +585,7 @@ public class AllAppsView extends RSSurfaceView
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);
+22 -31
View File
@@ -193,7 +193,7 @@ public final class Launcher extends Activity
private boolean mHomeDown;
private boolean mBackDown;
private Bundle mSavedInstanceState;
private LauncherModel mModel;
@@ -245,7 +245,7 @@ public final class Launcher extends Activity
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 final class Launcher extends Activity
public int mcc = -1;
public int mnc = -1;
}
private static void readConfiguration(Context context, LocaleConfiguration configuration) {
DataInputStream in = null;
try {
@@ -397,7 +397,7 @@ public final class Launcher extends Activity
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 @@ public final class Launcher extends Activity
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 @@ public final class Launcher extends Activity
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 @@ public final class Launcher extends Activity
// 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 @@ public final class Launcher extends Activity
mWorkspace.moveToDefaultScreen();
}
closeAllApps(true);
closeAllApps();
final View v = getWindow().peekDecorView();
if (v != null && v.getWindowToken() != null) {
@@ -820,7 +820,7 @@ public final class Launcher extends Activity
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
}
} else {
closeAllApps(false);
closeAllApps();
}
}
}
@@ -906,7 +906,7 @@ public final class Launcher extends Activity
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 @@ public final class Launcher extends Activity
if (!event.isCanceled()) {
mWorkspace.dispatchKeyEvent(event);
if (isAllAppsVisible()) {
closeAllApps(true);
closeAllApps();
} else {
closeFolder();
}
@@ -1343,9 +1343,9 @@ public final class Launcher extends Activity
} else if (v == mHandleView) {
Log.d(TAG, "onClick");
if (isAllAppsVisible()) {
closeAllApps(true);
closeAllApps();
} else {
showAllApps(true);
showAllApps();
}
}
}
@@ -1607,33 +1607,24 @@ public final class Launcher extends Activity
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 @@ public final class Launcher extends Activity
} else {
mWorkspace.setVisibility(View.VISIBLE);
}
mWorkspace.setScale(1-amount);
//mWorkspace.setScale(1-amount);
mAllAppsGrid.setScale(amount);
}
@@ -2001,7 +1992,7 @@ public final class Launcher extends Activity
final boolean allApps = mSavedState.getBoolean(RUNTIME_STATE_ALL_APPS_FOLDER, false);
if (allApps) {
showAllApps(false);
showAllApps();
}
mSavedState = null;
+6 -6
View File
@@ -93,7 +93,7 @@ final class Utilities {
* @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 @@ final class Utilities {
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);