diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-02-20 01:54:30 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-02-20 01:54:31 +0000 |
commit | f3e4f548fd472cf64e407890373f5ce0e7ac3bbc (patch) | |
tree | 4463c203a8c3bd114ac8ad40fac97c164521de6e /WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java | |
parent | 9026271410ee93ab5516d6c59f28c21f157eee7d (diff) | |
parent | 06a4d3f1afee2d1069796d585838efbc7a1f491e (diff) | |
download | android_packages_apps_Trebuchet-f3e4f548fd472cf64e407890373f5ce0e7ac3bbc.tar.gz android_packages_apps_Trebuchet-f3e4f548fd472cf64e407890373f5ce0e7ac3bbc.tar.bz2 android_packages_apps_Trebuchet-f3e4f548fd472cf64e407890373f5ce0e7ac3bbc.zip |
Merge "Moving some files and methods around" into ub-launcher3-master
Diffstat (limited to 'WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java')
-rw-r--r-- | WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java index 05af94d2b..f6cc6d0fd 100644 --- a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java +++ b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java @@ -69,6 +69,9 @@ import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.Toast; +import com.android.gallery3d.common.BitmapCropTask; +import com.android.gallery3d.common.BitmapUtils; +import com.android.gallery3d.common.Utils; import com.android.photos.BitmapRegionTileSource; import com.android.photos.BitmapRegionTileSource.BitmapSource; @@ -170,7 +173,7 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { @Override public void onSave(final WallpaperPickerActivity a) { boolean finishActivityWhenDone = true; - OnBitmapCroppedHandler h = new OnBitmapCroppedHandler() { + BitmapCropTask.OnBitmapCroppedHandler h = new BitmapCropTask.OnBitmapCroppedHandler() { public void onBitmapCropped(byte[] imageBytes) { Point thumbSize = getDefaultThumbnailSize(a.getResources()); // rotation is set to 0 since imageBytes has already been correctly rotated @@ -236,9 +239,9 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { BitmapRegionTileSource source = new BitmapRegionTileSource(a, bitmapSource); CropView v = a.getCropView(); v.setTileSource(source, null); - Point wallpaperSize = WallpaperCropActivity.getDefaultWallpaperSize( + Point wallpaperSize = BitmapUtils.getDefaultWallpaperSize( a.getResources(), a.getWindowManager()); - RectF crop = WallpaperCropActivity.getMaxCropRect( + RectF crop = Utils.getMaxCropRect( source.getImageWidth(), source.getImageHeight(), wallpaperSize.x, wallpaperSize.y, false); v.setScale(wallpaperSize.x / crop.width()); @@ -807,7 +810,7 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { rotatedBounds[0] = Math.abs(rotatedBounds[0]); rotatedBounds[1] = Math.abs(rotatedBounds[1]); - RectF cropRect = WallpaperCropActivity.getMaxCropRect( + RectF cropRect = Utils.getMaxCropRect( (int) rotatedBounds[0], (int) rotatedBounds[1], width, height, leftAligned); cropTask.setCropBounds(cropRect); @@ -834,7 +837,7 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { new AsyncTask<Void, Bitmap, Bitmap>() { protected Bitmap doInBackground(Void...args) { try { - int rotation = WallpaperCropActivity.getRotationFromExif(context, uri); + int rotation = BitmapUtils.getRotationFromExif(context, uri); return createThumbnail(defaultSize, context, uri, null, null, 0, rotation, false); } catch (SecurityException securityException) { if (isDestroyed()) { @@ -1004,7 +1007,7 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { } else { Resources res = getResources(); Point defaultThumbSize = getDefaultThumbnailSize(res); - int rotation = WallpaperCropActivity.getRotationFromExif(res, resId); + int rotation = BitmapUtils.getRotationFromExif(res, resId); thumb = createThumbnail( defaultThumbSize, this, null, null, sysRes, resId, rotation, false); if (thumb != null) { |