summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/gallery3d/data/ImageCacheService.java2
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java16
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java19
-rw-r--r--src/com/android/gallery3d/util/GalleryUtils.java6
4 files changed, 33 insertions, 10 deletions
diff --git a/src/com/android/gallery3d/data/ImageCacheService.java b/src/com/android/gallery3d/data/ImageCacheService.java
index f10a7b3e6..38e32cbee 100644
--- a/src/com/android/gallery3d/data/ImageCacheService.java
+++ b/src/com/android/gallery3d/data/ImageCacheService.java
@@ -35,7 +35,7 @@ public class ImageCacheService {
private static final String IMAGE_CACHE_FILE = "imgcache";
private static final int IMAGE_CACHE_MAX_ENTRIES = 5000;
private static final int IMAGE_CACHE_MAX_BYTES = 200 * 1024 * 1024;
- private static final int IMAGE_CACHE_VERSION = 5;
+ private static final int IMAGE_CACHE_VERSION = 6;
private BlobCache mCache;
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index 80849b174..f2fb3da9d 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -331,6 +331,22 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
}
@Override
+ public void onPause() {
+ super.onPause();
+ if (mShareActionProvider != null) {
+ mShareActionProvider.setOnShareTargetSelectedListener(null);
+ }
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ if (mShareActionProvider != null) {
+ mShareActionProvider.setOnShareTargetSelectedListener(this);
+ }
+ }
+
+ @Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.undoButton: {
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java
index 1368255a6..311ae6310 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java
@@ -35,6 +35,9 @@ public class ImageFilterGeometry extends ImageFilter {
private static final int BOTH = 3;
private static final int VERTICAL = 2;
private static final int HORIZONTAL = 1;
+ private static final int NINETY = 1;
+ private static final int ONE_EIGHTY = 2;
+ private static final int TWO_SEVENTY = 3;
public ImageFilterGeometry() {
mName = "Geometry";
@@ -54,7 +57,7 @@ public class ImageFilterGeometry extends ImageFilter {
Bitmap dst, int dstWidth, int dstHeight, int flip);
native protected void nativeApplyFilterRotate(Bitmap src, int srcWidth, int srcHeight,
- Bitmap dst, int dstWidth, int dstHeight, float rotate);
+ Bitmap dst, int dstWidth, int dstHeight, int rotate);
native protected void nativeApplyFilterCrop(Bitmap src, int srcWidth, int srcHeight,
Bitmap dst, int dstWidth, int dstHeight, int offsetWidth, int offsetHeight);
@@ -111,15 +114,21 @@ public class ImageFilterGeometry extends ImageFilter {
if (rotate) {
// Fails for non-90 degree rotations
Bitmap modBitmapRotate = null;
- if (((int) (sAngle / 90)) % 2 == 0) {
+ rAngle %= 360;
+ int deg = (int) (rAngle / 90);
+ deg = -deg; // Make CCW positive
+ if (deg < 0)
+ deg += 4;
+ // Now deg is in [1, 3] as required by native rotate
+ if (deg == ONE_EIGHTY) {
modBitmapRotate = Bitmap.createBitmap(bmWidth, bmHeight, mConfig);
nativeApplyFilterRotate(modBitmap, bmWidth, bmHeight, modBitmapRotate,
- bmWidth, bmHeight, mGeometry.getRotation());
+ bmWidth, bmHeight, deg);
modifiedBounds = new Rect(0, 0, bmWidth, bmHeight);
- } else {
+ } else if (deg == TWO_SEVENTY || deg == NINETY) {
modBitmapRotate = Bitmap.createBitmap(bmHeight, bmWidth, mConfig);
nativeApplyFilterRotate(modBitmap, bmWidth, bmHeight, modBitmapRotate,
- bmHeight, bmWidth, mGeometry.getRotation());
+ bmHeight, bmWidth, deg);
modifiedBounds = new Rect(0, 0, bmHeight, bmWidth);
}
modBitmap = modBitmapRotate;
diff --git a/src/com/android/gallery3d/util/GalleryUtils.java b/src/com/android/gallery3d/util/GalleryUtils.java
index 16eb424b5..195552116 100644
--- a/src/com/android/gallery3d/util/GalleryUtils.java
+++ b/src/com/android/gallery3d/util/GalleryUtils.java
@@ -87,12 +87,10 @@ public class GalleryUtils {
}
private static void initializeThumbnailSizes(DisplayMetrics metrics, Resources r) {
- int minRows = Math.min(r.getInteger(R.integer.album_rows_land),
- r.getInteger(R.integer.albumset_rows_land));
int maxDimensionPixels = Math.max(metrics.heightPixels, metrics.widthPixels);
// Never need to completely fill the screen
- maxDimensionPixels = maxDimensionPixels * 3/4;
- MediaItem.setThumbnailSizes(maxDimensionPixels, maxDimensionPixels / minRows);
+ maxDimensionPixels = maxDimensionPixels / 2;
+ MediaItem.setThumbnailSizes(maxDimensionPixels, 200);
BitmapScreenNail.setMaxSide(maxDimensionPixels);
}