Bug 753859 - Added description to toolbar tabs button. r=mfinkle, r=sriram

This commit is contained in:
Eitan Isaacson 2012-05-14 14:22:00 -07:00
parent 774971679a
commit 81137003d8
3 changed files with 13 additions and 1 deletions

View File

@ -246,6 +246,7 @@ public class BrowserToolbar {
mTabsCount.setVisibility(View.VISIBLE);
// Set image to more tabs dropdown "v"
mTabs.setImageLevel(count);
mTabs.setContentDescription(mContext.getString(R.string.num_tabs, count));
}
mHandler.postDelayed(new Runnable() {
@ -263,6 +264,7 @@ public class BrowserToolbar {
// Set image to new tab button "+"
mTabs.setImageLevel(1);
mTabsCount.setVisibility(View.GONE);
mTabs.setContentDescription(mContext.getString(R.string.new_tab));
}
((TextView) mTabsCount.getCurrentView()).setTextColor(mCounterColor);
}
@ -272,7 +274,13 @@ public class BrowserToolbar {
public void updateTabCount(int count) {
mTabsCount.setCurrentText(String.valueOf(count));
mTabs.setImageLevel(count);
mTabsCount.setVisibility(count > 1 ? View.VISIBLE : View.INVISIBLE);
if (count > 1) {
mTabsCount.setVisibility(View.VISIBLE);
mTabs.setContentDescription(mContext.getString(R.string.num_tabs, count));
} else {
mTabsCount.setVisibility(View.INVISIBLE);
mTabs.setContentDescription(mContext.getString(R.string.new_tab));
}
}
public void setProgressVisibility(boolean visible) {

View File

@ -46,6 +46,9 @@
<!ENTITY close_tab "Close Tab">
<!ENTITY new_tab "New Tab">
<!-- Localization note (num_tabs) : Number of tabs is always more than one.
We can't use android plural forms, sadly. See bug #753859. -->
<!ENTITY num_tabs "&#037;d tabs">
<!ENTITY new_tab_opened "New tab opened">
<!ENTITY settings "Settings">

View File

@ -88,6 +88,7 @@
<string name="close_tab">&close_tab;</string>
<string name="new_tab">&new_tab;</string>
<string name="new_tab_opened">&new_tab_opened;</string>
<string name="num_tabs">&num_tabs;</string>
<string name="addons">&addons;</string>
<string name="downloads">&downloads;</string>
<string name="char_encoding">&char_encoding;</string>