Added generic icon and magnification icon to a11y Settings.

Test: Manual

Bug: 36895362

Change-Id: I85281c0904bd6f562f9ebd39dd35b1eeb79108e6
This commit is contained in:
Saige McVea
2017-04-07 19:28:57 -07:00
parent d09c7e61f4
commit 672cb2edc6
12 changed files with 10 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -54,7 +54,8 @@
<Preference
android:fragment="com.android.settings.accessibility.MagnificationPreferenceFragment"
android:key="magnification_preference_screen"
android:title="@string/accessibility_screen_magnification_title"/>
android:title="@string/accessibility_screen_magnification_title"
android:icon="@mipmap/ic_accessibility_magnification" />
<Preference
android:fragment="com.android.settings.accessibility.ToggleDaltonizerPreferenceFragment"

View File

@@ -31,6 +31,7 @@ import android.os.UserHandle;
import android.provider.SearchIndexableResource;
import android.provider.Settings;
import android.support.v14.preference.SwitchPreference;
import android.support.v4.content.ContextCompat;
import android.support.v7.preference.ListPreference;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceCategory;
@@ -76,11 +77,12 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
private static final String CATEGORY_AUDIO_AND_CAPTIONS = "audio_and_captions_category";
private static final String CATEGORY_DISPLAY = "display_category";
private static final String CATEGORY_INTERACTION_CONTROL = "interaction_control_category";
private static final String CATEGORY_EXPERIMENTAL = "experimental_category";
private static final String CATEGORY_DOWNLOADED_SERVICES = "user_installed_services_category";
private static final String[] CATEGORIES = new String[] {
CATEGORY_SCREEN_READER, CATEGORY_AUDIO_AND_CAPTIONS, CATEGORY_DISPLAY,
CATEGORY_INTERACTION_CONTROL, CATEGORY_DOWNLOADED_SERVICES
CATEGORY_INTERACTION_CONTROL, CATEGORY_EXPERIMENTAL, CATEGORY_DOWNLOADED_SERVICES
};
// Preferences
@@ -454,9 +456,11 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
new RestrictedPreference(downloadedServicesCategory.getContext());
String title = info.getResolveInfo().loadLabel(getPackageManager()).toString();
Drawable icon = info.getResolveInfo().loadIcon(getPackageManager());
if (icon == null) {
// todo (saigem): add a default
Drawable icon;
if (info.getResolveInfo().getIconResource() == 0) {
icon = ContextCompat.getDrawable(getContext(), R.mipmap.ic_accessibility_generic);
} else {
icon = info.getResolveInfo().loadIcon(getPackageManager());
}
ServiceInfo serviceInfo = info.getResolveInfo().serviceInfo;