Kaydet (Commit) 316afc9b authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

android: allow to set a size of the thumbnail

Change-Id: Ida8bbd74893f59c3737d28c264e7ed24b231e6ac
üst 47314618
......@@ -41,7 +41,7 @@ public class LOKitThread extends Thread {
}
private void refresh() {
Bitmap bitmap = mTileProvider.thumbnail();
Bitmap bitmap = mTileProvider.thumbnail(1000);
if (bitmap != null) {
mApplication.getLayerController().getView().changeCheckerboardBitmap(bitmap, mTileProvider.getPageWidth(), mTileProvider.getPageHeight());
}
......
......@@ -129,17 +129,17 @@ public class LOKitTileProvider implements TileProvider {
}
@Override
public Bitmap thumbnail() {
public Bitmap thumbnail(int size) {
int widthPixel = getPageWidth();
int heightPixel = getPageHeight();
if (widthPixel > heightPixel) {
double ratio = heightPixel / (double) widthPixel;
widthPixel = 1000;
widthPixel = size;
heightPixel = (int) (widthPixel * ratio);
} else {
double ratio = widthPixel / (double) heightPixel;
heightPixel = 1000;
heightPixel = size;
widthPixel = (int) (heightPixel * ratio);
}
......
......@@ -59,7 +59,7 @@ public class MockTileProvider implements TileProvider {
}
@Override
public Bitmap thumbnail() {
public Bitmap thumbnail(int size) {
return layerController.getDrawable("dummy_page");
}
......
......@@ -16,7 +16,7 @@ public interface TileProvider {
void changePart(int partIndex);
Bitmap thumbnail();
Bitmap thumbnail(int size);
void close();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment