Use light theme for printSpooler

- replace png's by vector graphics
- Use alredy existing icons if possible
- Remove unnnecessary hard coded color values
- hard code all colors for preview-page as the background colors are
  hard coded, hence foreground also needs to be hard coded.
- Unify layout of loading/error/select printer UI

Test: Looked at print spooler. Switched theme to dark and checked if all
      looks ok too.
Change-Id: I07cc619d575c7372bd18550db8f2582df657cc5c
This commit is contained in:
Philip P. Moltmann
2018-07-06 17:03:05 -07:00
parent d75e31fbce
commit c5b3d15bdd
41 changed files with 161 additions and 187 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -1339,7 +1339,6 @@
<java-symbol type="drawable" name="ic_text_dot" />
<java-symbol type="drawable" name="ic_print" />
<java-symbol type="drawable" name="ic_print_error" />
<java-symbol type="drawable" name="ic_grayedout_printer" />
<java-symbol type="drawable" name="jog_dial_arrow_long_left_green" />
<java-symbol type="drawable" name="jog_dial_arrow_long_right_red" />
<java-symbol type="drawable" name="jog_dial_arrow_short_left_and_right" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 790 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 683 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 747 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 778 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 986 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"
android:fillColor="?android:colorForeground"/>
</vector>

View File

@@ -1,43 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project
<!--
Copyright (C) 2018 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android"
android:autoMirrored="true">
<item
android:state_checked="true">
<bitmap
android:src="@drawable/ic_expand_less"
android:tint="?android:attr/colorControlActivated">
</bitmap>
</item>
<item
android:state_pressed="true">
<bitmap
android:src="@drawable/ic_expand_less"
android:tint="?android:attr/colorControlActivated">
</bitmap>
</item>
<item>
<bitmap
android:src="@drawable/ic_expand_less"
android:tint="?android:attr/colorControlNormal">
</bitmap>
</item>
</selector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="M7.41,15.41L12,10.83l4.59,4.58L18,14l-6,-6 -6,6z"
android:fillColor="?android:colorForeground" />
</vector>

View File

@@ -1,43 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project
<!--
Copyright (C) 2018 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android"
android:autoMirrored="true">
<item
android:state_checked="true">
<bitmap
android:src="@drawable/ic_expand_more"
android:tint="?android:attr/colorControlActivated">
</bitmap>
</item>
<item
android:state_pressed="true">
<bitmap
android:src="@drawable/ic_expand_more"
android:tint="?android:attr/colorControlActivated">
</bitmap>
</item>
<item>
<bitmap
android:src="@drawable/ic_expand_more"
android:tint="?android:attr/colorControlNormal">
</bitmap>
</item>
</selector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:pathData="M7.41,8.59L12,13.17l4.59,-4.58L18,10l-6,6l-6,-6L7.41,8.59z"
android:fillColor="?android:colorForeground" />
</vector>

View File

@@ -1,25 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="96dp"
android:height="96dp"
android:viewportWidth="96.0"
android:viewportHeight="96.0">
<path
android:fillColor="#C8CCCE"
android:pathData="M4,84H92L48,8 4,84zM52,72h-8v-8h8v8zM52,56H44V40h8v16z"/>
</vector>

View File

@@ -44,7 +44,7 @@
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorPrimary">
android:textColor="@android:color/white">
</TextView>
<ImageView

View File

@@ -21,11 +21,14 @@
android:gravity="center">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="12dip"
android:src="@drawable/print_warning"
android:contentDescription="@null" />
android:layout_width="120dp"
android:layout_height="110dp"
android:layout_marginBottom="12dip"
android:src="@*android:drawable/ic_print_error"
android:scaleType="fitEnd"
android:alpha="0.1"
android:tint="@android:color/black"
android:importantForAccessibility="no" />
<TextView
android:layout_width="wrap_content"

View File

@@ -19,14 +19,13 @@
android:layout_height="fill_parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="36dip"
android:layout_width="120dp"
android:layout_height="110dp"
android:layout_gravity="center"
android:src="@drawable/ic_grayedout_printer"
android:contentDescription="@null"
android:scaleType="centerInside"
android:adjustViewBounds="true">
</ImageView>
android:src="@*android:drawable/ic_print"
android:scaleType="fitCenter"
android:alpha="0.1"
android:tint="@android:color/black"
android:importantForAccessibility="no" />
</FrameLayout>

View File

@@ -42,7 +42,7 @@
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorPrimary">
android:textColor="@android:color/white">
</TextView>
<ImageView

View File

@@ -29,7 +29,7 @@
android:paddingStart="8dip"
android:layout_marginEnd="16dp"
android:elevation="@dimen/preview_controls_elevation"
android:background="?android:attr/colorPrimary">
style="?android:actionBarStyle">
<com.android.printspooler.widget.ClickInterceptSpinner
android:id="@+id/destination_spinner"
@@ -55,7 +55,7 @@
android:paddingBottom="8dip"
android:orientation="horizontal"
android:elevation="@dimen/preview_controls_elevation"
android:background="?android:attr/colorPrimary">
style="?android:actionBarStyle">
<TextView
android:layout_width="wrap_content"
@@ -121,7 +121,6 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:animateLayoutChanges="true"
android:background="@color/print_preview_background_color"
android:gravity="center">
<!-- Error message added here -->

View File

@@ -22,7 +22,7 @@
android:layout_height="wrap_content"
android:orientation="vertical"
android:elevation="@dimen/preview_controls_elevation"
android:background="?android:attr/colorPrimary">
style="?android:actionBarStyle">
<LinearLayout
android:id="@+id/draggable_content"

View File

@@ -16,35 +16,39 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="16dip"
android:layout_marginEnd="16dip"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="12dip"
android:src="@drawable/ic_grayedout_printer"
android:contentDescription="@null">
</ImageView>
android:layout_width="120dp"
android:layout_height="110dp"
android:layout_marginBottom="12dp"
android:src="@*android:drawable/ic_print_error"
android:scaleType="fitEnd"
android:alpha="0.1"
android:tint="?android:colorForeground"
android:importantForAccessibility="no" />
<TextView
android:id="@+id/message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dip"
android:layout_marginEnd="16dip"
android:gravity="center_horizontal"
android:text="@string/print_error_default_message"
android:textAppearance="?android:attr/textAppearanceLargeInverse">
</TextView>
android:layout_marginBottom="16dp"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="?android:attr/textColorSecondary"
android:text="@string/print_error_default_message" />
<Button
android:id="@+id/action_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/print_error_retry">
</Button>
style="?android:attr/borderlessButtonStyle"
android:textColor="?android:attr/textColorSecondary"
android:text="@string/print_add_printer" />
</LinearLayout>

View File

@@ -15,34 +15,39 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="12dip"
android:src="@drawable/ic_grayedout_printer"
android:contentDescription="@null">
</ImageView>
<ProgressBar
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:indeterminate="true"
style="?android:attr/progressBarStyleHorizontal">
</ProgressBar>
android:layout_width="120dp"
android:layout_height="110dp"
android:layout_marginBottom="12dp"
android:src="@*android:drawable/ic_print"
android:scaleType="fitEnd"
android:alpha="0.1"
android:tint="?android:colorForeground"
android:importantForAccessibility="no" />
<TextView
android:id="@+id/message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLargeInverse"
android:text="@string/print_preparing_preview">
</TextView>
android:layout_marginBottom="16dp"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="?android:attr/textColorSecondary"
android:text="@string/print_preparing_preview" />
<ProgressBar
android:layout_width="300dp"
android:layout_height="wrap_content"
android:indeterminate="true"
android:importantForAccessibility="no"
style="?android:attr/progressBarStyleHorizontal" />
</LinearLayout>

View File

@@ -31,45 +31,48 @@
android:visibility="gone">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="12dip"
android:src="@*android:drawable/ic_grayedout_printer"
android:importantForAccessibility="no">
</ImageView>
android:layout_width="120dp"
android:layout_height="110dp"
android:layout_marginBottom="12dp"
android:src="@*android:drawable/ic_print"
android:scaleType="fitEnd"
android:alpha="0.1"
android:tint="?android:colorForeground"
android:importantForAccessibility="no" />
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="?android:attr/textColorSecondary"
android:text="@string/print_searching_for_printers">
</TextView>
android:text="@string/print_searching_for_printers" />
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="fill_parent"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:indeterminate="true"
style="?android:attr/progressBarStyleHorizontal">
</ProgressBar>
android:importantForAccessibility="no"
style="?android:attr/progressBarStyleHorizontal" />
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/buttonBarButtonStyle"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/print_add_printer"
android:textAllCaps="true" />
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/borderlessButtonStyle"
android:textColor="?android:attr/textColorSecondary"
android:text="@string/print_add_printer" />
</LinearLayout>

View File

@@ -18,8 +18,6 @@
<color name="print_preview_scrim_color">#99000000</color>
<color name="print_preview_background_color">#F2F1F2</color>
<color name="unselected_page_background_color">#C0C0C0</color>
<color name="material_grey_500">#ffa3a3a3</color>

View File

@@ -21,17 +21,14 @@
</style>
<style name="Theme.SelectPrinterActivity"
parent="android:style/Theme.DeviceDefault.Light.DarkActionBar">
parent="android:style/Theme.DeviceDefault.Light">
<item name="android:textAppearanceListItemSecondary">@style/ListItemSecondary</item>
</style>
<style name="Theme.PrintActivity" parent="@android:style/Theme.DeviceDefault">
<style name="Theme.PrintActivity" parent="@android:style/Theme.DeviceDefault.Light">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
</resources>

View File

@@ -166,7 +166,7 @@ final class NotificationController {
*/
private Action createCancelAction(PrintJobInfo printJob) {
return new Action.Builder(
Icon.createWithResource(mContext, R.drawable.stat_notify_cancelling),
Icon.createWithResource(mContext, R.drawable.ic_clear),
mContext.getString(R.string.cancel), createCancelIntent(printJob)).build();
}
@@ -225,7 +225,7 @@ final class NotificationController {
private void createFailedNotification(PrintJobInfo printJob) {
Action.Builder restartActionBuilder = new Action.Builder(
Icon.createWithResource(mContext, R.drawable.ic_restart),
Icon.createWithResource(mContext, com.android.internal.R.drawable.ic_restart),
mContext.getString(R.string.restart), createRestartIntent(printJob.getId()));
createNotification(printJob, createCancelAction(printJob), restartActionBuilder.build());
@@ -317,7 +317,7 @@ final class NotificationController {
if (!printJob.isCancelling()) {
return com.android.internal.R.drawable.ic_print;
} else {
return R.drawable.stat_notify_cancelling;
return R.drawable.ic_clear;
}
}
}