diff --git a/core/java/com/android/internal/widget/ResolverDrawerLayout.java b/core/java/com/android/internal/widget/ResolverDrawerLayout.java index 25b487efdae6b..c4347f832bd55 100644 --- a/core/java/com/android/internal/widget/ResolverDrawerLayout.java +++ b/core/java/com/android/internal/widget/ResolverDrawerLayout.java @@ -17,14 +17,9 @@ package com.android.internal.widget; -import android.annotation.NonNull; import android.content.Context; import android.content.res.TypedArray; -import android.graphics.Canvas; -import android.graphics.Color; import android.graphics.Rect; -import android.graphics.drawable.ColorDrawable; -import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; @@ -90,10 +85,6 @@ public class ResolverDrawerLayout extends ViewGroup { private final float mMinFlingVelocity; private final OverScroller mScroller; private final VelocityTracker mVelocityTracker; - private final Drawable mScrollIndicatorDrawable; - private final Drawable mFakeForeground; - - private View mButtonBar; private OnDismissedListener mOnDismissedListener; private RunOnDismissedListener mRunOnDismissedListener; @@ -115,8 +106,6 @@ public class ResolverDrawerLayout extends ViewGroup { } }; - private final int[] mTempOffset = new int[2]; - public ResolverDrawerLayout(Context context) { this(context, null); } @@ -138,9 +127,6 @@ public class ResolverDrawerLayout extends ViewGroup { mMaxCollapsedHeight); a.recycle(); - mScrollIndicatorDrawable = mContext.getDrawable(R.drawable.scroll_indicator_material); - mFakeForeground = new ColorDrawable(Color.TRANSPARENT); - mScroller = new OverScroller(context, AnimationUtils.loadInterpolator(context, android.R.interpolator.decelerate_quint)); mVelocityTracker = VelocityTracker.obtain(); @@ -152,13 +138,6 @@ public class ResolverDrawerLayout extends ViewGroup { setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES); } - @Override - protected void onFinishInflate() { - super.onFinishInflate(); - - mButtonBar = findViewById(R.id.button_bar); - } - public void setSmallCollapsed(boolean smallCollapsed) { mSmallCollapsed = smallCollapsed; requestLayout(); @@ -223,7 +202,8 @@ public class ResolverDrawerLayout extends ViewGroup { } final boolean isCollapsedNew = mCollapseOffset != 0; if (isCollapsedOld != isCollapsedNew) { - onCollapsedChanged(isCollapsedNew); + notifyViewAccessibilityStateChangedIfNeeded( + AccessibilityEvent.CONTENT_CHANGE_TYPE_UNDEFINED); } } else { // Start out collapsed at first unless we restored state for otherwise @@ -462,7 +442,8 @@ public class ResolverDrawerLayout extends ViewGroup { mTopOffset += dy; final boolean isCollapsedNew = newPos != 0; if (isCollapsedOld != isCollapsedNew) { - onCollapsedChanged(isCollapsedNew); + notifyViewAccessibilityStateChangedIfNeeded( + AccessibilityEvent.CONTENT_CHANGE_TYPE_UNDEFINED); } postInvalidateOnAnimation(); return dy; @@ -470,14 +451,6 @@ public class ResolverDrawerLayout extends ViewGroup { return 0; } - private void onCollapsedChanged(boolean isCollapsed) { - notifyViewAccessibilityStateChangedIfNeeded( - AccessibilityEvent.CONTENT_CHANGE_TYPE_UNDEFINED); - - // Set a fake foreground so that we receive onDrawForeground(). - setForeground(isCollapsed ? mFakeForeground : null); - } - void dispatchOnDismissed() { if (mOnDismissedListener != null) { mOnDismissedListener.onDismissed(); @@ -735,23 +708,6 @@ public class ResolverDrawerLayout extends ViewGroup { return false; } - @Override - public void onDrawForeground(Canvas canvas) { - if (isCollapsed() && mButtonBar != null) { - // Draw the scroll indicator directly above the button bar. - final int height = mScrollIndicatorDrawable.getIntrinsicHeight(); - mButtonBar.getLocationInWindow(mTempOffset); - final int barTop = mTempOffset[1]; - getLocationInWindow(mTempOffset); - final int myTop = mTempOffset[1]; - final int top = (barTop - myTop) - height; - mScrollIndicatorDrawable.setBounds(0, top, getWidth(), top + height); - mScrollIndicatorDrawable.draw(canvas); - } - - super.onDrawForeground(canvas); - } - @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { final int sourceWidth = MeasureSpec.getSize(widthMeasureSpec); diff --git a/core/res/res/layout/resolver_list.xml b/core/res/res/layout/resolver_list.xml index fe43e1c5d8b87..4b8640c91f70b 100644 --- a/core/res/res/layout/resolver_list.xml +++ b/core/res/res/layout/resolver_list.xml @@ -30,37 +30,33 @@ android:layout_height="wrap_content" android:layout_alwaysShow="true" android:elevation="8dp" - android:background="@color/white"> - - - - + android:background="@color/white" > + + - + - -