下面列出了怎么用android.view.ViewDebug.ExportedProperty的API类实例代码及写法,或者点击链接到github查看源代码。
@ExportedProperty
public View getSelectedView() {
if (this.mItemCount <= 0 || this.mSelectedPosition < 0) {
return null;
}
return getChildAt(this.mSelectedPosition - this.mFirstPosition);
}
@Override
@ExportedProperty(category = "accessibility")
public CharSequence getContentDescription() {
// IMPLEMENTATION NOTE: On ICS and above, when content description of this View is null,
// TalkBack traverses all children of this View to compose the text to speak. We want to provide
// custom text to be spoken when this View is selected by the user. Thus, we return the custom
// text here instead of returning null (which is the default behavior).
return getTalkBackText();
}
@ExportedProperty(category = "list")
protected boolean recycleOnMeasure() {
return true;
}
@ExportedProperty
public boolean isSmoothScrollbarEnabled() {
return this.mSmoothScrollbarEnabled;
}
@ExportedProperty
public boolean isScrollingCacheEnabled() {
return this.mScrollingCacheEnabled;
}
@ExportedProperty(category = "drawing")
public int getCacheColorHint() {
return this.mCacheColorHint;
}
@Override
@ExportedProperty(category = "focus")
public boolean isFocused() {
return super.isFocused();// return true一定有焦点
}
@Override
@ExportedProperty(category = "focus")
public boolean isFocused() {
// TODO Auto-generated method stub
return true;
}