Loading api/current.txt +5 −0 Original line number Diff line number Diff line Loading @@ -54849,6 +54849,7 @@ package android.widget { method public void deferNotifyDataSetChanged(); method public void fling(int); method public android.widget.AbsListView.LayoutParams generateLayoutParams(android.util.AttributeSet); method @ColorInt public int getBottomEdgeEffectColor(); method @android.view.ViewDebug.ExportedProperty(category="drawing") @ColorInt public int getCacheColorHint(); method public int getCheckedItemCount(); method public long[] getCheckedItemIds(); Loading @@ -54863,6 +54864,7 @@ package android.widget { method @android.view.ViewDebug.ExportedProperty public android.view.View getSelectedView(); method public android.graphics.drawable.Drawable getSelector(); method public CharSequence getTextFilter(); method @ColorInt public int getTopEdgeEffectColor(); method public int getTranscriptMode(); method protected void handleDataChanged(); method public boolean hasTextFilter(); Loading Loading @@ -54890,9 +54892,11 @@ package android.widget { method public void reclaimViews(java.util.List<android.view.View>); method public void scrollListBy(int); method public void setAdapter(android.widget.ListAdapter); method public void setBottomEdgeEffectColor(@ColorInt int); method public void setCacheColorHint(@ColorInt int); method public void setChoiceMode(int); method public void setDrawSelectorOnTop(boolean); method public void setEdgeEffectColor(@ColorInt int); method public void setFastScrollAlwaysVisible(boolean); method public void setFastScrollEnabled(boolean); method public void setFastScrollStyle(int); Loading @@ -54911,6 +54915,7 @@ package android.widget { method public void setSmoothScrollbarEnabled(boolean); method public void setStackFromBottom(boolean); method public void setTextFilterEnabled(boolean); method public void setTopEdgeEffectColor(@ColorInt int); method public void setTranscriptMode(int); method public void setVelocityScale(float); method public void smoothScrollBy(int, int); core/java/android/widget/AbsListView.java +92 −25 Original line number Diff line number Diff line Loading @@ -708,15 +708,23 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te /** * Tracks the state of the top edge glow. * * Even though this field is practically final, we cannot make it final because there are apps * setting it via reflection and they need to keep working until they target Q. */ @UnsupportedAppUsage private EdgeEffect mEdgeGlowTop; @NonNull @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 123769408) private EdgeEffect mEdgeGlowTop = new EdgeEffect(mContext); /** * Tracks the state of the bottom edge glow. * * Even though this field is practically final, we cannot make it final because there are apps * setting it via reflection and they need to keep working until they target Q. */ @UnsupportedAppUsage private EdgeEffect mEdgeGlowBottom; @NonNull @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 123768444) private EdgeEffect mEdgeGlowBottom = new EdgeEffect(mContext); /** * An estimate of how many pixels are between the top of the list and Loading Loading @@ -923,21 +931,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te mDensityScale = getContext().getResources().getDisplayMetrics().density; } @Override public void setOverScrollMode(int mode) { if (mode != OVER_SCROLL_NEVER) { if (mEdgeGlowTop == null) { Context context = getContext(); mEdgeGlowTop = new EdgeEffect(context); mEdgeGlowBottom = new EdgeEffect(context); } } else { mEdgeGlowTop = null; mEdgeGlowBottom = null; } super.setOverScrollMode(mode); } /** * {@inheritDoc} */ Loading Loading @@ -3772,7 +3765,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } private void invalidateTopGlow() { if (mEdgeGlowTop == null) { if (!shouldDisplayEdgeEffects()) { return; } final boolean clipToPadding = getClipToPadding(); Loading @@ -3783,7 +3776,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } private void invalidateBottomGlow() { if (mEdgeGlowBottom == null) { if (!shouldDisplayEdgeEffects()) { return; } final boolean clipToPadding = getClipToPadding(); Loading Loading @@ -4208,7 +4201,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te setPressed(false); if (mEdgeGlowTop != null) { if (shouldDisplayEdgeEffects()) { mEdgeGlowTop.onRelease(); mEdgeGlowBottom.onRelease(); } Loading @@ -4233,6 +4226,10 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } } private boolean shouldDisplayEdgeEffects() { return getOverScrollMode() != OVER_SCROLL_NEVER; } private void onTouchCancel() { switch (mTouchMode) { case TOUCH_MODE_OVERSCROLL: Loading @@ -4258,7 +4255,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te recycleVelocityTracker(); } if (mEdgeGlowTop != null) { if (shouldDisplayEdgeEffects()) { mEdgeGlowTop.onRelease(); mEdgeGlowBottom.onRelease(); } Loading Loading @@ -4379,7 +4376,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te @Override public void draw(Canvas canvas) { super.draw(canvas); if (mEdgeGlowTop != null) { if (shouldDisplayEdgeEffects()) { final int scrollY = mScrollY; final boolean clipToPadding = getClipToPadding(); final int width; Loading Loading @@ -6371,7 +6368,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } private void finishGlows() { if (mEdgeGlowTop != null) { if (shouldDisplayEdgeEffects()) { mEdgeGlowTop.finish(); mEdgeGlowBottom.finish(); } Loading Loading @@ -6477,6 +6474,76 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } } /** * Sets the edge effect color for both top and bottom edge effects. * * @param color The color for the edge effects. * @see #setTopEdgeEffectColor(int) * @see #setBottomEdgeEffectColor(int) * @see #getTopEdgeEffectColor() * @see #getBottomEdgeEffectColor() */ public void setEdgeEffectColor(@ColorInt int color) { setTopEdgeEffectColor(color); setBottomEdgeEffectColor(color); } /** * Sets the bottom edge effect color. * * @param color The color for the bottom edge effect. * @see #setTopEdgeEffectColor(int) * @see #setEdgeEffectColor(int) * @see #getTopEdgeEffectColor() * @see #getBottomEdgeEffectColor() */ public void setBottomEdgeEffectColor(@ColorInt int color) { mEdgeGlowBottom.setColor(color); invalidateBottomGlow(); } /** * Sets the top edge effect color. * * @param color The color for the top edge effect. * @see #setBottomEdgeEffectColor(int) * @see #setEdgeEffectColor(int) * @see #getTopEdgeEffectColor() * @see #getBottomEdgeEffectColor() */ public void setTopEdgeEffectColor(@ColorInt int color) { mEdgeGlowTop.setColor(color); invalidateTopGlow(); } /** * Returns the top edge effect color. * * @return The top edge effect color. * @see #setEdgeEffectColor(int) * @see #setTopEdgeEffectColor(int) * @see #setBottomEdgeEffectColor(int) * @see #getBottomEdgeEffectColor() */ @ColorInt public int getTopEdgeEffectColor() { return mEdgeGlowTop.getColor(); } /** * Returns the bottom edge effect color. * * @return The bottom edge effect color. * @see #setEdgeEffectColor(int) * @see #setTopEdgeEffectColor(int) * @see #setBottomEdgeEffectColor(int) * @see #getTopEdgeEffectColor() */ @ColorInt public int getBottomEdgeEffectColor() { return mEdgeGlowBottom.getColor(); } /** * Sets the recycler listener to be notified whenever a View is set aside in * the recycler for later reuse. This listener can be used to free resources Loading Loading
api/current.txt +5 −0 Original line number Diff line number Diff line Loading @@ -54849,6 +54849,7 @@ package android.widget { method public void deferNotifyDataSetChanged(); method public void fling(int); method public android.widget.AbsListView.LayoutParams generateLayoutParams(android.util.AttributeSet); method @ColorInt public int getBottomEdgeEffectColor(); method @android.view.ViewDebug.ExportedProperty(category="drawing") @ColorInt public int getCacheColorHint(); method public int getCheckedItemCount(); method public long[] getCheckedItemIds(); Loading @@ -54863,6 +54864,7 @@ package android.widget { method @android.view.ViewDebug.ExportedProperty public android.view.View getSelectedView(); method public android.graphics.drawable.Drawable getSelector(); method public CharSequence getTextFilter(); method @ColorInt public int getTopEdgeEffectColor(); method public int getTranscriptMode(); method protected void handleDataChanged(); method public boolean hasTextFilter(); Loading Loading @@ -54890,9 +54892,11 @@ package android.widget { method public void reclaimViews(java.util.List<android.view.View>); method public void scrollListBy(int); method public void setAdapter(android.widget.ListAdapter); method public void setBottomEdgeEffectColor(@ColorInt int); method public void setCacheColorHint(@ColorInt int); method public void setChoiceMode(int); method public void setDrawSelectorOnTop(boolean); method public void setEdgeEffectColor(@ColorInt int); method public void setFastScrollAlwaysVisible(boolean); method public void setFastScrollEnabled(boolean); method public void setFastScrollStyle(int); Loading @@ -54911,6 +54915,7 @@ package android.widget { method public void setSmoothScrollbarEnabled(boolean); method public void setStackFromBottom(boolean); method public void setTextFilterEnabled(boolean); method public void setTopEdgeEffectColor(@ColorInt int); method public void setTranscriptMode(int); method public void setVelocityScale(float); method public void smoothScrollBy(int, int);
core/java/android/widget/AbsListView.java +92 −25 Original line number Diff line number Diff line Loading @@ -708,15 +708,23 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te /** * Tracks the state of the top edge glow. * * Even though this field is practically final, we cannot make it final because there are apps * setting it via reflection and they need to keep working until they target Q. */ @UnsupportedAppUsage private EdgeEffect mEdgeGlowTop; @NonNull @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 123769408) private EdgeEffect mEdgeGlowTop = new EdgeEffect(mContext); /** * Tracks the state of the bottom edge glow. * * Even though this field is practically final, we cannot make it final because there are apps * setting it via reflection and they need to keep working until they target Q. */ @UnsupportedAppUsage private EdgeEffect mEdgeGlowBottom; @NonNull @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 123768444) private EdgeEffect mEdgeGlowBottom = new EdgeEffect(mContext); /** * An estimate of how many pixels are between the top of the list and Loading Loading @@ -923,21 +931,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te mDensityScale = getContext().getResources().getDisplayMetrics().density; } @Override public void setOverScrollMode(int mode) { if (mode != OVER_SCROLL_NEVER) { if (mEdgeGlowTop == null) { Context context = getContext(); mEdgeGlowTop = new EdgeEffect(context); mEdgeGlowBottom = new EdgeEffect(context); } } else { mEdgeGlowTop = null; mEdgeGlowBottom = null; } super.setOverScrollMode(mode); } /** * {@inheritDoc} */ Loading Loading @@ -3772,7 +3765,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } private void invalidateTopGlow() { if (mEdgeGlowTop == null) { if (!shouldDisplayEdgeEffects()) { return; } final boolean clipToPadding = getClipToPadding(); Loading @@ -3783,7 +3776,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } private void invalidateBottomGlow() { if (mEdgeGlowBottom == null) { if (!shouldDisplayEdgeEffects()) { return; } final boolean clipToPadding = getClipToPadding(); Loading Loading @@ -4208,7 +4201,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te setPressed(false); if (mEdgeGlowTop != null) { if (shouldDisplayEdgeEffects()) { mEdgeGlowTop.onRelease(); mEdgeGlowBottom.onRelease(); } Loading @@ -4233,6 +4226,10 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } } private boolean shouldDisplayEdgeEffects() { return getOverScrollMode() != OVER_SCROLL_NEVER; } private void onTouchCancel() { switch (mTouchMode) { case TOUCH_MODE_OVERSCROLL: Loading @@ -4258,7 +4255,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te recycleVelocityTracker(); } if (mEdgeGlowTop != null) { if (shouldDisplayEdgeEffects()) { mEdgeGlowTop.onRelease(); mEdgeGlowBottom.onRelease(); } Loading Loading @@ -4379,7 +4376,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te @Override public void draw(Canvas canvas) { super.draw(canvas); if (mEdgeGlowTop != null) { if (shouldDisplayEdgeEffects()) { final int scrollY = mScrollY; final boolean clipToPadding = getClipToPadding(); final int width; Loading Loading @@ -6371,7 +6368,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } private void finishGlows() { if (mEdgeGlowTop != null) { if (shouldDisplayEdgeEffects()) { mEdgeGlowTop.finish(); mEdgeGlowBottom.finish(); } Loading Loading @@ -6477,6 +6474,76 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } } /** * Sets the edge effect color for both top and bottom edge effects. * * @param color The color for the edge effects. * @see #setTopEdgeEffectColor(int) * @see #setBottomEdgeEffectColor(int) * @see #getTopEdgeEffectColor() * @see #getBottomEdgeEffectColor() */ public void setEdgeEffectColor(@ColorInt int color) { setTopEdgeEffectColor(color); setBottomEdgeEffectColor(color); } /** * Sets the bottom edge effect color. * * @param color The color for the bottom edge effect. * @see #setTopEdgeEffectColor(int) * @see #setEdgeEffectColor(int) * @see #getTopEdgeEffectColor() * @see #getBottomEdgeEffectColor() */ public void setBottomEdgeEffectColor(@ColorInt int color) { mEdgeGlowBottom.setColor(color); invalidateBottomGlow(); } /** * Sets the top edge effect color. * * @param color The color for the top edge effect. * @see #setBottomEdgeEffectColor(int) * @see #setEdgeEffectColor(int) * @see #getTopEdgeEffectColor() * @see #getBottomEdgeEffectColor() */ public void setTopEdgeEffectColor(@ColorInt int color) { mEdgeGlowTop.setColor(color); invalidateTopGlow(); } /** * Returns the top edge effect color. * * @return The top edge effect color. * @see #setEdgeEffectColor(int) * @see #setTopEdgeEffectColor(int) * @see #setBottomEdgeEffectColor(int) * @see #getBottomEdgeEffectColor() */ @ColorInt public int getTopEdgeEffectColor() { return mEdgeGlowTop.getColor(); } /** * Returns the bottom edge effect color. * * @return The bottom edge effect color. * @see #setEdgeEffectColor(int) * @see #setTopEdgeEffectColor(int) * @see #setBottomEdgeEffectColor(int) * @see #getTopEdgeEffectColor() */ @ColorInt public int getBottomEdgeEffectColor() { return mEdgeGlowBottom.getColor(); } /** * Sets the recycler listener to be notified whenever a View is set aside in * the recycler for later reuse. This listener can be used to free resources Loading