diff options
author | Michael Kolb <kolby@google.com> | 2011-07-29 13:37:05 -0700 |
---|---|---|
committer | Michael Kolb <kolby@google.com> | 2011-07-29 15:03:46 -0700 |
commit | 30adae6ebf17a724d24066a200432e6b22a4eeff (patch) | |
tree | a16abcb20629633f894e4e7aa4c38dca5ae73c8a /src | |
parent | 1b9353cbf59678721d48313cb92189a1530f0483 (diff) | |
download | packages_apps_Browser-30adae6ebf17a724d24066a200432e6b22a4eeff.zip packages_apps_Browser-30adae6ebf17a724d24066a200432e6b22a4eeff.tar.gz packages_apps_Browser-30adae6ebf17a724d24066a200432e6b22a4eeff.tar.bz2 |
add accessibility descriptions/events
Bug: 4979091
added content descriptions to the image buttons
send event for screen transition
Change-Id: I403fe8504cace4aa84a5b1c6ca18f6c10fc9be34
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/browser/NavScreen.java | 2 | ||||
-rw-r--r-- | src/com/android/browser/NavigationBarPhone.java | 6 | ||||
-rw-r--r-- | src/com/android/browser/NavigationBarTablet.java | 6 | ||||
-rw-r--r-- | src/com/android/browser/PhoneUi.java | 5 |
4 files changed, 19 insertions, 0 deletions
diff --git a/src/com/android/browser/NavScreen.java b/src/com/android/browser/NavScreen.java index a361136..9c12ccf 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 388c262..8173377 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 9cb8ff2..e3059ea 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 1c9d5a0..853d935 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) { |