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

+84 -71
View File
@@ -17,8 +17,9 @@ float g_LastPositionX;
int g_LastTouchDown; int g_LastTouchDown;
float g_DT; float g_DT;
int g_LastTime; int g_LastTime;
int g_Rendering;
int g_PageCount; int g_PageCount;
float g_Zoom;
float g_ZoomTarget;
// Drawing constants, should be parameters ====== // Drawing constants, should be parameters ======
#define VIEW_ANGLE 1.28700222f #define VIEW_ANGLE 1.28700222f
@@ -48,17 +49,8 @@ void init() {
g_PosPage = 0; g_PosPage = 0;
g_LastTouchDown = 0; g_LastTouchDown = 0;
g_LastPositionX = 0; g_LastPositionX = 0;
} g_Zoom = 0;
g_ZoomTarget = 0;
void clampPosition() {
if (g_PosPage < 0) {
g_PosPage = 0;
g_PosVelocity = 0;
}
if (g_PosPage > (g_PageCount - 1)) {
g_PosPage = (g_PageCount - 1);
g_PosVelocity = 0;
}
} }
void move() { void move() {
@@ -66,31 +58,44 @@ void move() {
float dx = -(state->newPositionX - g_LastPositionX); float dx = -(state->newPositionX - g_LastPositionX);
g_PosVelocity = 0; g_PosVelocity = 0;
g_PosPage += dx; g_PosPage += dx;
float pmin = -0.25f;
float pmax = (g_PageCount - 1) + 0.25f;
g_PosPage = clampf(g_PosPage, pmin, pmax);
} }
g_LastTouchDown = state->newTouchDown; g_LastTouchDown = state->newTouchDown;
g_LastPositionX = state->newPositionX; g_LastPositionX = state->newPositionX;
clampPosition();
} }
void fling() { void fling() {
g_LastTouchDown = 0; g_LastTouchDown = 0;
g_PosVelocity = -state->flingVelocityX; g_PosVelocity = -state->flingVelocityX;
float av = fabsf(g_PosVelocity);
float minVel = 3f;
minVel *= 1.f - (fabsf(fracf(g_PosPage + 0.5f) - 0.5f) * 0.45f);
if (av < minVel && av > 0.2f) {
if (g_PosVelocity > 0) {
g_PosVelocity = minVel;
} else {
g_PosVelocity = -minVel;
}
}
if (g_PosPage <= 0) { if (g_PosPage <= 0) {
g_PosVelocity = maxf(0, g_PosVelocity); g_PosVelocity = maxf(0, g_PosVelocity);
} }
if (g_PosPage > (g_PageCount - 1)) { if (g_PosPage > (g_PageCount - 1)) {
g_PosVelocity = minf(0, (g_PageCount - 1) - g_PosPage); g_PosVelocity = minf(0, g_PosVelocity);
} }
//g_Zoom += (maxf(fabsf(g_PosVelocity), 3) - 3) / 2.f;
} }
int g_lastFrameTime = 0;
void print_frame_rate() void setZoomTarget() {
{ g_ZoomTarget = state->zoom;
int now = uptimeMillis(); //debugF("zoom target", g_ZoomTarget);
if (g_lastFrameTime != 0) {
debugI32("frame_rate", 1000/(now-g_lastFrameTime));
}
g_lastFrameTime = now;
} }
int int
@@ -136,7 +141,11 @@ void updatePos() {
//debugF(" accel", accel); //debugF(" accel", accel);
//debugF(" friction", friction); //debugF(" friction", friction);
g_PosVelocity += accel; // If our velocity is low OR acceleration is opposing it, apply it.
if (fabsf(g_PosVelocity) < 0.5f || (g_PosVelocity * accel) < 0) {
g_PosVelocity += accel;
}
if ((friction > fabsf(g_PosVelocity)) && (friction > fabsf(accel))) { if ((friction > fabsf(g_PosVelocity)) && (friction > fabsf(accel))) {
// Special get back to center and overcome friction physics. // Special get back to center and overcome friction physics.
float t = tablePosNorm - 0.5f; float t = tablePosNorm - 0.5f;
@@ -155,14 +164,10 @@ void updatePos() {
// Normal physics // Normal physics
if (g_PosVelocity > 0) { if (g_PosVelocity > 0) {
g_PosVelocity -= friction; g_PosVelocity -= friction;
if (g_PosVelocity < 0) { g_PosVelocity = maxf(g_PosVelocity, 0);
g_PosVelocity = 0;
}
} else { } else {
g_PosVelocity += friction; g_PosVelocity += friction;
if (g_PosVelocity > 0) { g_PosVelocity = minf(g_PosVelocity, 0);
g_PosVelocity = 0;
}
} }
} }
g_PosPage += g_PosVelocity * g_DT; g_PosPage += g_PosVelocity * g_DT;
@@ -187,22 +192,21 @@ far_size(float sizeAt0)
} }
void void
draw_page(int icon, int lastIcon, float centerAngle) draw_page(int icon, int lastIcon, float centerAngle, float scale)
{ {
int row; int row;
int col; int col;
//debugF("center angle", centerAngle); //debugF("center angle", centerAngle);
float scale = 1.0f - state->zoom;
float iconTextureWidth = ICON_WIDTH_PX / (float)ICON_TEXTURE_WIDTH_PX; float iconTextureWidth = ICON_WIDTH_PX / (float)ICON_TEXTURE_WIDTH_PX;
float iconTextureHeight = ICON_HEIGHT_PX / (float)ICON_TEXTURE_HEIGHT_PX; float iconTextureHeight = ICON_HEIGHT_PX / (float)ICON_TEXTURE_HEIGHT_PX;
float iconWidthAngle = VIEW_ANGLE * ICON_WIDTH_PX / SCREEN_WIDTH_PX; float iconWidthAngle = VIEW_ANGLE * ICON_WIDTH_PX / SCREEN_WIDTH_PX;
float columnGutterAngle = iconWidthAngle * 0.70f; float columnGutterAngle = iconWidthAngle * 0.9f;
float farIconSize = FAR_ICON_SIZE; float farIconSize = FAR_ICON_SIZE;
float iconGutterHeight = farIconSize * 1.1f; float iconGutterHeight = farIconSize * 1.3f;
float farIconTextureSize = far_size(2 * ICON_TEXTURE_WIDTH_PX / (float)SCREEN_WIDTH_PX); float farIconTextureSize = far_size(2 * ICON_TEXTURE_WIDTH_PX / (float)SCREEN_WIDTH_PX);
@@ -216,9 +220,8 @@ draw_page(int icon, int lastIcon, float centerAngle)
float angle = centerAngle; float angle = centerAngle;
angle -= (columnGutterAngle + iconWidthAngle) * 1.5f; angle -= (columnGutterAngle + iconWidthAngle) * 1.5f;
float iconTop = (farIconSize + iconGutterHeight) * (2.0f + ICON_TOP_OFFSET) float iconTop = (farIconSize + iconGutterHeight) * (1.85f + ICON_TOP_OFFSET)
- row * (farIconSize + iconGutterHeight); - row * (farIconSize + iconGutterHeight);
iconTop -= 6 * scale; // make the zoom point below center
float iconBottom = iconTop - farIconSize; float iconBottom = iconTop - farIconSize;
float labelTop = iconBottom - (.1 * farLabelHeight); float labelTop = iconBottom - (.1 * farLabelHeight);
@@ -233,14 +236,18 @@ draw_page(int icon, int lastIcon, float centerAngle)
float cosine = cosf(angle); float cosine = cosf(angle);
float centerX = sine * RADIUS; float centerX = sine * RADIUS;
float centerZ = cosine * RADIUS; float centerZ = cosine * RADIUS / scale;
centerZ -= ((RADIUS+2+1)*scale); // 2 is camera loc, 1 put it slightly behind that.
if (scale > 1.f) {
centerX *= scale;
}
float iconLeftX = centerX - (cosine * farIconTextureSize * .5); float iconLeftX = centerX - (cosine * farIconTextureSize * .5);
float iconRightX = centerX + (cosine * farIconTextureSize * .5); float iconRightX = centerX + (cosine * farIconTextureSize * .5);
float iconLeftZ = centerZ + (sine * farIconTextureSize * .5); float iconLeftZ = centerZ + (sine * farIconTextureSize * .5);
float iconRightZ = centerZ - (sine * farIconTextureSize * .5); float iconRightZ = centerZ - (sine * farIconTextureSize * .5);
color(1.0f, 1.0f, 1.0f, 0.99f);
if (state->selectedIconIndex == icon) { if (state->selectedIconIndex == icon) {
bindTexture(NAMED_PF, 0, state->selectedIconTexture); bindTexture(NAMED_PF, 0, state->selectedIconTexture);
drawQuadTexCoords( drawQuadTexCoords(
@@ -258,7 +265,11 @@ draw_page(int icon, int lastIcon, float centerAngle)
} }
// label // label
if (scale <= 0.1f) { if (scale < 1.2f) {
float a = maxf(scale, 1.0f);
a = (1.2f - a) * 5;
color(1.0f, 1.0f, 1.0f, a);
float labelLeftX = centerX - farLabelWidth * 0.5f; float labelLeftX = centerX - farLabelWidth * 0.5f;
float labelRightX = centerX + farLabelWidth * 0.5f; float labelRightX = centerX + farLabelWidth * 0.5f;
@@ -279,19 +290,41 @@ draw_page(int icon, int lastIcon, float centerAngle)
int int
main(int launchID) main(int launchID)
{ {
// Clear to transparent // Compute dt in seconds.
pfClearColor(0.0f, 0.0f, 0.0f, 0.0f);
int newTime = uptimeMillis(); int newTime = uptimeMillis();
g_DT = (newTime - g_LastTime) / 1000.f; g_DT = (newTime - g_LastTime) / 1000.f;
g_LastTime = newTime; g_LastTime = newTime;
//debugF("*** dt ", g_DT);
// If we're not supposed to be showing, don't do anything. debugF("zoom", g_Zoom);
if (!state->visible) { if (g_Zoom != g_ZoomTarget) {
return 0; float dz = (g_ZoomTarget - g_Zoom) * g_DT * 5;
if (dz && (fabsf(dz) < 0.03f)) {
if (dz > 0) {
dz = 0.03f;
} else {
dz = -0.03f;
}
}
if (fabsf(g_Zoom - g_ZoomTarget) < fabsf(dz)) {
g_Zoom = g_ZoomTarget;
} else {
g_Zoom += dz;
}
} }
// Set clear value to dim the background based on the zoom position.
if (g_Zoom < 0.8f) {
pfClearColor(0.0f, 0.0f, 0.0f, g_Zoom);
if (g_Zoom == 0) {
// Nothing else to do if fully zoomed out.
return 1;
}
} else {
pfClearColor(0.0f, 0.0f, 0.0f, 0.80f);
}
// icons & labels // icons & labels
int iconCount = state->iconCount; int iconCount = state->iconCount;
g_PageCount = count_pages(iconCount); g_PageCount = count_pages(iconCount);
@@ -318,27 +351,12 @@ main(int launchID)
int iconsPerPage = COLUMNS_PER_PAGE * ROWS_PER_PAGE; int iconsPerPage = COLUMNS_PER_PAGE * ROWS_PER_PAGE;
int icon = clamp(iconsPerPage * page, 0, lastIcon); int icon = clamp(iconsPerPage * page, 0, lastIcon);
draw_page(icon, lastIcon, -VIEW_ANGLE*currentPagePosition); float scale = (1 / g_Zoom);
draw_page(icon+iconsPerPage, lastIcon, (-VIEW_ANGLE*currentPagePosition)+VIEW_ANGLE);
float pageAngle = VIEW_ANGLE * 1.2f;
draw_page(icon, lastIcon, -pageAngle*currentPagePosition, scale);
draw_page(icon+iconsPerPage, lastIcon, (-pageAngle*currentPagePosition)+pageAngle, scale);
// Draw the border lines for debugging ========================================
/*
bindProgramVertex(NAMED_PVOrtho);
bindProgramFragment(NAMED_PFText);
bindProgramFragmentStore(NAMED_PFSText);
color(1.0f, 1.0f, 0.0f, 0.99f);
int i;
for (i=0; i<ROWS_PER_PAGE+1; i++) {
int y = loadI32(ALLOC_Y_BORDERS, i);
drawRect(0, y, SCREEN_WIDTH_PX, y+1, 0.0f);
}
for (i=0; i<COLUMNS_PER_PAGE+1; i++) {
int x = loadI32(ALLOC_X_BORDERS, i);
drawRect(x, 0, x+1, SCREEN_HEIGHT_PX, 0.0f);
}
*/
// Draw the scroll handle ======================================== // Draw the scroll handle ========================================
/* /*
@@ -350,13 +368,8 @@ main(int launchID)
drawRect(handleLeft, handleTop, handleLeft+handleWidth, handleTop+handleHeight, 0.0f); drawRect(handleLeft, handleTop, handleLeft+handleWidth, handleTop+handleHeight, 0.0f);
*/ */
//print_frame_rate();
// Bug workaround where the last frame is not always displayed // Bug workaround where the last frame is not always displayed
// So we render the last frame twice. // So we keep rendering until the bug is fixed.
int rendering = g_Rendering; return 1;//(g_PosVelocity != 0) || fracf(g_PosPage);
g_Rendering = (g_PosVelocity != 0) || fracf(g_PosPage);
rendering |= g_Rendering;
return rendering;
} }
@@ -66,7 +66,7 @@ public class AllAppsGridView extends GridView implements AdapterView.OnItemClick
app = new ApplicationInfo(app); app = new ApplicationInfo(app);
mDragController.startDrag(view, this, app, DragController.DRAG_ACTION_COPY); mDragController.startDrag(view, this, app, DragController.DRAG_ACTION_COPY);
mLauncher.closeAllApps(true); mLauncher.closeAllApps();
mDraw = false; mDraw = false;
invalidate(); invalidate();
return true; return true;
@@ -84,7 +84,7 @@ public class AllAppsGridView extends GridView implements AdapterView.OnItemClick
} }
public void onDropCompleted(View target, boolean success) { public void onDropCompleted(View target, boolean success) {
mLauncher.closeAllApps(false); mLauncher.closeAllApps();
} }
void setLauncher(Launcher launcher) { void setLauncher(Launcher launcher) {
+11 -1
View File
@@ -131,6 +131,7 @@ public class AllAppsView extends RSSurfaceView
setOnClickListener(this); setOnClickListener(this);
setOnLongClickListener(this); setOnLongClickListener(this);
setOnTop(true); setOnTop(true);
getHolder().setFormat(PixelFormat.TRANSLUCENT);
} }
public AllAppsView(Context context, AttributeSet attrs, int defStyle) { 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, left, top, Defines.ICON_WIDTH_PX, Defines.ICON_HEIGHT_PX,
this, app, DragController.DRAG_ACTION_COPY); this, app, DragController.DRAG_ACTION_COPY);
mLauncher.closeAllApps(true); mLauncher.closeAllApps();
} }
return true; return true;
} }
@@ -289,6 +290,12 @@ public class AllAppsView extends RSSurfaceView
public void onDropCompleted(View target, boolean success) { 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) { public void setScale(float amount) {
cancelLongPress(); cancelLongPress();
mRollo.mState.read(); mRollo.mState.read();
@@ -306,6 +313,7 @@ public class AllAppsView extends RSSurfaceView
mLocks &= ~LOCK_ZOOMING; mLocks &= ~LOCK_ZOOMING;
} }
mRollo.mState.save(); mRollo.mState.save();
mRollo.mInvokeZoom.execute();
} }
public boolean isZooming() { public boolean isZooming() {
@@ -364,6 +372,7 @@ public class AllAppsView extends RSSurfaceView
private Script.Invokable mInvokeMove; private Script.Invokable mInvokeMove;
private Script.Invokable mInvokeFling; private Script.Invokable mInvokeFling;
private Script.Invokable mInvokeZoom;
private Sampler mSampler; private Sampler mSampler;
private Sampler mSamplerText; private Sampler mSamplerText;
@@ -576,6 +585,7 @@ public class AllAppsView extends RSSurfaceView
sb.setType(mState.mType, "state", Defines.ALLOC_STATE); sb.setType(mState.mType, "state", Defines.ALLOC_STATE);
mInvokeMove = sb.addInvokable("move"); mInvokeMove = sb.addInvokable("move");
mInvokeFling = sb.addInvokable("fling"); mInvokeFling = sb.addInvokable("fling");
mInvokeZoom = sb.addInvokable("setZoomTarget");
mScript = sb.create(); mScript = sb.create();
mScript.setClearColor(0.0f, 0.0f, 0.0f, 0.0f); 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 mHomeDown;
private boolean mBackDown; private boolean mBackDown;
private Bundle mSavedInstanceState; private Bundle mSavedInstanceState;
private LauncherModel mModel; private LauncherModel mModel;
@@ -245,7 +245,7 @@ public final class Launcher extends Activity
private void checkForLocaleChange() { private void checkForLocaleChange() {
final LocaleConfiguration localeConfiguration = new LocaleConfiguration(); final LocaleConfiguration localeConfiguration = new LocaleConfiguration();
readConfiguration(this, localeConfiguration); readConfiguration(this, localeConfiguration);
final Configuration configuration = getResources().getConfiguration(); final Configuration configuration = getResources().getConfiguration();
final String previousLocale = localeConfiguration.locale; final String previousLocale = localeConfiguration.locale;
@@ -274,7 +274,7 @@ public final class Launcher extends Activity
public int mcc = -1; public int mcc = -1;
public int mnc = -1; public int mnc = -1;
} }
private static void readConfiguration(Context context, LocaleConfiguration configuration) { private static void readConfiguration(Context context, LocaleConfiguration configuration) {
DataInputStream in = null; DataInputStream in = null;
try { try {
@@ -397,7 +397,7 @@ public final class Launcher extends Activity
mModel.startLoader(this, true); mModel.startLoader(this, true);
mRestoring = false; mRestoring = false;
} }
// If this was a new intent (i.e., the mIsNewIntent flag got set to true by // 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 // onNewIntent), then close the search dialog if needed, because it probably
// came from the user pressing 'home' (rather than, for example, pressing 'back'). // came from the user pressing 'home' (rather than, for example, pressing 'back').
@@ -412,18 +412,18 @@ public final class Launcher extends Activity
searchManagerService.stopSearch(); searchManagerService.stopSearch();
} catch (RemoteException e) { } catch (RemoteException e) {
e(LOG_TAG, "error stopping search", e); e(LOG_TAG, "error stopping search", e);
} }
} }
}); });
} }
mIsNewIntent = false; mIsNewIntent = false;
} }
@Override @Override
protected void onPause() { protected void onPause() {
super.onPause(); super.onPause();
closeAllApps(false); closeAllApps();
} }
@Override @Override
@@ -557,7 +557,7 @@ public final class Launcher extends Activity
dragController.setDragScoller(workspace); dragController.setDragScoller(workspace);
dragController.setDragListener(deleteZone); dragController.setDragListener(deleteZone);
dragController.setScrollView(dragLayer); dragController.setScrollView(dragLayer);
// The order here is bottom to top. // The order here is bottom to top.
dragController.addDropTarget(workspace); dragController.addDropTarget(workspace);
dragController.addDropTarget(deleteZone); dragController.addDropTarget(deleteZone);
@@ -784,7 +784,7 @@ public final class Launcher extends Activity
// Close the menu // Close the menu
if (Intent.ACTION_MAIN.equals(intent.getAction())) { if (Intent.ACTION_MAIN.equals(intent.getAction())) {
getWindow().closeAllPanels(); getWindow().closeAllPanels();
// Set this flag so that onResume knows to close the search dialog if it's open, // 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 // 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. // for example onResume being called when the user pressed the 'back' button.
@@ -811,7 +811,7 @@ public final class Launcher extends Activity
mWorkspace.moveToDefaultScreen(); mWorkspace.moveToDefaultScreen();
} }
closeAllApps(true); closeAllApps();
final View v = getWindow().peekDecorView(); final View v = getWindow().peekDecorView();
if (v != null && v.getWindowToken() != null) { if (v != null && v.getWindowToken() != null) {
@@ -820,7 +820,7 @@ public final class Launcher extends Activity
imm.hideSoftInputFromWindow(v.getWindowToken(), 0); imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
} }
} else { } else {
closeAllApps(false); closeAllApps();
} }
} }
} }
@@ -906,7 +906,7 @@ public final class Launcher extends Activity
public void startSearch(String initialQuery, boolean selectInitialQuery, public void startSearch(String initialQuery, boolean selectInitialQuery,
Bundle appSearchData, boolean globalSearch) { Bundle appSearchData, boolean globalSearch) {
closeAllApps(false); closeAllApps();
// Slide the search widget to the top, if it's on the current screen, // Slide the search widget to the top, if it's on the current screen,
// otherwise show the search dialog immediately. // otherwise show the search dialog immediately.
@@ -1283,7 +1283,7 @@ public final class Launcher extends Activity
if (!event.isCanceled()) { if (!event.isCanceled()) {
mWorkspace.dispatchKeyEvent(event); mWorkspace.dispatchKeyEvent(event);
if (isAllAppsVisible()) { if (isAllAppsVisible()) {
closeAllApps(true); closeAllApps();
} else { } else {
closeFolder(); closeFolder();
} }
@@ -1343,9 +1343,9 @@ public final class Launcher extends Activity
} else if (v == mHandleView) { } else if (v == mHandleView) {
Log.d(TAG, "onClick"); Log.d(TAG, "onClick");
if (isAllAppsVisible()) { if (isAllAppsVisible()) {
closeAllApps(true); closeAllApps();
} else { } else {
showAllApps(true); showAllApps();
} }
} }
} }
@@ -1607,33 +1607,24 @@ public final class Launcher extends Activity
return mAllAppsGrid.isZooming() || mAllAppsGrid.isVisible(); return mAllAppsGrid.isZooming() || mAllAppsGrid.isVisible();
} }
void showAllApps(boolean animated) { void showAllApps() {
if (mMode == MODE_ALL_APPS) { if (mMode == MODE_ALL_APPS) {
return; return;
} }
mSwipeController.setRange(-1, 0); mSwipeController.setRange(-1, 0);
if (animated) { mSwipeController.setImmediate(-1);
mSwipeController.animate(-1);
} else {
mSwipeController.setImmediate(-1);
}
mWorkspace.hide(); mWorkspace.hide();
// TODO: fade these two too // TODO: fade these two too
mDeleteZone.setVisibility(View.GONE); mDeleteZone.setVisibility(View.GONE);
//mHandleView.setVisibility(View.GONE); //mHandleView.setVisibility(View.GONE);
} }
void closeAllApps(boolean animated) { void closeAllApps() {
if (mAllAppsGrid.isVisible()) { if (mAllAppsGrid.isVisible()) {
mSwipeController.setRange(0, 1); mSwipeController.setRange(0, 1);
if (animated) { mSwipeController.setImmediate(1);
mSwipeController.animate(1);
} else {
mSwipeController.setImmediate(1);
}
mWorkspace.getChildAt(mWorkspace.getCurrentScreen()).requestFocus(); mWorkspace.getChildAt(mWorkspace.getCurrentScreen()).requestFocus();
// TODO: fade these two too // TODO: fade these two too
@@ -1850,7 +1841,7 @@ public final class Launcher extends Activity
} else { } else {
mWorkspace.setVisibility(View.VISIBLE); mWorkspace.setVisibility(View.VISIBLE);
} }
mWorkspace.setScale(1-amount); //mWorkspace.setScale(1-amount);
mAllAppsGrid.setScale(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); final boolean allApps = mSavedState.getBoolean(RUNTIME_STATE_ALL_APPS_FOLDER, false);
if (allApps) { if (allApps) {
showAllApps(false); showAllApps();
} }
mSavedState = null; mSavedState = null;
+6 -6
View File
@@ -93,7 +93,7 @@ final class Utilities {
* @param context The application's context. * @param context The application's context.
* *
* @return A thumbnail for the specified icon or the icon itself if the * @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) { static Drawable createIconThumbnail(Drawable icon, Context context) {
synchronized (sCanvas) { // we share the statics :-( synchronized (sCanvas) { // we share the statics :-(
@@ -411,11 +411,11 @@ final class Utilities {
if (lineCount > MAX_LINES) { if (lineCount > MAX_LINES) {
lineCount = MAX_LINES; lineCount = MAX_LINES;
} }
if (!TEXT_BURN && lineCount > 0) { //if (!TEXT_BURN && lineCount > 0) {
RectF bubbleRect = mBubbleRect; //RectF bubbleRect = mBubbleRect;
bubbleRect.bottom = height(lineCount); //bubbleRect.bottom = height(lineCount);
c.drawRoundRect(bubbleRect, mCornerRadius, mCornerRadius, mRectPaint); //c.drawRoundRect(bubbleRect, mCornerRadius, mCornerRadius, mRectPaint);
} //}
for (int i=0; i<lineCount; i++) { for (int i=0; i<lineCount; i++) {
int x = (int)((mBubbleRect.width() - layout.getLineMax(i)) / 2.0f); int x = (int)((mBubbleRect.width() - layout.getLineMax(i)) / 2.0f);
int y = mFirstLineY + (i * mLineHeight); int y = mFirstLineY + (i * mLineHeight);