make recyclerview._DEBUG =false

This commit is contained in:
houzh 2024-02-22 22:50:43 +08:00
parent d9db96bf3c
commit e3e1d15a60
2 changed files with 5 additions and 4 deletions

View File

@ -2715,7 +2715,7 @@ void RecyclerView::onLayout(bool changed, int l, int t, int w, int h) {
} }
void RecyclerView::requestLayout() { void RecyclerView::requestLayout() {
if (mInterceptRequestLayoutDepth == 0 && !mLayoutFrozen) { if ((mInterceptRequestLayoutDepth == 0) && !mLayoutFrozen) {
ViewGroup::requestLayout(); ViewGroup::requestLayout();
} else { } else {
mLayoutWasDefered = true; mLayoutWasDefered = true;
@ -3395,6 +3395,7 @@ void RecyclerView::ViewFlinger::fling(int velocityX, int velocityY) {
mLastFlingX = mLastFlingY = 0; mLastFlingX = mLastFlingY = 0;
mScroller->fling(0, 0, velocityX, velocityY, INT_MIN, INT_MAX, INT_MIN, INT_MAX); mScroller->fling(0, 0, velocityX, velocityY, INT_MIN, INT_MAX, INT_MIN, INT_MAX);
postOnAnimation(); postOnAnimation();
LOGD("velocityxy=%d,%d",velocityX,velocityY);
} }
void RecyclerView::ViewFlinger::smoothScrollBy(int dx, int dy) { void RecyclerView::ViewFlinger::smoothScrollBy(int dx, int dy) {
@ -3450,12 +3451,12 @@ void RecyclerView::ViewFlinger::smoothScrollBy(int dx, int dy, int duration, Int
mRV->setScrollState(SCROLL_STATE_SETTLING); mRV->setScrollState(SCROLL_STATE_SETTLING);
mLastFlingX = mLastFlingY = 0; mLastFlingX = mLastFlingY = 0;
mScroller->startScroll(0, 0, dx, dy, duration); mScroller->startScroll(0, 0, dx, dy, duration);
if (Build.VERSION.SDK_INT < 23) {/*<Android 6*/ /*if (Build.VERSION.SDK_INT < 23) {//Android 6
// b/64931938 before API 23, startScroll() does not reset getCurX()/getCurY() // b/64931938 before API 23, startScroll() does not reset getCurX()/getCurY()
// to start values, which causes fillRemainingScrollValues() put in obsolete values // to start values, which causes fillRemainingScrollValues() put in obsolete values
// for LayoutManager.onLayoutChildren(). // for LayoutManager.onLayoutChildren().
mScroller->computeScrollOffset(); mScroller->computeScrollOffset();
} }*/
postOnAnimation(); postOnAnimation();
} }

View File

@ -17,7 +17,7 @@ typedef void* Bundle;
class RecyclerView:public ViewGroup{ class RecyclerView:public ViewGroup{
private: private:
static constexpr bool _DEBUG=true; static constexpr bool _DEBUG=false;
public: public:
class SmoothScroller; class SmoothScroller;
class FastScroller; class FastScroller;