am e47f55c3: Improve desktop scrolling from the previews switcher.
Merge commit 'e47f55c30b9c24f01f2be861247c92f17fbe4a61' into eclair-mr2 * commit 'e47f55c30b9c24f01f2be861247c92f17fbe4a61': Improve desktop scrolling from the previews switcher.
This commit is contained in:
@@ -50,7 +50,6 @@ import android.os.Handler;
|
||||
import android.os.Parcelable;
|
||||
import android.os.RemoteException;
|
||||
import android.os.ServiceManager;
|
||||
import android.os.SystemClock;
|
||||
import android.provider.LiveFolders;
|
||||
import android.text.Selection;
|
||||
import android.text.SpannableStringBuilder;
|
||||
@@ -1519,7 +1518,6 @@ public final class Launcher extends Activity
|
||||
for (int i = 0; i < count; i++) {
|
||||
((ImageView) group.getChildAt(i)).setImageDrawable(null);
|
||||
}
|
||||
|
||||
ArrayList<Bitmap> bitmaps = (ArrayList<Bitmap>) v.getTag(R.id.icon);
|
||||
for (Bitmap bitmap : bitmaps) bitmap.recycle();
|
||||
|
||||
@@ -1647,7 +1645,7 @@ public final class Launcher extends Activity
|
||||
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
if (hasFocus) {
|
||||
mWorkspace.snapToScreen((Integer) v.getTag());
|
||||
mWorkspace.snapToScreen((Integer) v.getTag());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,9 +28,7 @@ import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Parcelable;
|
||||
import android.os.Parcel;
|
||||
import android.os.SystemClock;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.VelocityTracker;
|
||||
import android.view.View;
|
||||
@@ -48,6 +46,7 @@ import java.util.ArrayList;
|
||||
* A workspace is meant to be used with a fixed width only.
|
||||
*/
|
||||
public class Workspace extends ViewGroup implements DropTarget, DragSource, DragScroller {
|
||||
@SuppressWarnings({"UnusedDeclaration"})
|
||||
private static final String TAG = "Launcher.Workspace";
|
||||
private static final int INVALID_SCREEN = -1;
|
||||
|
||||
@@ -942,17 +941,19 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag
|
||||
}
|
||||
|
||||
void snapToScreen(int whichScreen) {
|
||||
if (!mScroller.isFinished()) return;
|
||||
//if (!mScroller.isFinished()) return;
|
||||
|
||||
whichScreen = Math.max(0, Math.min(whichScreen, getChildCount() - 1));
|
||||
|
||||
clearVacantCache();
|
||||
enableChildrenCache(mCurrentScreen, whichScreen);
|
||||
|
||||
|
||||
final int screenDelta = Math.abs(whichScreen - mCurrentScreen);
|
||||
|
||||
mNextScreen = whichScreen;
|
||||
|
||||
mPreviousIndicator.setLevel(mNextScreen);
|
||||
mNextIndicator.setLevel(mNextScreen);
|
||||
|
||||
View focusedChild = getFocusedChild();
|
||||
if (focusedChild != null && screenDelta != 0 && focusedChild == getChildAt(mCurrentScreen)) {
|
||||
|
||||
Reference in New Issue
Block a user