diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-05-14 00:07:08 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2015-05-14 12:28:07 -0700 |
commit | 7066003b2032a49ae5e59dab9b706259bdeb7e6e (patch) | |
tree | 3e3720740c905cf22dc1c96e6123c1bb7bec60e5 /WallpaperPicker | |
parent | 5a92b2356f1c5f79207c4e9bd47d7b0b5bcf6f78 (diff) | |
download | android_packages_apps_Trebuchet-7066003b2032a49ae5e59dab9b706259bdeb7e6e.tar.gz android_packages_apps_Trebuchet-7066003b2032a49ae5e59dab9b706259bdeb7e6e.tar.bz2 android_packages_apps_Trebuchet-7066003b2032a49ae5e59dab9b706259bdeb7e6e.zip |
Various lint error fixes.
> Fixing some RTL errors by specifying both marginStart and marginLeft
> Moving all layout direction checks to Utilities
> Explicitely adding @TargetApi before every method
Change-Id: Ibe9c52b93b5a6adeadb27ace2b312770fd732ea0
Diffstat (limited to 'WallpaperPicker')
3 files changed, 12 insertions, 6 deletions
diff --git a/WallpaperPicker/src/com/android/gallery3d/exif/ExifInterface.java b/WallpaperPicker/src/com/android/gallery3d/exif/ExifInterface.java index a1cf0fc85..9247e879f 100644 --- a/WallpaperPicker/src/com/android/gallery3d/exif/ExifInterface.java +++ b/WallpaperPicker/src/com/android/gallery3d/exif/ExifInterface.java @@ -1247,7 +1247,7 @@ public class ExifInterface { if (l == null || l.length <= 0) { return null; } - return new Long(l[0]); + return Long.valueOf(l[0]); } /** @@ -1266,7 +1266,7 @@ public class ExifInterface { if (l == null || l.length <= 0) { return null; } - return new Integer(l[0]); + return Integer.valueOf(l[0]); } /** @@ -1285,7 +1285,7 @@ public class ExifInterface { if (l == null || l.length <= 0) { return null; } - return new Byte(l[0]); + return Byte.valueOf(l[0]); } /** diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java index 142a9cb10..affad0f45 100644 --- a/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java +++ b/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java @@ -190,7 +190,7 @@ public class WallpaperCropActivity extends BaseActivity implements Handler.Callb } }); } catch (SecurityException securityException) { - if (isDestroyed()) { + if (isActivityDestroyed()) { // Temporarily granted permissions are revoked when the activity // finishes, potentially resulting in a SecurityException here. // Even though {@link #isDestroyed} might also return true in different @@ -221,6 +221,12 @@ public class WallpaperCropActivity extends BaseActivity implements Handler.Callb return false; } + @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) + protected boolean isActivityDestroyed() { + return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) + && isDestroyed(); + } + @Thunk void addReusableBitmap(TileSource src) { synchronized (mReusableBitmaps) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java index 93320919e..1ba5b4b2e 100644 --- a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java +++ b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java @@ -665,7 +665,7 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { } @Thunk void initializeScrollForRtl() { - if (mWallpaperScrollContainer.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) { + if (Utilities.isRtl(getResources())) { final ViewTreeObserver observer = mWallpaperScrollContainer.getViewTreeObserver(); observer.addOnGlobalLayoutListener(new OnGlobalLayoutListener() { public void onGlobalLayout() { @@ -838,7 +838,7 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { int rotation = BitmapUtils.getRotationFromExif(context, uri); return createThumbnail(defaultSize, context, uri, null, null, 0, rotation, false); } catch (SecurityException securityException) { - if (isDestroyed()) { + if (isActivityDestroyed()) { // Temporarily granted permissions are revoked when the activity // finishes, potentially resulting in a SecurityException here. // Even though {@link #isDestroyed} might also return true in different |