mirror of
https://gitee.com/houstudio/Cdroid.git
synced 2024-11-30 03:08:12 +08:00
add ~PagerAdapter ~ScrollView
This commit is contained in:
parent
61b8af9476
commit
ac140b601a
@ -59,6 +59,16 @@ bool Adapter::isEmpty()const{
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
PagerAdapter::PagerAdapter(){
|
||||
mViewPagerObserver = nullptr;
|
||||
}
|
||||
|
||||
PagerAdapter::~PagerAdapter(){
|
||||
}
|
||||
|
||||
int PagerAdapter::getCount(){
|
||||
return 0;
|
||||
}
|
||||
|
||||
void PagerAdapter::startUpdate(ViewGroup* container){
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user