Merge "Expose public API to control mIsChildViewEnabled"

This commit is contained in:
Alexandre Elias
2022-01-19 03:17:56 +00:00
committed by Android (Google) Code Review
2 changed files with 23 additions and 0 deletions

View File

@@ -55251,6 +55251,7 @@ package android.widget {
method protected boolean isInFilterMode();
method public boolean isItemChecked(int);
method public boolean isScrollingCacheEnabled();
method public boolean isSelectedChildViewEnabled();
method public boolean isSmoothScrollbarEnabled();
method public boolean isStackFromBottom();
method public boolean isTextFilterEnabled();
@@ -55286,6 +55287,7 @@ package android.widget {
method public void setRemoteViewsAdapter(android.content.Intent);
method public void setScrollIndicators(android.view.View, android.view.View);
method public void setScrollingCacheEnabled(boolean);
method public void setSelectedChildViewEnabled(boolean);
method public void setSelectionFromTop(int, int);
method public void setSelector(@DrawableRes int);
method public void setSelector(android.graphics.drawable.Drawable);

View File

@@ -2656,6 +2656,27 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
}
}
/**
* Returns whether the selected child view (from the adapter's getView) is enabled.
*
* @return true if enabled
*/
public boolean isSelectedChildViewEnabled() {
return mIsChildViewEnabled;
}
/**
* Set whether the selected child view (from the adapter's getView) is enabled.
*
* When refreshDrawableState is called, AbsListView will control the "enabled" state
* of the selector based on this.
*
* @param selectedChildViewEnabled true if enabled
*/
public void setSelectedChildViewEnabled(boolean selectedChildViewEnabled) {
mIsChildViewEnabled = selectedChildViewEnabled;
}
@Override
protected void dispatchDraw(Canvas canvas) {
int saveCount = 0;