AndroidScrollingImageView
AndroidScrollingImageView copied to clipboard
How to scroll perfectly diagonally??
while (offset <= -getBitmap(arrayIndex).getHeight()) { offset += getBitmap(arrayIndex).getHeight(); arrayIndex = (arrayIndex + 1) % scene.length; }
float start = offset;
for (int i = 0; start < clipBounds.height(); i++) {
Bitmap bitmap = getBitmap((arrayIndex + i) % scene.length);
int width = bitmap.getWidth();
int height = bitmap.getHeight();
canvas.drawBitmap(bitmap, getBitmapLeft(width, start), getBitmapTop(height, start), null);
start += width;
}
if (isStarted && speed != 0) {
offset -= abs(speed);
postInvalidateOnAnimation();
}