summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/PagedView.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-06-16 12:29:03 -0700
committerSunny Goyal <sunnygoyal@google.com>2016-06-22 14:17:34 -0700
commitd0a6ae7f645e6ba564aebb50316c53fa2e119459 (patch)
tree15bba4b1eea09e0178a22911567952dc45d5ff12 /src/com/android/launcher3/PagedView.java
parent8e6a8004808fbbf782812a6cd75324a7008cc610 (diff)
downloadandroid_packages_apps_Trebuchet-d0a6ae7f645e6ba564aebb50316c53fa2e119459.tar.gz
android_packages_apps_Trebuchet-d0a6ae7f645e6ba564aebb50316c53fa2e119459.tar.bz2
android_packages_apps_Trebuchet-d0a6ae7f645e6ba564aebb50316c53fa2e119459.zip
Accessibility fixes and updates
> Adding custom actions on the page indicator to go to overview mode > Disabling custom actions on the first page > Disabling 'move page left' on the second page Change-Id: Ib8154f70cb3f93e663a881357c6c46c33253887f
Diffstat (limited to 'src/com/android/launcher3/PagedView.java')
-rw-r--r--src/com/android/launcher3/PagedView.java37
1 files changed, 6 insertions, 31 deletions
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index 926679314..5ac3f0bab 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -154,7 +154,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
// Page Indicator
@Thunk int mPageIndicatorViewId;
- @Thunk PageIndicator mPageIndicator;
+ protected PageIndicator mPageIndicator;
// The viewport whether the pages are to be contained (the actual view may be larger than the
// viewport)
@ViewDebug.ExportedProperty(category = "launcher")
@@ -247,39 +247,14 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
mScroller.setInterpolator(mDefaultInterpolator);
}
- protected void onAttachedToWindow() {
- super.onAttachedToWindow();
-
- // Hook up the page indicator
- ViewGroup parent = (ViewGroup) getParent();
- ViewGroup grandParent = (ViewGroup) parent.getParent();
- if (mPageIndicator == null && mPageIndicatorViewId > -1) {
- mPageIndicator = (PageIndicator) grandParent.findViewById(mPageIndicatorViewId);
+ public void initParentViews(View parent) {
+ if (mPageIndicatorViewId > -1) {
+ mPageIndicator = (PageIndicator) parent.findViewById(mPageIndicatorViewId);
mPageIndicator.setMarkersCount(getChildCount());
-
- OnClickListener listener = getPageIndicatorClickListener();
- if (listener != null) {
- mPageIndicator.setOnClickListener(listener);
- }
- mPageIndicator.setContentDescription(getPageIndicatorDescription());
+ mPageIndicator.setContentDescription(getCurrentPageDescription());
}
}
- protected String getPageIndicatorDescription() {
- return getCurrentPageDescription();
- }
-
- protected OnClickListener getPageIndicatorClickListener() {
- return null;
- }
-
- @Override
- protected void onDetachedFromWindow() {
- super.onDetachedFromWindow();
- // Unhook the page indicator
- mPageIndicator = null;
- }
-
// Convenience methods to map points from self to parent and vice versa
private float[] mapPointFromViewToParent(View v, float x, float y) {
sTmpPoint[0] = x;
@@ -467,7 +442,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
private void updatePageIndicator() {
// Update the page indicator (when we aren't reordering)
if (mPageIndicator != null) {
- mPageIndicator.setContentDescription(getPageIndicatorDescription());
+ mPageIndicator.setContentDescription(getCurrentPageDescription());
if (!isReordering(false)) {
mPageIndicator.setActiveMarker(getNextPage());
}