summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2013-10-06 20:03:32 -0700
committerJohn Hoford <hoford@google.com>2013-10-07 10:52:17 -0700
commit391e4a190d4afcfdf89b8e7892e972cc998cdf41 (patch)
tree50aaa8f9f698c9e3bfe77b3221feb73a59b9dd7b /src/com/android/gallery3d/filtershow
parent47f602c3262652f981a9c98358e5a8bde41656ea (diff)
downloadandroid_packages_apps_Gallery2-391e4a190d4afcfdf89b8e7892e972cc998cdf41.tar.gz
android_packages_apps_Gallery2-391e4a190d4afcfdf89b8e7892e972cc998cdf41.tar.bz2
android_packages_apps_Gallery2-391e4a190d4afcfdf89b8e7892e972cc998cdf41.zip
Switch Gallery2 to use the support lib for printing.
Now we have a class in the support library that uses a correct internal implemetation based on the API level. On older devices the app does not crash and on new devices it can print. Also this class does the heavy lifiting. Gallery2 was not using this class, rather it had its own (obsolete) implemetation that was not taking into account the image aspect ratio to provide a hint to the print system for the orientation to be used. bug:11099831 Change-Id: I4cd260614af4d9d87ec31d205ee2a5ef02ef5417
Diffstat (limited to 'src/com/android/gallery3d/filtershow')
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index c89316dab..ab3007c4c 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -46,6 +46,7 @@ import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;
+import android.support.v4.print.PrintHelper;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.TypedValue;
@@ -117,7 +118,6 @@ import com.android.gallery3d.filtershow.tools.XmpPresets.XMresults;
import com.android.gallery3d.filtershow.ui.ExportDialog;
import com.android.gallery3d.filtershow.ui.FramedTextButton;
import com.android.gallery3d.util.GalleryUtils;
-import com.android.gallery3d.util.PrintJob;
import com.android.photos.data.GalleryBitmapPool;
import java.io.File;
@@ -994,7 +994,7 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
MenuItem redoItem = mMenu.findItem(R.id.redoButton);
MenuItem resetItem = mMenu.findItem(R.id.resetHistoryButton);
MenuItem printItem = mMenu.findItem(R.id.printButton);
- if (!PrintJob.systemSupportsPrint()) {
+ if (!PrintHelper.systemSupportsPrint()) {
printItem.setVisible(false);
}
mMasterImage.getHistory().setMenuItems(undoItem, redoItem, resetItem);
@@ -1068,7 +1068,8 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
public void print() {
Bitmap bitmap = MasterImage.getImage().getHighresImage();
- PrintJob.printBitmap(this, "ImagePrint", bitmap);
+ PrintHelper printer = new PrintHelper(this);
+ printer.printBitmap("ImagePrint", bitmap);
}
public void addNewPreset() {