68 Commits

Author SHA1 Message Date
Svetoslav
1c664b6def Add way for the user to forget previously used printers.
We keep track of historical printers but some of them may disappear
forever, say the user changes his printer. In such a case the print
system has no idea that the previous printer will never appear so
this change allows the user to remove historical printers.

In the all printers list the user can now long press on a printer
and if the printer is available he can select it from the context
menu. If the printer was used before regardless if it is active the
user may choose to forget it.

bug:11282742

Change-Id: Idc2dda70920ad045149eea1bcfc75ad1992827e9
2013-11-04 14:25:11 -08:00
Baligh Uddin
f1228e3550 Import translations. DO NOT MERGE
Change-Id: I6275ae5da91b961e11974efd80e6b4947bd44972
Auto-generated-cl: translation import
2013-10-30 08:53:01 -07:00
Svetoslav
b4fda13476 Complete implementation of the advanced print options.
1. Implemented the advanced printer options integration. Now a print service
    may declare an advanced print options activity which may be launched by
    the user if the current printer supports advanced print options. These options
    are visible only to the print service that added them and it is the only party
    that will interpret the options.

2. Fixed a couple of bugs in the saved print jobs parsing. One was that if there
    are more than one page range, a half of the print job properties was not
    properly parsed. The other was that the media size constructor was using
    incorrect argument order, thus creating a media size with wring width.

3. Fixed and edge case where old print jobs and their docs can get stuck in
    the spooler. If the app did not write the requested pages we were not showing
    an error message, rather just finish the activity without canceling the print
    job and this print job is stuck in the spooler. Now we show an error message
    and the user may retry, cancel. If the user cancels the print job is also
    cancelled, thus no leftover in the spooler.

4. Fixed the background color of the print dialog to meet UX spec.

bug:11241800

Change-Id: I352440bc86aec824a805883fc9579d96a06d11e6
2013-10-28 11:44:07 -07:00
Baligh Uddin
d33e5f4d99 Import translations. DO NOT MERGE
Change-Id: I1609ae278c6e7fe7af1d440df91940e0a0b07e45
Auto-generated-cl: translation import
2013-10-21 08:29:27 -07:00
Svetoslav
30d9161b8e Merge "Printer list items have wrong width." into klp-dev 2013-10-18 20:27:06 +00:00
Svetoslav Ganov
ed513d7e4a All printers list has incorrect padding and item height.
1. We were using the layout for the printer drop down from the
   print dialog as the list item in the all printers activity.
   This layout was not high enough. Now we have a separate
   layout for the drop down and for the list. Note that they
   are almost identical but this is better that writing java
   code to lookup the height from the theme and change it
   programatically since the java code is almost half the size
   of the layout and leads to spreading the logic in both the
   layout file and the java code.

2. The padding of the printers list was not correct. Now it
   mimics the bahavior in settings where we change the padding
   based on orientation.

bug:11261157

Change-Id: I8507c4ee86e9196fe1777cf9577f1886ccfbb1ad
2013-10-17 10:33:14 -07:00
Svetoslav
b196106a43 Printer list items have wrong width.
1. There was leftover code in the printers adapter that was
   hard coding the item width with no reason to do so.

2. Changed the icon view visibility to invisible to allow
   the text of all list items including save to PDF and all
   printers to be left aligned.

bug:11225340

Change-Id: I5b51d0d30577699f5cd73c7c58521358653d135b
2013-10-16 16:45:33 -07:00
Baligh Uddin
d232a6f988 Import translations. DO NOT MERGE
Change-Id: I45af8da3d23c08e5f32133336e1805149dbdba64
Auto-generated-cl: translation import
2013-10-16 14:40:31 -07:00
Baligh Uddin
e1b6b6c581 Bring deleted files from the dead.
These files were dropped by the translation
pipelines because they do not contain any
translated elements, but in reality they
are needed.

Bug: 11226380
2013-10-15 22:47:02 +00:00
Svetoslav Ganov
5a736fcd20 Merge "Adding a missing resource file." into klp-dev 2013-10-15 17:17:31 +00:00
Svetoslav Ganov
2d996fb687 Adding a missing resource file.
This is a resource file cotaining the media sizes for the Catalan
locale. Without it the print spooler crashes all the time for that
locale since it cannot construct the PDF printer correctly.

bug:11226380

Change-Id: I7fa9c9bf4ed073e5f4ddf0d0fe9de4998e3467d4
2013-10-15 00:18:13 -07:00
Svetoslav Ganov
2f0ec7af06 Update the print spooler action bar icon.
1. Updated the print spooler icon shown in the action bar
   when searching for printers in the all printers activity.

2. If the current printer's capabilities are not immediately
   available the page count label in the dialog contained the
   argument placeholders.

bug:10983508

Change-Id: Id4f78d6cc31647f043f8e3044ab54f30584d1ebe
2013-10-14 13:49:17 -07:00
Baligh Uddin
d898bb0003 Import translations. DO NOT MERGE
Change-Id: Ic05225f9a7ed59b8534c5637187ced07b660252a
Auto-generated-cl: translation import
2013-10-14 09:16:10 -07:00
Baligh Uddin
3532cb4bba Import translations. DO NOT MERGE
Change-Id: I66efc38992968ef463f4d02f1af101053adfb41e
Auto-generated-cl: translation import
2013-10-11 16:31:18 -07:00
Svetoslav Ganov
f22a767e87 Merge "Added UI for errors during layout and write." into klp-dev 2013-10-11 17:06:12 +00:00
Svetoslav Ganov
caff38821a Added UI for errors during layout and write.
1. If an error happens during layout or write we show an error
   message with the string provided by the application which
   has an OK button to retry or tap outside to cancel.

2. Updated the targed and min SDK version for the PrintSpooler.

bug:11127269

Change-Id: I4301cf3716119b1e33b95347a8451fc1c128343b
2013-10-11 10:04:02 -07:00
Baligh Uddin
d32e9b7ffb Merge "Import translations. DO NOT MERGE" into klp-dev 2013-10-11 15:08:10 +00:00
Svetoslav
466c046f20 Merge "Fixing jank when transition from print dialog to generating one." into klp-dev 2013-10-11 01:39:09 +00:00
Baligh Uddin
454d33ad89 Import translations. DO NOT MERGE
Change-Id: I902ff15c7df70eef8986dc2dcfbac59551f085fa
Auto-generated-cl: translation import
2013-10-10 17:47:20 -07:00
Svetoslav
3aa2e2b3ab Fixing jank when transition from print dialog to generating one.
Initially we show the print dialog and when the user presses print
we show a generating dialog with an indefinite spinner and a cancel
button. The transition between the two UIs which are really different
layouts show in the print activity is animated. In the middle of
the animation from print to generating UI there was a jump of the
content and an undesired window animation kicking in. This is a
side effect of changing the activity to floating so now changing the
container size was causing window resize and hence animation. Fun!

bug:10983508

Change-Id: I7d88e073c55863b945cdb50822401592f32d44c3
2013-10-10 16:52:54 -07:00
Svetoslav Ganov
896a9b1726 Merge "Adding missing resourcs for the defaul PDF printer media sizes." into klp-dev 2013-10-10 23:52:07 +00:00
Svetoslav Ganov
4ba9254824 Adding missing resourcs for the defaul PDF printer media sizes.
Some regions have different media size standards and the fake PDF
printer shows the media sizes for the current locale. Interestingly,
these files were skipped in my previous change while I remember
adding them - maybe did not upload the patch.

bug:11147920

Change-Id: I819ab08fbef08305be89e3acf297328b1a0ded11
2013-10-10 00:52:42 -07:00
Svetoslav Ganov
a18661d592 Coalescing multiple print job notifications.
1. We used to show a single notificaiton for every print job but
   this is against th UX guidelines. Since we have to lead by
   example, this change adds coalescing of multiple notifications.

bug:11155212

2. Print job state callback in the PrintManager now correctly
   invoked on the main thread.

bug:10983508

Change-Id: I906e9e62198fa37cb4d2f71fce07ed475d61e1bd
2013-10-09 23:43:11 -07:00
Svetoslav Ganov
c2242aac0c Merge "Show unavailable printers disabled and grayed out." into klp-dev 2013-10-08 16:34:59 +00:00
Svetoslav Ganov
92f8648ebd Merge "Make the print dialog floating." into klp-dev 2013-10-08 16:32:52 +00:00
Svetoslav Ganov
69b91e0ecb Show unavailable printers disabled and grayed out.
1. If a printer is not available it has to disabled and grayed out.

2. Cancle a print job if the app does not provide the requested pages.

3. Fix current printer selection flicker when the print dialog is
   showing up. Often the current printer is initially set to the user's
   favorite and then it is changed back to the PDF one.

bug:10983508

Change-Id: I8d53eb992cf1c92675ec09f61b2ec272b962fa68
2013-10-08 09:08:19 -07:00
Svetoslav Ganov
b20d63a671 Make the print dialog floating.
The print dialog was full-screen which was not really needed and was
causing the dialog to jump instead of animate up/down when the IME
shows/hides.

bug:11116648

Change-Id: Ifb46fd80a90948270a1fa9c875258b8d0cdfc111
2013-10-07 18:21:59 -07:00
Baligh Uddin
a44c31bda0 Import translations. DO NOT MERGE
Change-Id: I107cb20c67c52a5d2c6d82cb31f5ac41a75cdf4d
Auto-generated-cl: translation import
2013-10-07 09:20:44 -07:00
Svetoslav Ganov
56ddf1ffa5 Polish print dialog accessibility.
bug:10983508

Change-Id: I7391e06b661caac18d04ae279639ff447701f151
2013-10-05 19:56:19 -07:00
Svetoslav Ganov
24c686b8b5 Update all printers activity's empty state and avoid selected printer flicker.
1. Updated the empty state of the all printers activity to show no printers message
   if the user is searching and there are no matches and a searching for printers
   message if the user is not filtering the printers list.

2. Adding the fake PDF printer after the historical printers are loaded to avoid the case
   where we select the PDF printer and immediately after that the most used printer is
   selected resulting in an undesirable UI flicker.

3. Fixed a bug where if the most used printer which is initially considered unavailable
   is reported by the print service as available but the UI is not properly updated
   leaving the user in no way to click on the print button.

bug: 10983508

Change-Id: I60fdb7761332850fd5b9ffc0cb572a6213024dba
2013-10-05 19:18:08 -07:00
Svetoslav Ganov
264c566a7f Update the empty state for the "all printers activity"
The empty state is now showing searching for printers hint if
the user is not searching, otherwise the empty state's hint is
a searching for printers message.

bug:10983508

Change-Id: I3df79c167546998c8055d9ff85efa8b460a15e48
2013-10-05 12:58:22 -07:00
Svetoslav
5ab717f21a Print UI tweaks.
1. The refresh button in a print notification was using
   wrong asset.

2. If the page count is unknown, just not show the page
   count instead unknown.

bug:10983508

Change-Id: I15f1fcbff60fe1f30d37868864da41550bb14487
2013-10-04 17:50:31 -07:00
Svetoslav Ganov
331f9e79ad Merge "Print attributes hint not honored." into klp-dev 2013-10-04 22:08:25 +00:00
Svetoslav Ganov
7be27acac9 Print attributes hint not honored.
1. Initially we have a single printer, the fake PDF printer, and
   wait for printers to be discovered. This printer was handling
   only a couple of media sizes. Hence, if the app provides a
   media size hint and the PDF printer does not support it, we
   were essentially ignoring the suggested media size since it
   was not supported by the selected printer and we fell back to
   the default paper size for that printer. The fake PDF printer
   should support all predefined media sizes.

2. The list of available paper sizes was shown in the order they
   are added ignoring the current locale. It is much better user
   experience if the media sizes used in the current locale are
   shown at the top and all others after that. Also the media
   sizes for the current locale should be alphabetically ordered
   so the user can quickly find the desired one.

3. The orientation was reset on media size or printer change.

bug:10564537

Change-Id: Iaa0d42242730ce69cea3effd4d0f4bc087068804
2013-10-04 11:45:15 -07:00
Baligh Uddin
3eb6b8d626 Import translations. DO NOT MERGE
Change-Id: Id91951dbb1084dd04fd93aa1cd26b6b558ff33ef
Auto-generated-cl: translation import
2013-10-04 11:02:34 -07:00
Svetoslav
5c126892ec Merge "Print UI tweaks as per UX request." into klp-dev 2013-10-04 15:58:10 +00:00
Svetoslav
39e71de6b4 Print UI tweaks as per UX request.
1. Limit the width of the dropdown of the printers list.

2. Add icons the the list in the all pritners activity.

3. Update the empty state view for the all printers activity.

bug:10983508

Change-Id: I19effcf32770fdda278009a060b5170a3f29988e
2013-10-02 19:30:43 -07:00
Baligh Uddin
82b8c8c73c Import translations. DO NOT MERGE
Change-Id: I4aa7e1ed8ccce520518231a116608bc8e013bb4c
Auto-generated-cl: translation import
2013-10-02 11:12:53 -07:00
Svetoslav
976b4e6312 Adding an empty state UI for the printer search activity in the spooler.
The user can select all printers from the print dropdown to get to
a search for printers activity where one can filter out the list
of a available printers. We did not have an empty state UI for the
case when the query yields no printers.

bug:11009053

Change-Id: I6b45517b8a7b319992019a1bf65858319a19a0de
2013-10-01 15:32:57 -07:00
Baligh Uddin
dd4ce7119f Import translations. DO NOT MERGE
Change-Id: Ie40b704529f71e71f5c384450a79923c68354bb9
Auto-generated-cl: translation import
2013-09-30 09:28:55 -07:00
Svetoslav Ganov
c783f6738f Merge "Adding a timeout for waiting to get the selected printer's capabilities." into klp-dev 2013-09-28 00:28:08 +00:00
Svetoslav Ganov
6be4c76441 Adding a timeout for waiting to get the selected printer's capabilities.
A print service may choose to provide only the printer info and then when
it is requested to start tracking the state of the printer, the service
should provide the printer capabilities. If the capabilities are not
received within ten seconds we mark the printer as unavailable and stop
tracking it.

bug:10748639

Change-Id: I9171cb5dc116fd321c23a8e4ab55109448e2fc6a
2013-09-27 09:43:32 -07:00
Svetoslav
c335eb4115 Printers in the list of printers change position.
1. The printers in the printers list of settings change position if
   they are updated. The settings app is using hidden platform APIs
   the this change fixes.

2. Enable ProGuard for the PrintSpooler.

3. Added icons on the list of printers so the user knows which
   print service used the printer. Now the user can know when
   he is using cloud print and maybe incurring data costs vs
   local printer discovered by a vendor plug in.

bug:10955751

Change-Id: I292f48b424cb561218fdb424d0388f4d786d8339
2013-09-26 18:49:10 -07:00
Svetoslav Ganov
5cab967bf2 Merge "Adding hidden APIs for observing the print jobs state." into klp-dev 2013-09-26 19:22:20 +00:00
Svetoslav Ganov
704697b619 Adding hidden APIs for observing the print jobs state.
This is needed for implementing the print job settigns UI.

bug:10935736

Change-Id: I63b42cbf4ce6a259fa1af47fa368b148ca5621c1
2013-09-25 17:57:07 -07:00
Baligh Uddin
df79953527 Import translations. DO NOT MERGE
Change-Id: I4842b7afb76ee393c19a39d0818f3f2066616803
Auto-generated-cl: translation import
2013-09-25 16:33:59 -07:00
Baligh Uddin
46485d6df6 Import translations. DO NOT MERGE
Change-Id: Id5391f651538cc46ad7455dedaa3426e29efc9c9
Auto-generated-cl: translation import
2013-09-25 08:42:54 -07:00
Svetoslav
2a708617df User should not be able to select unavailable printers.
1. If the printer is unavailable we should not allow the user
   to select it. Rather, show it grayed out.

2. Some string changes requeted by translators.

bug:10917222

Change-Id: I370f05f9c8e70e3f077db7eb02cf48e19a59925d
2013-09-24 15:46:17 -07:00
Baligh Uddin
e209e27112 Import translations. DO NOT MERGE
Change-Id: Ia5c6ae14529080f176a14f5b8b2307cc2aa39fed
Auto-generated-cl: translation import
2013-09-23 09:10:23 -07:00
Svetoslav
d8f391b4e0 Offer to enable a print service after it is installed.
The user has to explicitly enable a print service from the settings UI
before using it. Usually, users very rarely if at all interact with print
services, therefore all print service management task are performed from
the print settings. We also have to get user consent warning that the
user's data is about to be given to a third-party app. We now post a
notification allowing the user to go directly to the settings screen to
turn the service on.

bug:10447510

Change-Id: Iea56c0825f0bf38328ad94912f0ea5576e9339b3
2013-09-20 17:40:25 -07:00