mOrientationHelper's destroing moved to linearlayoutmanager

This commit is contained in:
侯歌 2024-06-11 10:41:28 +08:00
parent f817d973e3
commit 594d543239
2 changed files with 2 additions and 8 deletions

View File

@ -134,9 +134,7 @@ int LinearLayoutManager::getOrientation()const {
}
void LinearLayoutManager::setOrientation(int orientation) {
if (orientation != HORIZONTAL && orientation != VERTICAL) {
FATAL("invalid orientation:%d",orientation);
}
FATAL_IF( (orientation != HORIZONTAL)&&(orientation != VERTICAL),"invalid orientation:%d",orientation);
assertNotInLayoutOrScroll("");
@ -1653,13 +1651,10 @@ void LinearLayoutManager::SavedState::writeToParcel(Parcel& dest, int flags) {
LinearLayoutManager::AnchorInfo::AnchorInfo() {
mOrientationHelper = nullptr;
/*mOrientationHelper is owned/destroied by LinearLayoutManager*/
reset();
}
LinearLayoutManager::AnchorInfo::~AnchorInfo(){
delete mOrientationHelper;
}
void LinearLayoutManager::AnchorInfo::reset() {
mPosition = RecyclerView::NO_POSITION;
mCoordinate = INVALID_OFFSET;

View File

@ -224,7 +224,6 @@ protected:
bool mValid;
protected:
AnchorInfo();
virtual ~AnchorInfo();
void reset();
void assignCoordinateFromPadding();
bool isViewValidAsAnchor(View* child, RecyclerView::State& state);