mirror of
https://gitee.com/houstudio/Cdroid.git
synced 2024-12-02 04:07:42 +08:00
fix uieventsource.removeCallbacks
This commit is contained in:
parent
ff8b5953ef
commit
61b8af9476
@ -76,14 +76,15 @@ bool UIEventSource::hasDelayedRunners()const{
|
||||
return runner.time<nowms;
|
||||
}
|
||||
|
||||
bool UIEventSource::removeCallbacks(const Runnable& what){
|
||||
int UIEventSource::removeCallbacks(const Runnable& what){
|
||||
int count=0;
|
||||
for(auto it=mRunnables.begin();it!=mRunnables.end();it++){
|
||||
if(it->run==what){
|
||||
if((it->run==what)&&(it->removed==false)){
|
||||
it->removed=true;
|
||||
return true;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return count;
|
||||
}
|
||||
|
||||
}//end namespace
|
||||
|
@ -24,7 +24,7 @@ public:
|
||||
int checkEvents()override;
|
||||
int handleEvents()override;
|
||||
bool postDelayed(Runnable& run,uint32_t delay=0);
|
||||
bool removeCallbacks(const Runnable& what);
|
||||
int removeCallbacks(const Runnable& what);
|
||||
};
|
||||
|
||||
}//end namespace
|
||||
|
@ -141,7 +141,7 @@ public:
|
||||
}
|
||||
void run(){
|
||||
long now = AnimationUtils::currentAnimationTimeMillis();
|
||||
if (now >= fadeStartTime) {
|
||||
if (host && (now >= fadeStartTime)) {
|
||||
// the animation fades the scrollbars out by changing
|
||||
// the opacity (alpha) from fully opaque to fully
|
||||
// transparent
|
||||
@ -1323,8 +1323,10 @@ void View::dispatchDetachedFromWindow(){
|
||||
conts.erase(it);
|
||||
mPrivateFlags &= ~PFLAG_SCROLL_CONTAINER_ADDED;
|
||||
}
|
||||
if(mScrollCache&&mScrollCache->mRunner)
|
||||
if(mScrollCache&&mScrollCache->mRunner){
|
||||
removeCallbacks(mScrollCache->mRunner);
|
||||
mScrollCache->mRunner.reset();
|
||||
}
|
||||
mAttachInfo = nullptr;
|
||||
if(mOverlay)
|
||||
mOverlay->getOverlayView()->dispatchDetachedFromWindow();
|
||||
|
@ -586,7 +586,7 @@ void ViewPager::populate(int newCurrentItem){
|
||||
if (pos == ii->position && !ii->scrolling) {
|
||||
mItems.erase(mItems.begin()+itemIndex);
|
||||
mAdapter->destroyItem(this, pos, ii->object);
|
||||
LOGD("destroyItem() with pos:%d/%d view:%p curitem=%d/%d",pos,ii->position,ii->object,mCurItem,mItems.size());
|
||||
LOGV("destroyItem() with pos:%d/%d view:%p curitem=%d/%d",pos,ii->position,ii->object,mCurItem,mItems.size());
|
||||
delete ii;
|
||||
itemIndex--;
|
||||
curIndex--;
|
||||
|
Loading…
Reference in New Issue
Block a user