Fix print icons in settings.

The print icons are in the framework resources and are not tinted
to enable usage from various places such as print spooler and
settings with different tinting. Settings was using not-tinted
print icons which were invisible on the white background. This
change switches settings to user tinted drawables.

bug:16966145

Change-Id: I2cf55d36d90b0192ba23686aac4f1d8e7e23f75a
This commit is contained in:
Svetoslav
2014-09-10 18:33:25 -07:00
parent 877fb7fb42
commit 031e8b1432
4 changed files with 42 additions and 4 deletions

19
res/drawable/ic_print.xml Normal file
View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 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.
-->
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@*android:drawable/ic_print"
android:tint="@*android:color/material_deep_teal_500" />

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 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.
-->
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@*android:drawable/ic_print_error"
android:tint="@*android:color/material_deep_teal_500" />

View File

@@ -204,12 +204,12 @@ public class PrintJobSettingsFragment extends SettingsPreferenceFragment {
switch (info.getState()) { switch (info.getState()) {
case PrintJobInfo.STATE_QUEUED: case PrintJobInfo.STATE_QUEUED:
case PrintJobInfo.STATE_STARTED: { case PrintJobInfo.STATE_STARTED: {
mPrintJobPreference.setIcon(com.android.internal.R.drawable.ic_print); mPrintJobPreference.setIcon(R.drawable.ic_print);
} break; } break;
case PrintJobInfo.STATE_FAILED: case PrintJobInfo.STATE_FAILED:
case PrintJobInfo.STATE_BLOCKED: { case PrintJobInfo.STATE_BLOCKED: {
mPrintJobPreference.setIcon(com.android.internal.R.drawable.ic_print_error); mPrintJobPreference.setIcon(R.drawable.ic_print_error);
} break; } break;
} }

View File

@@ -423,12 +423,12 @@ public class PrintSettingsFragment extends SettingsPreferenceFragment
switch (printJob.getState()) { switch (printJob.getState()) {
case PrintJobInfo.STATE_QUEUED: case PrintJobInfo.STATE_QUEUED:
case PrintJobInfo.STATE_STARTED: { case PrintJobInfo.STATE_STARTED: {
preference.setIcon(com.android.internal.R.drawable.ic_print); preference.setIcon(R.drawable.ic_print);
} break; } break;
case PrintJobInfo.STATE_FAILED: case PrintJobInfo.STATE_FAILED:
case PrintJobInfo.STATE_BLOCKED: { case PrintJobInfo.STATE_BLOCKED: {
preference.setIcon(com.android.internal.R.drawable.ic_print_error); preference.setIcon(R.drawable.ic_print_error);
} break; } break;
} }