Remove STORE_SIZE constant

It bothers me?
This commit is contained in:
Christopher Eby 2011-09-26 19:30:24 -05:00
parent 31651e491e
commit fa24f2aa0f

View File

@ -41,7 +41,6 @@ import android.widget.Scroller;
* generated by CoverBitmap. * generated by CoverBitmap.
*/ */
public final class CoverView extends View implements Handler.Callback { public final class CoverView extends View implements Handler.Callback {
private static final int STORE_SIZE = 3;
private static int SNAP_VELOCITY = -1; private static int SNAP_VELOCITY = -1;
/** /**
@ -65,7 +64,7 @@ public final class CoverView extends View implements Handler.Callback {
private Callback mCallback; private Callback mCallback;
/** /**
* The current set of songs: previous, current, and next. * The current set of songs: 0 = previous, 1 = current, and 2 = next.
*/ */
private Song[] mSongs = new Song[3]; private Song[] mSongs = new Song[3];
/** /**
@ -134,7 +133,7 @@ public final class CoverView extends View implements Handler.Callback {
((Bitmap)bitmaps[i]).recycle(); ((Bitmap)bitmaps[i]).recycle();
bitmaps[i] = null; bitmaps[i] = null;
} }
for (int i = STORE_SIZE; --i != -1; ) for (int i = 3; --i != -1; )
setSong(i, mSongs[i]); setSong(i, mSongs[i]);
} }
@ -166,7 +165,7 @@ public final class CoverView extends View implements Handler.Callback {
canvas.drawColor(Color.BLACK); canvas.drawColor(Color.BLACK);
for (int x = 0, i = 0; i != STORE_SIZE; ++i, x += width) { for (int x = 0, i = 0; i != 3; ++i, x += width) {
if (mSongs[i] != null && scrollX + width > x && scrollX < x + width) { if (mSongs[i] != null && scrollX + width > x && scrollX < x + width) {
long id = mSongs[i].id; long id = mSongs[i].id;
if (id == -1) if (id == -1)
@ -348,8 +347,8 @@ public final class CoverView extends View implements Handler.Callback {
*/ */
public void querySongs(PlaybackService service) public void querySongs(PlaybackService service)
{ {
for (int i = STORE_SIZE; --i != -1; ) for (int i = 3; --i != -1; )
setSong(i, service.getSong(i - STORE_SIZE / 2)); setSong(i, service.getSong(i - 1));
resetScroll(); resetScroll();
invalidate(); invalidate();
} }