Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

nothing new, just added source of image viewer from AOSP gallery, thi…

…s can view huge images.
  • Loading branch information...
commit 69196c373e9fe70c718d5e77a8f8d8a949f21725 1 parent bad0b61
@mariotaku authored
View
2  TODOS
@@ -0,0 +1,2 @@
+2012-12-13:
+ * twipple.jp photo support.
View
BIN  files/gallery_2_jellybean_viewer.zip
Binary file not shown
View
2  src/it/sephiroth/android/library/imagezoom/ImageViewTouchBase.java
@@ -22,7 +22,7 @@
*/
public class ImageViewTouchBase extends ImageView implements IDisposable {
- public static final String LOG_TAG = "image";;
+ public static final String LOG_TAG = "image";
protected Easing mEasing = new Cubic();
View
9 src/org/mariotaku/twidere/activity/ImageViewerActivity.java
@@ -309,13 +309,14 @@ protected void onStartLoading() {
private Bitmap decodeFile(final File f) {
if (f == null) return null;
- final float max_texture_size = getMaximumTextureSize();
+ final int max_texture_size = getMaximumTextureSize();
final BitmapFactory.Options o = new BitmapFactory.Options();
o.inJustDecodeBounds = true;
BitmapFactory.decodeFile(f.getPath(), o);
if (o.outHeight <= 0) return null;
final BitmapFactory.Options o1 = new BitmapFactory.Options();
- o1.inSampleSize = (o.outHeight > max_texture_size) ? (int) Math.round(o.outHeight / max_texture_size) : 1;
+ final double size = Math.max(o.outWidth, o.outHeight);
+ o1.inSampleSize = (size > max_texture_size) ? (int) Math.round(size / max_texture_size) + 1: 1;
Bitmap bitmap = null;
while (bitmap == null) {
try {
@@ -365,15 +366,11 @@ public static int getMaximumTextureSize() {
maximumTextureSize = textureSize[0];
}
- Log.i("GLHelper", Integer.toString(textureSize[0]));
}
// Release
egl.eglTerminate(display);
- Log.i("GLHelper", "Maximum GL texture size: " + Integer.toString(maximumTextureSize));
-
return maximumTextureSize;
-
}
private String getURLFilename(final String url) {
View
4 src/org/mariotaku/twidere/view/StatusImagePreviewItemView.java
@@ -27,16 +27,16 @@ public StatusImagePreviewItemView(final Context context, final AttributeSet attr
@Override
protected void onMeasure(final int widthMeasureSpec, final int heightMeasureSpec) {
+ final int width = MeasureSpec.getSize(widthMeasureSpec);
final Drawable d = getDrawable();
if (d != null) {
// ceil not round - avoid thin vertical gaps along the left/right
// edges
- final int width = MeasureSpec.getSize(widthMeasureSpec);
final int height = (int) Math.ceil((float) width * (float) d.getIntrinsicHeight() / d.getIntrinsicWidth());
setMeasuredDimension(width, height);
+ setMaxHeight(width * 3);
} else {
- final int width = MeasureSpec.getSize(widthMeasureSpec);
setMeasuredDimension(width, width);
// super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
Please sign in to comment.
Something went wrong with that request. Please try again.