Enable live wallpaper in Launcher2

This commit is contained in:
Romain Guy committed 2009-08-10 15:10:15 -07:00
1 parent 0bed662a2e
commit b1b69f53a8
6 files changed
+10 -250

No files matched your search

-12
View File
@@ -20,15 +20,11 @@ import android.content.Context;
import android.content.Intent;
import android.content.ComponentName;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
@@ -57,7 +53,6 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
private static final int SNAP_VELOCITY = 1000;
private int mDefaultScreen;
private View mWallpaper;
private boolean mFirstLayout = true;
@@ -153,10 +148,6 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
mTween = new SymmetricalLinearTween(true, 250/*ms*/, this);
}
void setWallpaper(View wallpaper) {
mWallpaper = wallpaper;
}
@Override
public void addView(View child, int index, LayoutParams params) {
if (!(child instanceof CellLayout)) {
@@ -464,7 +455,6 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
if (mScroller.computeScrollOffset()) {
mScrollX = mScroller.getCurrX();
mScrollY = mScroller.getCurrY();
mWallpaper.scrollTo(mScrollX, mScrollY);
postInvalidate();
} else if (mNextScreen != INVALID_SCREEN) {
mCurrentScreen = Math.max(0, Math.min(mNextScreen, getChildCount() - 1));
@@ -779,14 +769,12 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
if (deltaX < 0) {
if (mScrollX > 0) {
scrollBy(Math.max(-mScrollX, deltaX), 0);
mWallpaper.scrollTo(mScrollX, mScrollY);
}
} else if (deltaX > 0) {
final int availableToScroll = getChildAt(getChildCount() - 1).getRight() -
mScrollX - getWidth();
if (availableToScroll > 0) {
scrollBy(Math.min(availableToScroll, deltaX), 0);
mWallpaper.scrollTo(mScrollX, mScrollY);
}
}
}