Contextually filled contentDescription field of the plugin list item
related buttons.
This commit is contained in:
parent
e7360127bf
commit
6eca1ca255
4 changed files with 6 additions and 0 deletions
|
@ -1989,4 +1989,5 @@
|
||||||
<string name="access_sort">Сортировать</string>
|
<string name="access_sort">Сортировать</string>
|
||||||
<string name="access_shared_string_navigate_up">Перейти вверх</string>
|
<string name="access_shared_string_navigate_up">Перейти вверх</string>
|
||||||
<string name="access_widget_expand">Развернуть</string>
|
<string name="access_widget_expand">Развернуть</string>
|
||||||
|
<string name="access_shared_string_not_installed">Не установлен</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
|
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
<string name="access_shared_string_not_installed">Not installed</string>
|
||||||
<string name="access_widget_expand">Expand</string>
|
<string name="access_widget_expand">Expand</string>
|
||||||
<string name="access_shared_string_navigate_up">Navigate up</string>
|
<string name="access_shared_string_navigate_up">Navigate up</string>
|
||||||
<string name="access_sort">Sort</string>
|
<string name="access_sort">Sort</string>
|
||||||
|
|
|
@ -94,10 +94,12 @@ public class PluginsActivity extends OsmandListActivity {
|
||||||
pluginLogo.setImageResource(plugin.getLogoResourceId());
|
pluginLogo.setImageResource(plugin.getLogoResourceId());
|
||||||
if (plugin.isActive()) {
|
if (plugin.isActive()) {
|
||||||
pluginLogo.setBackgroundResource(R.drawable.bg_plugin_logo_enabled);
|
pluginLogo.setBackgroundResource(R.drawable.bg_plugin_logo_enabled);
|
||||||
|
pluginLogo.setContentDescription(getString(R.string.shared_string_disable));
|
||||||
} else {
|
} else {
|
||||||
TypedArray attributes = getTheme().obtainStyledAttributes(
|
TypedArray attributes = getTheme().obtainStyledAttributes(
|
||||||
new int[] {R.attr.bg_plugin_logo_disabled});
|
new int[] {R.attr.bg_plugin_logo_disabled});
|
||||||
pluginLogo.setBackgroundDrawable(attributes.getDrawable(0));
|
pluginLogo.setBackgroundDrawable(attributes.getDrawable(0));
|
||||||
|
pluginLogo.setContentDescription(getString(plugin.needsInstallation() ? R.string.access_shared_string_not_installed : R.string.shared_string_enable));
|
||||||
attributes.recycle();
|
attributes.recycle();
|
||||||
}
|
}
|
||||||
pluginLogo.setOnClickListener(new View.OnClickListener() {
|
pluginLogo.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
|
@ -130,10 +130,12 @@ public class DashPluginsFragment extends DashBaseFragment {
|
||||||
ImageButton logoView = (ImageButton) pluginView.findViewById(R.id.plugin_logo);
|
ImageButton logoView = (ImageButton) pluginView.findViewById(R.id.plugin_logo);
|
||||||
if (plugin.isActive()) {
|
if (plugin.isActive()) {
|
||||||
logoView.setBackgroundResource(R.drawable.bg_plugin_logo_enabled);
|
logoView.setBackgroundResource(R.drawable.bg_plugin_logo_enabled);
|
||||||
|
logoView.setContentDescription(getString(R.string.shared_string_disable));
|
||||||
} else {
|
} else {
|
||||||
TypedArray attributes = getActivity().getTheme().obtainStyledAttributes(
|
TypedArray attributes = getActivity().getTheme().obtainStyledAttributes(
|
||||||
new int[]{R.attr.bg_plugin_logo_disabled});
|
new int[]{R.attr.bg_plugin_logo_disabled});
|
||||||
logoView.setBackgroundDrawable(attributes.getDrawable(0));
|
logoView.setBackgroundDrawable(attributes.getDrawable(0));
|
||||||
|
logoView.setContentDescription(getString(plugin.needsInstallation() ? R.string.access_shared_string_not_installed : R.string.shared_string_enable));
|
||||||
attributes.recycle();
|
attributes.recycle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue