more content descriptors
This commit is contained in:
@@ -38,6 +38,7 @@ public class SpinnerIconAdapter extends ArrayAdapter<CharSequence> {
|
|||||||
ImageView iconView = (ImageView) convertView.findViewById(R.id.spinner_icon);
|
ImageView iconView = (ImageView) convertView.findViewById(R.id.spinner_icon);
|
||||||
Drawable icon = getContext().getResources().getDrawable(itemIcons[position]);
|
Drawable icon = getContext().getResources().getDrawable(itemIcons[position]);
|
||||||
iconView.setImageDrawable(icon);
|
iconView.setImageDrawable(icon);
|
||||||
|
iconView.setContentDescription(convertView.getContext().getString(R.string.create_icon_content_description, getItem(position)));
|
||||||
return convertView;
|
return convertView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,6 +52,7 @@ public class SpinnerIconAdapter extends ArrayAdapter<CharSequence> {
|
|||||||
ImageView iconView = (ImageView) convertView.findViewById(R.id.spinner_icon);
|
ImageView iconView = (ImageView) convertView.findViewById(R.id.spinner_icon);
|
||||||
Drawable icon = getContext().getResources().getDrawable(itemIcons[position]);
|
Drawable icon = getContext().getResources().getDrawable(itemIcons[position]);
|
||||||
iconView.setImageDrawable(icon);
|
iconView.setImageDrawable(icon);
|
||||||
|
iconView.setContentDescription(convertView.getContext().getString(R.string.create_icon_content_description, getItem(position)));
|
||||||
return convertView;
|
return convertView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ public class NotificationListAdapter extends CursorRecyclerViewAdapter<Notificat
|
|||||||
|
|
||||||
|
|
||||||
ivSmallIcon.setImageDrawable(smallIcon);
|
ivSmallIcon.setImageDrawable(smallIcon);
|
||||||
|
ivSmallIcon.setContentDescription(context.getString(R.string.notification_list_item_small_icon_content_description, n.appName));
|
||||||
|
|
||||||
itemView.setTag(n.id);
|
itemView.setTag(n.id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,12 +60,15 @@ public class AppsAdapter extends BaseAdapter {
|
|||||||
String packageName = (String) getItem(position);
|
String packageName = (String) getItem(position);
|
||||||
viewHolder.tvPackageName.setText(packageName);
|
viewHolder.tvPackageName.setText(packageName);
|
||||||
try {
|
try {
|
||||||
viewHolder.tvName.setText(PackageUtils.getAppName(convertView.getContext(), packageName));
|
String appName = PackageUtils.getAppName(convertView.getContext(), packageName);
|
||||||
|
viewHolder.tvName.setText(appName);
|
||||||
viewHolder.ivIcon.setImageDrawable(PackageUtils.getApplicationLauncherIcon(convertView.getContext(), packageName));
|
viewHolder.ivIcon.setImageDrawable(PackageUtils.getApplicationLauncherIcon(convertView.getContext(), packageName));
|
||||||
|
viewHolder.ivIcon.setContentDescription(convertView.getContext().getString(R.string.app_icon_cd, appName));
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
Timber.d("app name not found", e);
|
Timber.d("app name not found", e);
|
||||||
viewHolder.tvName.setText("");
|
viewHolder.tvName.setText("");
|
||||||
viewHolder.ivIcon.setImageDrawable(null);
|
viewHolder.ivIcon.setImageDrawable(null);
|
||||||
|
viewHolder.ivIcon.setContentDescription("");
|
||||||
}
|
}
|
||||||
|
|
||||||
return convertView;
|
return convertView;
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:orientation="vertical" android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
<include layout="@android:layout/simple_spinner_item" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
@@ -53,6 +53,7 @@
|
|||||||
<string name="create_shedule_snack">Notification sheduled for %1$s</string>
|
<string name="create_shedule_snack">Notification sheduled for %1$s</string>
|
||||||
<string name="create_shedule_snack_undo">Undo</string>
|
<string name="create_shedule_snack_undo">Undo</string>
|
||||||
<string name="notification_list_empty">No notifications found.</string>
|
<string name="notification_list_empty">No notifications found.</string>
|
||||||
|
<string name="notification_list_item_small_icon_content_description">Small notification icon: %s</string>
|
||||||
<string name="notification_small_icon_cd">Notification small icon</string>
|
<string name="notification_small_icon_cd">Notification small icon</string>
|
||||||
<string name="app_icon_cd">Application icon for %s</string>
|
<string name="app_icon_cd">Application icon for %s</string>
|
||||||
<string name="notification_info_dialog_app_info_error">Failed to display app info.</string>
|
<string name="notification_info_dialog_app_info_error">Failed to display app info.</string>
|
||||||
@@ -111,6 +112,7 @@
|
|||||||
<item>Transport</item>
|
<item>Transport</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
<string name="create_icon_content_description">Notification icon: %s</string>
|
||||||
<string-array name="create_icons">
|
<string-array name="create_icons">
|
||||||
<item>ADB</item>
|
<item>ADB</item>
|
||||||
<item>Bluetooth</item>
|
<item>Bluetooth</item>
|
||||||
@@ -120,5 +122,6 @@
|
|||||||
<item>Power</item>
|
<item>Power</item>
|
||||||
<item>SD card</item>
|
<item>SD card</item>
|
||||||
<item>SMS</item>
|
<item>SMS</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
<string-array name="create_icons_content_descriptions" />
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user