summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYizhen Fu <fafaisland@google.com>2015-10-16 17:14:25 -0700
committerYizhen Fu <fafaisland@google.com>2015-10-16 17:14:25 -0700
commite3bc739bfab134619ff59cd139454a8a1c6a5506 (patch)
treeb4d8c84757aea381a8dff49159e6f1bf76219263
parent8650d3cda75562489551ee04bff9145a49a6f16f (diff)
downloadandroid_frameworks_opt_photoviewer-e3bc739bfab134619ff59cd139454a8a1c6a5506.tar.gz
android_frameworks_opt_photoviewer-e3bc739bfab134619ff59cd139454a8a1c6a5506.tar.bz2
android_frameworks_opt_photoviewer-e3bc739bfab134619ff59cd139454a8a1c6a5506.zip
Talkback shoudn't announce Photo details twice.
Bug:19531215 Change-Id: I9ede97b44c6d80ebf9de58e9646e8008ce878033
-rw-r--r--src/com/android/ex/photo/PhotoViewController.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/ex/photo/PhotoViewController.java b/src/com/android/ex/photo/PhotoViewController.java
index 9da1759..adca9ed 100644
--- a/src/com/android/ex/photo/PhotoViewController.java
+++ b/src/com/android/ex/photo/PhotoViewController.java
@@ -24,8 +24,8 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewPropertyAnimator;
-import android.view.WindowManager;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
+import android.view.WindowManager;
import android.view.accessibility.AccessibilityManager;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
@@ -197,6 +197,8 @@ public class PhotoViewController implements
// text.
private long mEnterFullScreenDelayTime;
+ private boolean isTitleAnnounced;
+
public PhotoViewController(ActivityInterface activity) {
mActivity = activity;
@@ -749,10 +751,11 @@ public class PhotoViewController implements
int uriIndex = cursor.getColumnIndex(PhotoContract.PhotoViewColumns.URI);
mCurrentPhotoUri = cursor.getString(uriIndex);
updateActionBar();
- if (mAccessibilityManager.isEnabled()) {
+ if (mAccessibilityManager.isEnabled() && isTitleAnnounced == false) {
String announcement = getPhotoAccessibilityAnnouncement(position);
if (announcement != null) {
Util.announceForAccessibility(mRootView, mAccessibilityManager, announcement);
+ isTitleAnnounced = true;
}
}