aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2013-09-14 13:50:13 +0200
committerSamuel Tardieu <sam@rfc1149.net>2013-09-14 13:50:13 +0200
commit594d975d50e0bb27eca2f8754e7f6f99728e68c1 (patch)
treebc364c6def3c780ab1966be5b6cd9b847f0286b4 /main
parent46afb0c59b54b1c1d102ea3e71fa7834e07728e3 (diff)
downloadcgeo-594d975d50e0bb27eca2f8754e7f6f99728e68c1.zip
cgeo-594d975d50e0bb27eca2f8754e7f6f99728e68c1.tar.gz
cgeo-594d975d50e0bb27eca2f8754e7f6f99728e68c1.tar.bz2
refactoring: add more annotations
Diffstat (limited to 'main')
-rw-r--r--main/src/cgeo/geocaching/ImageSelectActivity.java5
-rw-r--r--main/src/cgeo/geocaching/utils/ImageUtils.java8
2 files changed, 11 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/ImageSelectActivity.java b/main/src/cgeo/geocaching/ImageSelectActivity.java
index e24c34a..790741f 100644
--- a/main/src/cgeo/geocaching/ImageSelectActivity.java
+++ b/main/src/cgeo/geocaching/ImageSelectActivity.java
@@ -9,6 +9,8 @@ import cgeo.geocaching.utils.ImageUtils;
import cgeo.geocaching.utils.Log;
import org.apache.commons.lang3.StringUtils;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
import android.content.Intent;
import android.database.Cursor;
@@ -263,7 +265,8 @@ public class ImageSelectActivity extends AbstractActivity {
* @param filePath
* @return the scaled image path, or <tt>null</tt> if the image cannot be decoded
*/
- private String writeScaledImage(final String filePath) {
+ @Nullable
+ private String writeScaledImage(@NonNull final String filePath) {
scaleChoiceIndex = scaleView.getSelectedItemPosition();
final int maxXY = getResources().getIntArray(R.array.log_image_scale_values)[scaleChoiceIndex];
return ImageUtils.readScaleAndWriteImage(filePath, maxXY);
diff --git a/main/src/cgeo/geocaching/utils/ImageUtils.java b/main/src/cgeo/geocaching/utils/ImageUtils.java
index 401ab1a..ea4498b 100644
--- a/main/src/cgeo/geocaching/utils/ImageUtils.java
+++ b/main/src/cgeo/geocaching/utils/ImageUtils.java
@@ -3,6 +3,9 @@ package cgeo.geocaching.utils;
import cgeo.geocaching.CgeoApplication;
import cgeo.geocaching.compatibility.Compatibility;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Point;
@@ -96,7 +99,8 @@ public final class ImageUtils {
* boundings
* @return filename and path, <tt>null</tt> if something fails
*/
- public static String readScaleAndWriteImage(final String filePath, final int maxXY) {
+ @Nullable
+ public static String readScaleAndWriteImage(@NonNull final String filePath, final int maxXY) {
if (maxXY <= 0) {
return filePath;
}
@@ -132,6 +136,7 @@ public final class ImageUtils {
* @return the temporary image file to use, or <tt>null</tt> if the media directory could
* not be created.
* */
+ @Nullable
public static File getOutputImageFile() {
// To be safe, you should check that the SDCard is mounted
// using Environment.getExternalStorageState() before doing this.
@@ -153,6 +158,7 @@ public final class ImageUtils {
return new File(mediaStorageDir.getPath() + File.separator + "IMG_" + timeStamp + ".jpg");
}
+ @Nullable
public static Uri getOutputImageFileUri() {
final File file = getOutputImageFile();
if (file == null) {