diff options
| author | TreeHugger Robot <treehugger-gerrit@google.com> | 2021-02-24 16:32:07 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-02-24 16:32:07 +0000 |
| commit | e4c9e20df0f334b2b9d9ba6814009f0c9ddad95d (patch) | |
| tree | db34a2893deace4a9f30bf1bb00c2dc1422060b7 /core/java | |
| parent | baba083691f269e9b32d3916d371ffa863bf1a5c (diff) | |
| parent | 7954a1afaab35b9e385f4616fbd9b499616c5c22 (diff) | |
Merge "Add edge effect type accessors for views that support it" into sc-dev
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/widget/AbsListView.java | 21 | ||||
| -rw-r--r-- | core/java/android/widget/HorizontalScrollView.java | 21 | ||||
| -rw-r--r-- | core/java/android/widget/ScrollView.java | 21 |
3 files changed, 63 insertions, 0 deletions
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index 05b177ebbb45..39c09b46f2e1 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -6612,6 +6612,27 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } /** + * Returns the {@link EdgeEffect#getType()} for the edge effects. + * @return the {@link EdgeEffect#getType()} for the edge effects. + * @attr ref android.R.styleable#EdgeEffect_edgeEffectType + */ + @EdgeEffect.EdgeEffectType + public int getEdgeEffectType() { + return mEdgeGlowTop.getType(); + } + + /** + * Sets the {@link EdgeEffect#setType(int)} for the edge effects. + * @param type The edge effect type to use for the edge effects. + * @attr ref android.R.styleable#EdgeEffect_edgeEffectType + */ + public void setEdgeEffectType(@EdgeEffect.EdgeEffectType int type) { + mEdgeGlowTop.setType(type); + mEdgeGlowBottom.setType(type); + invalidate(); + } + + /** * 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 * associated to the View. diff --git a/core/java/android/widget/HorizontalScrollView.java b/core/java/android/widget/HorizontalScrollView.java index 6dedd12a2730..23915e06335a 100644 --- a/core/java/android/widget/HorizontalScrollView.java +++ b/core/java/android/widget/HorizontalScrollView.java @@ -303,6 +303,27 @@ public class HorizontalScrollView extends FrameLayout { } /** + * Returns the {@link EdgeEffect#getType()} for the edge effects. + * @return the {@link EdgeEffect#getType()} for the edge effects. + * @attr ref android.R.styleable#EdgeEffect_edgeEffectType + */ + @EdgeEffect.EdgeEffectType + public int getEdgeEffectType() { + return mEdgeGlowLeft.getType(); + } + + /** + * Sets the {@link EdgeEffect#setType(int)} for the edge effects. + * @param type The edge effect type to use for the edge effects. + * @attr ref android.R.styleable#EdgeEffect_edgeEffectType + */ + public void setEdgeEffectType(@EdgeEffect.EdgeEffectType int type) { + mEdgeGlowRight.setType(type); + mEdgeGlowLeft.setType(type); + invalidate(); + } + + /** * @return The maximum amount this scroll view will scroll in response to * an arrow event. */ diff --git a/core/java/android/widget/ScrollView.java b/core/java/android/widget/ScrollView.java index 64d09de49f2d..65f3da79afe0 100644 --- a/core/java/android/widget/ScrollView.java +++ b/core/java/android/widget/ScrollView.java @@ -335,6 +335,27 @@ public class ScrollView extends FrameLayout { } /** + * Returns the {@link EdgeEffect#getType()} for the edge effects. + * @return the {@link EdgeEffect#getType()} for the edge effects. + * @attr ref android.R.styleable#EdgeEffect_edgeEffectType + */ + @EdgeEffect.EdgeEffectType + public int getEdgeEffectType() { + return mEdgeGlowTop.getType(); + } + + /** + * Sets the {@link EdgeEffect#setType(int)} for the edge effects. + * @param type The edge effect type to use for the edge effects. + * @attr ref android.R.styleable#EdgeEffect_edgeEffectType + */ + public void setEdgeEffectType(@EdgeEffect.EdgeEffectType int type) { + mEdgeGlowTop.setType(type); + mEdgeGlowBottom.setType(type); + invalidate(); + } + + /** * @return The maximum amount this scroll view will scroll in response to * an arrow event. */ |
