summaryrefslogtreecommitdiffstats
path: root/core/java/android/print/PrintAttributes.java
diff options
context:
space:
mode:
authorSvet Ganov <svetoslavganov@google.com>2014-06-14 22:29:00 -0700
committerSvetoslav Ganov <svetoslavganov@google.com>2014-07-09 18:43:38 +0000
commit525a66b2bb5abf844aff2109bdc9ed819566bece (patch)
treef1823f5ce8a6d26f538094bc6f99f23724e64d2f /core/java/android/print/PrintAttributes.java
parentd8da5c8ff5535fffce0c11d017d64efbda05def6 (diff)
downloadframeworks_base-525a66b2bb5abf844aff2109bdc9ed819566bece.zip
frameworks_base-525a66b2bb5abf844aff2109bdc9ed819566bece.tar.gz
frameworks_base-525a66b2bb5abf844aff2109bdc9ed819566bece.tar.bz2
Adding print preview.
This change adds the pring preview part of the new print UX. The UI has two parts, the top section is the print options and the bottom section print preview with a list of pages. The user can interact only with one of them. When print options are expanded they cover the preview content and a scrim is laid out on top of the preview. Tapping the scrim collapses the print options. When the user types in page ranges and closes the options to look at the preview, the latter is updated to show only these pages. In the list of pages the user can further prune pages by deselecting them. Change-Id: I0b23d2c598afe2a34400ccfa43e4e935af83c72f
Diffstat (limited to 'core/java/android/print/PrintAttributes.java')
-rw-r--r--core/java/android/print/PrintAttributes.java34
1 files changed, 18 insertions, 16 deletions
diff --git a/core/java/android/print/PrintAttributes.java b/core/java/android/print/PrintAttributes.java
index 2810d55..30f0c6a 100644
--- a/core/java/android/print/PrintAttributes.java
+++ b/core/java/android/print/PrintAttributes.java
@@ -105,6 +105,13 @@ public final class PrintAttributes implements Parcelable {
/**
* Gets the minimal margins. If the content does not fit
* these margins it will be clipped.
+ * <p>
+ * <strong>These margins are physically imposed by the printer and they
+ * are <em>not</em> rotated, i.e. they are the same for both portrait and
+ * landscape. For example, a printer may not be able to print in a stripe
+ * on both left and right sides of the page.
+ * </strong>
+ * </p>
*
* @return The margins or <code>null</code> if not set.
*/
@@ -115,6 +122,13 @@ public final class PrintAttributes implements Parcelable {
/**
* Sets the minimal margins. If the content does not fit
* these margins it will be clipped.
+ * <p>
+ * <strong>These margins are physically imposed by the printer and they
+ * are <em>not</em> rotated, i.e. they are the same for both portrait and
+ * landscape. For example, a printer may not be able to print in a stripe
+ * on both left and right sides of the page.
+ * </strong>
+ * </p>
*
* @param The margins.
*
@@ -193,14 +207,8 @@ public final class PrintAttributes implements Parcelable {
oldResolution.getHorizontalDpi());
attributes.setResolution(newResolution);
- // Rotate the physical margins.
- Margins oldMinMargins = getMinMargins();
- Margins newMinMargins = new Margins(
- oldMinMargins.getBottomMils(),
- oldMinMargins.getLeftMils(),
- oldMinMargins.getTopMils(),
- oldMinMargins.getRightMils());
- attributes.setMinMargins(newMinMargins);
+ // Do not rotate the physical margins.
+ attributes.setMinMargins(getMinMargins());
attributes.setColorMode(getColorMode());
@@ -236,14 +244,8 @@ public final class PrintAttributes implements Parcelable {
oldResolution.getHorizontalDpi());
attributes.setResolution(newResolution);
- // Rotate the physical margins.
- Margins oldMinMargins = getMinMargins();
- Margins newMargins = new Margins(
- oldMinMargins.getTopMils(),
- oldMinMargins.getRightMils(),
- oldMinMargins.getBottomMils(),
- oldMinMargins.getLeftMils());
- attributes.setMinMargins(newMargins);
+ // Do not rotate the physical margins.
+ attributes.setMinMargins(getMinMargins());
attributes.setColorMode(getColorMode());