summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/layout-land/nav_screen.xml4
-rw-r--r--res/layout-sw600dp/title_bar_nav.xml10
-rw-r--r--res/layout/nav_screen.xml4
-rw-r--r--res/layout/nav_tab_view.xml1
-rw-r--r--res/layout/tab_title.xml3
-rw-r--r--res/layout/tab_view.xml85
-rw-r--r--res/layout/title_bar_nav.xml4
-rw-r--r--res/values/strings.xml45
-rw-r--r--src/com/android/browser/NavScreen.java2
-rw-r--r--src/com/android/browser/NavigationBarPhone.java6
-rw-r--r--src/com/android/browser/NavigationBarTablet.java6
-rw-r--r--src/com/android/browser/PhoneUi.java5
12 files changed, 90 insertions, 85 deletions
diff --git a/res/layout-land/nav_screen.xml b/res/layout-land/nav_screen.xml
index d2424ea0..8e10f026 100644
--- a/res/layout-land/nav_screen.xml
+++ b/res/layout-land/nav_screen.xml
@@ -36,6 +36,7 @@
android:paddingRight="16dip"
style="@style/HoloButton"
android:gravity="center_vertical"
+ android:contentDescription="@string/accessibility_button_newtab"
android:src="@drawable/ic_new_window_holo_dark" />
<ImageButton
android:id="@+id/newincognito"
@@ -45,6 +46,7 @@
android:paddingRight="16dip"
style="@style/HoloButton"
android:gravity="center_vertical"
+ android:contentDescription="@string/accessibility_button_newincognitotab"
android:src="@drawable/ic_new_incognito_holo_dark" />
<ImageButton
android:id="@+id/bookmarks"
@@ -52,6 +54,7 @@
android:layout_height="match_parent"
android:paddingLeft="16dip"
android:paddingRight="16dip"
+ android:contentDescription="@string/accessibility_button_bookmarks"
android:src="@drawable/ic_bookmarks_history_holo_dark"
style="@style/HoloButton" />
<ImageButton
@@ -62,6 +65,7 @@
android:paddingRight="16dip"
style="@style/HoloButton"
android:gravity="center_vertical"
+ android:contentDescription="@string/accessibility_button_more"
android:src="@*android:drawable/ic_menu_moreoverflow_normal_holo_dark" />
</LinearLayout>
<com.android.browser.NavTabGallery
diff --git a/res/layout-sw600dp/title_bar_nav.xml b/res/layout-sw600dp/title_bar_nav.xml
index 818707ea..37bea351 100644
--- a/res/layout-sw600dp/title_bar_nav.xml
+++ b/res/layout-sw600dp/title_bar_nav.xml
@@ -29,12 +29,14 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingLeft="16dip"
+ android:contentDescription="@string/accessibility_button_back"
style="@style/HoloButton" />
<ImageButton
android:id="@+id/forward"
android:src="@drawable/ic_forward_holo_dark"
android:layout_width="wrap_content"
android:layout_height="match_parent"
+ android:contentDescription="@string/accessibility_button_forward"
style="@style/HoloButton" />
<ImageButton
android:id="@+id/stop"
@@ -42,6 +44,7 @@
android:layout_height="match_parent"
style="@style/HoloButton"
android:gravity="center_vertical"
+ android:contentDescription="@string/accessibility_button_stop"
android:src="@drawable/ic_stop_holo_dark" />
</LinearLayout>
<LinearLayout
@@ -58,6 +61,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/ic_web_holo_dark"
+ android:contentDescription="@string/accessibility_button_uaswitch"
style="@style/HoloIcon" />
<ImageView
android:id="@+id/lock"
@@ -88,12 +92,14 @@
android:src="@drawable/btn_imageview_star"
android:layout_width="wrap_content"
android:layout_height="match_parent"
+ android:contentDescription="@string/accessibility_button_addbookmark"
style="@style/HoloButton" />
<ImageButton
android:id="@+id/clear"
android:src="@drawable/ic_stop_holo_dark"
android:layout_width="wrap_content"
android:layout_height="match_parent"
+ android:contentDescription="@string/accessibility_button_clear"
style="@style/HoloButton" />
</LinearLayout>
<ImageButton
@@ -103,12 +109,14 @@
android:layout_height="match_parent"
android:visibility="gone"
android:gravity="center_vertical"
+ android:contentDescription="@string/accessibility_button_go"
style="@style/HoloButton" />
<ImageButton
android:id="@+id/voicesearch"
android:src="@drawable/ic_voice_search_holo_dark"
android:layout_width="wrap_content"
android:layout_height="match_parent"
+ android:contentDescription="@string/accessibility_button_voice"
style="@style/HoloButton" />
<ImageButton
android:id="@+id/search"
@@ -116,6 +124,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
+ android:contentDescription="@string/accessibility_button_search"
style="@style/HoloButton" />
<ImageButton
android:id="@+id/all_btn"
@@ -124,5 +133,6 @@
android:scaleType="center"
android:paddingRight="16dip"
style="@style/HoloButton"
+ android:contentDescription="@string/accessibility_button_bookmarks"
android:src="@drawable/ic_bookmarks_history_holo_dark" />
</com.android.browser.NavigationBarTablet>
diff --git a/res/layout/nav_screen.xml b/res/layout/nav_screen.xml
index b4e1f152..8ff4be3e 100644
--- a/res/layout/nav_screen.xml
+++ b/res/layout/nav_screen.xml
@@ -41,6 +41,7 @@
android:paddingRight="16dip"
style="@style/HoloButton"
android:gravity="center_vertical"
+ android:contentDescription="@string/accessibility_button_newtab"
android:src="@drawable/ic_new_window_holo_dark" />
<ImageButton
android:id="@+id/newincognito"
@@ -50,6 +51,7 @@
android:paddingRight="16dip"
style="@style/HoloButton"
android:gravity="center_vertical"
+ android:contentDescription="@string/accessibility_button_newincognitotab"
android:src="@drawable/ic_new_incognito_holo_dark" />
<ImageButton
android:id="@+id/bookmarks"
@@ -57,6 +59,7 @@
android:layout_height="match_parent"
android:paddingLeft="16dip"
android:paddingRight="16dip"
+ android:contentDescription="@string/accessibility_button_bookmarks"
android:src="@drawable/ic_bookmarks_history_holo_dark"
style="@style/HoloButton" />
<ImageButton
@@ -67,6 +70,7 @@
android:paddingRight="16dip"
style="@style/HoloButton"
android:gravity="center_vertical"
+ android:contentDescription="@string/accessibility_button_more"
android:src="@*android:drawable/ic_menu_moreoverflow_normal_holo_dark" />
</LinearLayout>
</RelativeLayout>
diff --git a/res/layout/nav_tab_view.xml b/res/layout/nav_tab_view.xml
index dbf9494a..6330357d 100644
--- a/res/layout/nav_tab_view.xml
+++ b/res/layout/nav_tab_view.xml
@@ -46,6 +46,7 @@
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="match_parent"
+ android:contentDescription="@string/accessibility_button_closetab"
style="@style/HoloButton" />
</LinearLayout>
<ImageView
diff --git a/res/layout/tab_title.xml b/res/layout/tab_title.xml
index 589debc3..8a5e308f 100644
--- a/res/layout/tab_title.xml
+++ b/res/layout/tab_title.xml
@@ -22,6 +22,7 @@
android:layout_height="match_parent"
android:gravity="center_vertical"
android:src="@drawable/ic_incognito_holo_dark"
+ android:contentDescription="@string/accessibility_state_incognito"
android:visibility="gone" />
<ImageView
android:id="@+id/snapshot"
@@ -29,6 +30,7 @@
android:layout_height="match_parent"
android:gravity="center_vertical"
android:src="@drawable/ic_search_category_history"
+ android:contentDescription="@string/accessibility_state_frozen"
android:visibility="gone" />
<ImageView
android:id="@+id/favicon"
@@ -59,5 +61,6 @@
android:background="?android:attr/selectableItemBackground"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:contentDescription="@string/accessibility_button_closetab"
android:src="@drawable/ic_tab_close" />
</merge>
diff --git a/res/layout/tab_view.xml b/res/layout/tab_view.xml
deleted file mode 100644
index 8ffb73dc..00000000
--- a/res/layout/tab_view.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_height="wrap_content"
- android:minHeight="?android:attr/listPreferredItemHeight"
- android:layout_width="match_parent"
- android:orientation="horizontal"
- android:gravity="center_vertical"
- android:paddingLeft="8dip"
- android:paddingTop="4dip"
- android:paddingBottom="4dip"
- >
- <RelativeLayout
- android:id="@+id/list_item"
- android:layout_width="0dip"
- android:layout_weight="1"
- android:layout_height="wrap_content"
- android:background="@drawable/bookmark_list_favicon_bg">
- <ImageView
- android:id="@+id/thumb"
- android:src="@drawable/thumbnail_bookmarks_widget_no_bookmark_holo"
- android:layout_width="match_parent"
- android:layout_height="@dimen/tab_view_thumbnail_height"
- android:scaleType="fitXY"
- android:cropToPadding="true" />
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignBottom="@id/thumb"
- android:background="@color/tabViewTitleBackground">
- <ImageView
- android:id="@+id/favicon"
- android:src="@drawable/app_web_browser_sm"
- android:layout_width="@dimen/favicon_size"
- android:layout_height="@dimen/favicon_size"
- android:layout_gravity="center_vertical"
- android:layout_marginLeft="4dip"
- android:layout_marginRight="8dip"
- android:layout_marginTop="4dip"
- android:layout_marginBottom="4dip"
- android:scaleType="fitXY" />
- <TextView
- android:id="@+id/label"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:singleLine="true"
- android:ellipsize="end"
- android:textSize="12sp"
- android:typeface="sans"
- android:textColor="@android:color/white" />
- </LinearLayout>
- </RelativeLayout>
- <View android:id="@+id/divider"
- android:background="?android:attr/dividerVertical"
- android:layout_width="1dp"
- android:layout_height="match_parent"
- android:layout_marginLeft="8dip"
- android:layout_marginTop="5dip"
- android:layout_marginBottom="5dip"
- />
- <view class="com.android.browser.ActiveTabsPage$CloseHolder" android:id="@+id/close"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:paddingLeft="12dip"
- android:paddingRight="12dip"
- android:background="@drawable/bookmark_thumb_selector"
- android:src="@drawable/ic_close_window_holo_dark"
- android:scaleType="center"
- />
-</LinearLayout>
diff --git a/res/layout/title_bar_nav.xml b/res/layout/title_bar_nav.xml
index 5a3c10e1..5e4a3a13 100644
--- a/res/layout/title_bar_nav.xml
+++ b/res/layout/title_bar_nav.xml
@@ -49,6 +49,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
+ android:contentDescription="@string/accessibility_button_stop"
android:src="@drawable/ic_stop_holo_dark"
style="@style/HoloButton" />
<com.android.browser.UrlInputView
@@ -73,6 +74,7 @@
android:id="@+id/voice"
android:layout_width="wrap_content"
android:layout_height="match_parent"
+ android:contentDescription="@string/accessibility_button_voice"
android:src="@drawable/ic_voice_search_holo_dark"
style="@style/HoloButton"
android:visibility="gone" />
@@ -81,6 +83,7 @@
android:id="@+id/tab_switcher"
android:layout_width="wrap_content"
android:layout_height="match_parent"
+ android:contentDescription="@string/accessibility_button_navscreen"
android:src="@drawable/ic_windows_holo_dark"
style="@style/HoloButton" />
<ImageButton
@@ -89,5 +92,6 @@
android:layout_height="match_parent"
style="@style/HoloButton"
android:gravity="center_vertical"
+ android:contentDescription="@string/accessibility_button_more"
android:src="@*android:drawable/ic_menu_moreoverflow_normal_holo_dark" />
</com.android.browser.NavigationBarPhone>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index b5de6329..4ed6c21d 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1012,4 +1012,49 @@
<string name="remove_snapshot">Delete saved page</string>
<!-- Popup menu option to load the live version of a saved page [CHAR LIMIT=20] -->
<string name="snapshot_go_live">Go live</string>
+
+ <!-- Accessibility content descriptions -->
+
+ <!-- Content description for back button [CHAR LIMIT=NONE] -->
+ <string name="accessibility_button_back">Go back</string>
+ <!-- Content description for forward button [CHAR LIMIT=NONE] -->
+ <string name="accessibility_button_forward">Go forward</string>
+ <!-- Content description for refresh button [CHAR LIMIT=NONE] -->
+ <string name="accessibility_button_refresh">Refresh page</string>
+ <!-- Content description for stop button [CHAR LIMIT=NONE] -->
+ <string name="accessibility_button_stop">Stop page load</string>
+ <!-- Content description for add bookmark button [CHAR LIMIT=NONE] -->
+ <string name="accessibility_button_addbookmark">Bookmark page</string>
+ <!-- Content description for search button [CHAR LIMIT=NONE] -->
+ <string name="accessibility_button_search">Search</string>
+ <!-- Content description for voice search button [CHAR LIMIT=NONE] -->
+ <string name="accessibility_button_voice">Start voice search</string>
+ <!-- Content description for bookmarks button [CHAR LIMIT=NONE] -->
+ <string name="accessibility_button_bookmarks">Bookmarks</string>
+ <!-- Content description for close tab button [CHAR LIMIT=NONE] -->
+ <string name="accessibility_button_closetab">Close tab</string>
+ <!-- Content description for new tab button [CHAR LIMIT=NONE] -->
+ <string name="accessibility_button_newtab">Open new tab</string>
+ <!-- Content description for new incognito tab button [CHAR LIMIT=NONE] -->
+ <string name="accessibility_button_newincognitotab">Open new incognito tab</string>
+ <!-- Content description for clear button [CHAR LIMIT=NONE] -->
+ <string name="accessibility_button_clear">Clear input</string>
+ <!-- Content description for user agent switcher [CHAR LIMIT=NONE] -->
+ <string name="accessibility_button_uaswitch">Switch user agent</string>
+ <!-- Content description for go button [CHAR LIMIT=NONE] -->
+ <string name="accessibility_button_go">Go</string>
+
+ <!-- Content description for tab switcher button [CHAR LIMIT=NONE] -->
+ <string name="accessibility_button_navscreen">Page manager</string>
+ <!-- Content description for overflow menu button [CHAR LIMIT=NONE] -->
+ <string name="accessibility_button_more">More options</string>
+
+ <!-- Content description for incognito state [CHAR LIMIT=NONE] -->
+ <string name="accessibility_state_incognito">Incognito page</string>
+ <!-- Content description for frozen state [CHAR LIMIT=NONE] -->
+ <string name="accessibility_state_frozen">Saved page</string>
+
+ <!-- Content description for tab switcher transition [CHAR LIMIT=NONE] -->
+ <string name="accessibility_transition_navscreen">Tab management</string>
+
</resources>
diff --git a/src/com/android/browser/NavScreen.java b/src/com/android/browser/NavScreen.java
index a361136b..9c12ccfe 100644
--- a/src/com/android/browser/NavScreen.java
+++ b/src/com/android/browser/NavScreen.java
@@ -111,6 +111,8 @@ public class NavScreen extends RelativeLayout
private void init() {
LayoutInflater.from(mContext).inflate(R.layout.nav_screen, this);
+ setContentDescription(mContext.getResources().getString(
+ R.string.accessibility_transition_navscreen));
mBookmarks = (ImageButton) findViewById(R.id.bookmarks);
mNewTab = (ImageButton) findViewById(R.id.newtab);
mNewIncognito = (ImageButton) findViewById(R.id.newincognito);
diff --git a/src/com/android/browser/NavigationBarPhone.java b/src/com/android/browser/NavigationBarPhone.java
index 388c262a..81733771 100644
--- a/src/com/android/browser/NavigationBarPhone.java
+++ b/src/com/android/browser/NavigationBarPhone.java
@@ -40,6 +40,8 @@ public class NavigationBarPhone extends NavigationBarBase implements
private ImageView mVoiceButton;
private Drawable mStopDrawable;
private Drawable mRefreshDrawable;
+ private String mStopDescription;
+ private String mRefreshDescription;
private View mTabSwitcher;
private View mComboIcon;
private View mTitleContainer;
@@ -78,6 +80,8 @@ public class NavigationBarPhone extends NavigationBarBase implements
Resources res = getContext().getResources();
mStopDrawable = res.getDrawable(R.drawable.ic_stop_holo_dark);
mRefreshDrawable = res.getDrawable(R.drawable.ic_refresh_holo_dark);
+ mStopDescription = res.getString(R.string.accessibility_button_stop);
+ mRefreshDescription = res.getString(R.string.accessibility_button_refresh);
mTextfieldBgDrawable = res.getDrawable(R.drawable.textfield_active_holo_dark);
setUaSwitcher(mComboIcon);
mUrlInput.setContainer(this);
@@ -98,6 +102,7 @@ public class NavigationBarPhone extends NavigationBarBase implements
super.onProgressStarted();
if (mStopButton.getDrawable() != mStopDrawable) {
mStopButton.setImageDrawable(mStopDrawable);
+ mStopButton.setContentDescription(mStopDescription);
if (mStopButton.getVisibility() != View.VISIBLE) {
mComboIcon.setVisibility(View.GONE);
mStopButton.setVisibility(View.VISIBLE);
@@ -109,6 +114,7 @@ public class NavigationBarPhone extends NavigationBarBase implements
public void onProgressStopped() {
super.onProgressStopped();
mStopButton.setImageDrawable(mRefreshDrawable);
+ mStopButton.setContentDescription(mRefreshDescription);
if (!isEditingUrl()) {
mComboIcon.setVisibility(View.VISIBLE);
}
diff --git a/src/com/android/browser/NavigationBarTablet.java b/src/com/android/browser/NavigationBarTablet.java
index 9cb8ff28..e3059ea9 100644
--- a/src/com/android/browser/NavigationBarTablet.java
+++ b/src/com/android/browser/NavigationBarTablet.java
@@ -35,6 +35,8 @@ public class NavigationBarTablet extends NavigationBarBase {
private Drawable mStopDrawable;
private Drawable mReloadDrawable;
+ private String mStopDescription;
+ private String mRefreshDescription;
private View mUrlContainer;
private ImageButton mBackButton;
@@ -71,6 +73,8 @@ public class NavigationBarTablet extends NavigationBarBase {
Resources resources = context.getResources();
mStopDrawable = resources.getDrawable(R.drawable.ic_stop_holo_dark);
mReloadDrawable = resources.getDrawable(R.drawable.ic_refresh_holo_dark);
+ mStopDescription = resources.getString(R.string.accessibility_button_stop);
+ mRefreshDescription = resources.getString(R.string.accessibility_button_refresh);
mFocusDrawable = resources.getDrawable(
R.drawable.textfield_active_holo_dark);
mUnfocusDrawable = resources.getDrawable(
@@ -235,11 +239,13 @@ public class NavigationBarTablet extends NavigationBarBase {
@Override
public void onProgressStarted() {
mStopButton.setImageDrawable(mStopDrawable);
+ mStopButton.setContentDescription(mStopDescription);
}
@Override
public void onProgressStopped() {
mStopButton.setImageDrawable(mReloadDrawable);
+ mStopButton.setContentDescription(mRefreshDescription);
}
protected void updateSearchMode(boolean userEdited) {
diff --git a/src/com/android/browser/PhoneUi.java b/src/com/android/browser/PhoneUi.java
index 1c9d5a04..853d9357 100644
--- a/src/com/android/browser/PhoneUi.java
+++ b/src/com/android/browser/PhoneUi.java
@@ -17,6 +17,7 @@
package com.android.browser;
import android.app.Activity;
+import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.ActionMode;
@@ -25,6 +26,8 @@ import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityManager;
import android.webkit.WebView;
import android.widget.FrameLayout;
@@ -250,6 +253,8 @@ public class PhoneUi extends BaseUi {
mContentView.setVisibility(View.GONE);
mCustomViewContainer.setVisibility(View.VISIBLE);
mCustomViewContainer.bringToFront();
+ // notify accessibility manager about the screen change
+ mNavScreen.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
}
void hideNavScreen(boolean animate) {