summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/app/AbstractGalleryActivity.java
diff options
context:
space:
mode:
authornicolasroard <nicolasroard@google.com>2013-08-19 16:21:12 -0700
committernicolasroard <nicolasroard@google.com>2013-08-19 17:17:36 -0700
commit513eb24fe6b9376ce41bff0abc53d6d14daf8325 (patch)
treed1f86d4bae566f2b33006c3fd388efd5452551f1 /src/com/android/gallery3d/app/AbstractGalleryActivity.java
parentf29cc45abb96754e954d56673e3a959d8bb9787e (diff)
downloadandroid_packages_apps_Gallery2-513eb24fe6b9376ce41bff0abc53d6d14daf8325.tar.gz
android_packages_apps_Gallery2-513eb24fe6b9376ce41bff0abc53d6d14daf8325.tar.bz2
android_packages_apps_Gallery2-513eb24fe6b9376ce41bff0abc53d6d14daf8325.zip
Add printing to Gallery
Change-Id: I26aad645759f95813003badffbd03845e0df37bb
Diffstat (limited to 'src/com/android/gallery3d/app/AbstractGalleryActivity.java')
-rw-r--r--src/com/android/gallery3d/app/AbstractGalleryActivity.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/app/AbstractGalleryActivity.java b/src/com/android/gallery3d/app/AbstractGalleryActivity.java
index c4367c06d..923c5b2e6 100644
--- a/src/com/android/gallery3d/app/AbstractGalleryActivity.java
+++ b/src/com/android/gallery3d/app/AbstractGalleryActivity.java
@@ -29,6 +29,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.content.res.Configuration;
+import android.net.Uri;
import android.os.Bundle;
import android.os.IBinder;
import android.view.Menu;
@@ -40,9 +41,11 @@ import com.android.gallery3d.R;
import com.android.gallery3d.common.ApiHelper;
import com.android.gallery3d.data.DataManager;
import com.android.gallery3d.data.MediaItem;
+import com.android.gallery3d.filtershow.cache.ImageLoader;
import com.android.gallery3d.ui.GLRoot;
import com.android.gallery3d.ui.GLRootView;
import com.android.gallery3d.util.PanoramaViewHelper;
+import com.android.gallery3d.util.PrintJob;
import com.android.gallery3d.util.ThreadPool;
import com.android.photos.data.GalleryBitmapPool;
@@ -342,4 +345,18 @@ public class AbstractGalleryActivity extends Activity implements GalleryContext
throw new RuntimeException("Batch service unavailable");
}
}
+
+ public void printSelectedImage(Uri uri) {
+ if (uri == null) {
+ return;
+ }
+ String path = ImageLoader.getLocalPathFromUri(this, uri);
+ if (path != null) {
+ Uri localUri = Uri.parse(path);
+ path = localUri.getLastPathSegment();
+ } else {
+ path = uri.getLastPathSegment();
+ }
+ PrintJob.printBitmapAtUri(this, path, uri);
+ }
}