diff --git a/src/gui/widget/adapter.cc b/src/gui/widget/adapter.cc index 44999d5c..5be6993b 100755 --- a/src/gui/widget/adapter.cc +++ b/src/gui/widget/adapter.cc @@ -59,6 +59,16 @@ bool Adapter::isEmpty()const{ } /////////////////////////////////////////////////////////////////////////////////////////////// +PagerAdapter::PagerAdapter(){ + mViewPagerObserver = nullptr; +} + +PagerAdapter::~PagerAdapter(){ +} + +int PagerAdapter::getCount(){ + return 0; +} void PagerAdapter::startUpdate(ViewGroup* container){ } diff --git a/src/gui/widget/adapter.h b/src/gui/widget/adapter.h index b493c611..357f0e13 100755 --- a/src/gui/widget/adapter.h +++ b/src/gui/widget/adapter.h @@ -134,7 +134,9 @@ public: static constexpr int POSITION_UNCHANGED =-1; static constexpr int POSITION_NONE = -2; public: - virtual int getCount(){return 0;} + PagerAdapter(); + virtual ~PagerAdapter(); + virtual int getCount(); virtual void startUpdate(ViewGroup* container); virtual void*instantiateItem(ViewGroup* container, int position); virtual void destroyItem(ViewGroup* container, int position, void* object); diff --git a/src/gui/widget/scrollview.cc b/src/gui/widget/scrollview.cc index 5dfe0030..1a0e3d1e 100644 --- a/src/gui/widget/scrollview.cc +++ b/src/gui/widget/scrollview.cc @@ -16,6 +16,10 @@ ScrollView::ScrollView(Context*ctx,const AttributeSet&atts) initScrollView(); } +ScrollView::~ScrollView(){ + delete mScroller; +} + float ScrollView::getTopFadingEdgeStrength() { if (getChildCount() == 0) { return 0.0f; @@ -53,8 +57,8 @@ void ScrollView::initScrollView() { setFocusable(true); setDescendantFocusability(FOCUS_AFTER_DESCENDANTS); setWillNotDraw(false); - mFillViewport=false; - mVelocityTracker =nullptr; + mFillViewport = false; + mVelocityTracker = nullptr; mEdgeGlowTop = mEdgeGlowBottom =nullptr; ViewConfiguration& configuration = ViewConfiguration::get(mContext); mTouchSlop = configuration.getScaledTouchSlop(); diff --git a/src/gui/widget/scrollview.h b/src/gui/widget/scrollview.h index 738517eb..c0fa20e6 100644 --- a/src/gui/widget/scrollview.h +++ b/src/gui/widget/scrollview.h @@ -74,6 +74,7 @@ protected: public: ScrollView(int w,int h); ScrollView(Context*ctx,const AttributeSet&atts); + ~ScrollView()override; int getMaxScrollAmount(); View& addView(View* child)override; View& addView(View* child, int index)override;