mirror of
https://gitee.com/houstudio/Cdroid.git
synced 2024-12-02 04:07:42 +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){
|
void PagerAdapter::startUpdate(ViewGroup* container){
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,9 @@ public:
|
|||||||
static constexpr int POSITION_UNCHANGED =-1;
|
static constexpr int POSITION_UNCHANGED =-1;
|
||||||
static constexpr int POSITION_NONE = -2;
|
static constexpr int POSITION_NONE = -2;
|
||||||
public:
|
public:
|
||||||
virtual int getCount(){return 0;}
|
PagerAdapter();
|
||||||
|
virtual ~PagerAdapter();
|
||||||
|
virtual int getCount();
|
||||||
virtual void startUpdate(ViewGroup* container);
|
virtual void startUpdate(ViewGroup* container);
|
||||||
virtual void*instantiateItem(ViewGroup* container, int position);
|
virtual void*instantiateItem(ViewGroup* container, int position);
|
||||||
virtual void destroyItem(ViewGroup* container, int position, void* object);
|
virtual void destroyItem(ViewGroup* container, int position, void* object);
|
||||||
|
@ -16,6 +16,10 @@ ScrollView::ScrollView(Context*ctx,const AttributeSet&atts)
|
|||||||
initScrollView();
|
initScrollView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ScrollView::~ScrollView(){
|
||||||
|
delete mScroller;
|
||||||
|
}
|
||||||
|
|
||||||
float ScrollView::getTopFadingEdgeStrength() {
|
float ScrollView::getTopFadingEdgeStrength() {
|
||||||
if (getChildCount() == 0) {
|
if (getChildCount() == 0) {
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
@ -53,8 +57,8 @@ void ScrollView::initScrollView() {
|
|||||||
setFocusable(true);
|
setFocusable(true);
|
||||||
setDescendantFocusability(FOCUS_AFTER_DESCENDANTS);
|
setDescendantFocusability(FOCUS_AFTER_DESCENDANTS);
|
||||||
setWillNotDraw(false);
|
setWillNotDraw(false);
|
||||||
mFillViewport=false;
|
mFillViewport = false;
|
||||||
mVelocityTracker =nullptr;
|
mVelocityTracker = nullptr;
|
||||||
mEdgeGlowTop = mEdgeGlowBottom =nullptr;
|
mEdgeGlowTop = mEdgeGlowBottom =nullptr;
|
||||||
ViewConfiguration& configuration = ViewConfiguration::get(mContext);
|
ViewConfiguration& configuration = ViewConfiguration::get(mContext);
|
||||||
mTouchSlop = configuration.getScaledTouchSlop();
|
mTouchSlop = configuration.getScaledTouchSlop();
|
||||||
|
@ -74,6 +74,7 @@ protected:
|
|||||||
public:
|
public:
|
||||||
ScrollView(int w,int h);
|
ScrollView(int w,int h);
|
||||||
ScrollView(Context*ctx,const AttributeSet&atts);
|
ScrollView(Context*ctx,const AttributeSet&atts);
|
||||||
|
~ScrollView()override;
|
||||||
int getMaxScrollAmount();
|
int getMaxScrollAmount();
|
||||||
View& addView(View* child)override;
|
View& addView(View* child)override;
|
||||||
View& addView(View* child, int index)override;
|
View& addView(View* child, int index)override;
|
||||||
|
Loading…
Reference in New Issue
Block a user