OSDN Git Service

Fix print icons in settings.
authorSvetoslav <svetoslavganov@google.com>
Thu, 11 Sep 2014 01:33:25 +0000 (18:33 -0700)
committerSvetoslav <svetoslavganov@google.com>
Thu, 11 Sep 2014 01:33:32 +0000 (18:33 -0700)
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

res/drawable/ic_print.xml [new file with mode: 0644]
res/drawable/ic_print_error.xml [new file with mode: 0644]
src/com/android/settings/print/PrintJobSettingsFragment.java
src/com/android/settings/print/PrintSettingsFragment.java

diff --git a/res/drawable/ic_print.xml b/res/drawable/ic_print.xml
new file mode 100644 (file)
index 0000000..647838d
--- /dev/null
@@ -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" />
diff --git a/res/drawable/ic_print_error.xml b/res/drawable/ic_print_error.xml
new file mode 100644 (file)
index 0000000..560aaab
--- /dev/null
@@ -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" />
index 5af7f9d..04f3f16 100644 (file)
@@ -204,12 +204,12 @@ public class PrintJobSettingsFragment extends SettingsPreferenceFragment {
         switch (info.getState()) {
             case PrintJobInfo.STATE_QUEUED:
             case PrintJobInfo.STATE_STARTED: {
-                mPrintJobPreference.setIcon(com.android.internal.R.drawable.ic_print);
+                mPrintJobPreference.setIcon(R.drawable.ic_print);
             } break;
 
             case PrintJobInfo.STATE_FAILED:
             case PrintJobInfo.STATE_BLOCKED: {
-                mPrintJobPreference.setIcon(com.android.internal.R.drawable.ic_print_error);
+                mPrintJobPreference.setIcon(R.drawable.ic_print_error);
             } break;
         }
 
index 3e2cd8b..4a34875 100644 (file)
@@ -423,12 +423,12 @@ public class PrintSettingsFragment extends SettingsPreferenceFragment
                     switch (printJob.getState()) {
                         case PrintJobInfo.STATE_QUEUED:
                         case PrintJobInfo.STATE_STARTED: {
-                            preference.setIcon(com.android.internal.R.drawable.ic_print);
+                            preference.setIcon(R.drawable.ic_print);
                         } break;
 
                         case PrintJobInfo.STATE_FAILED:
                         case PrintJobInfo.STATE_BLOCKED: {
-                            preference.setIcon(com.android.internal.R.drawable.ic_print_error);
+                            preference.setIcon(R.drawable.ic_print_error);
                         } break;
                     }