diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-02-12 11:19:39 -0800 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2015-02-12 12:25:56 -0800 |
commit | 06a4d3f1afee2d1069796d585838efbc7a1f491e (patch) | |
tree | 529e40787541e41780314b28b817b69a86694ae9 /WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java | |
parent | 14334bda039b0f70980e8782e379c5df059a5d6e (diff) | |
download | android_packages_apps_Trebuchet-06a4d3f1afee2d1069796d585838efbc7a1f491e.tar.gz android_packages_apps_Trebuchet-06a4d3f1afee2d1069796d585838efbc7a1f491e.tar.bz2 android_packages_apps_Trebuchet-06a4d3f1afee2d1069796d585838efbc7a1f491e.zip |
Moving some files and methods around
> Removing android.util package
> Moving static methods and classes out of WallpaperCropActivity
> Removing some unused utility methods
Change-Id: I252a0655ddce195189b6b3f0bf92970e5808c9d7
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 043f6306b..53cc13dbc 100644 --- a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java +++ b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java @@ -70,6 +70,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; @@ -174,7 +177,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 @@ -240,9 +243,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()); @@ -811,7 +814,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); @@ -838,7 +841,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()) { @@ -1023,7 +1026,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) { |