mirror of
https://gitee.com/houstudio/Cdroid.git
synced 2024-12-02 20:28:11 +08:00
fix seekbar's seek operation
This commit is contained in:
parent
ab0e29ef33
commit
1a4a06c634
@ -11,6 +11,7 @@ void TimeAnimator::start(){
|
||||
mPreviousTime = -1;
|
||||
ValueAnimator::start();
|
||||
}
|
||||
|
||||
bool TimeAnimator::animateBasedOnTime(long currentTime){
|
||||
if(mListener != nullptr){
|
||||
long totalTime = currentTime - mStartTime;
|
||||
@ -18,6 +19,7 @@ bool TimeAnimator::animateBasedOnTime(long currentTime){
|
||||
mPreviousTime = currentTime;
|
||||
mListener(*this,totalTime,detaTime);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void TimeAnimator::setCurrentPlayTime(long playTime){
|
||||
|
@ -355,8 +355,6 @@ int TouchDevice::putRawEvent(const struct timeval&tv,int type,int code,int value
|
||||
case SYN_REPORT:
|
||||
case SYN_MT_REPORT:
|
||||
mMoveTime =(tv.tv_sec*1000000+tv.tv_usec);
|
||||
LOGV("%s pos=%.f,%.f",MotionEvent::actionToString(mEvent.getAction()).c_str(),
|
||||
mPointMAP.begin()->second.coord.getX(),mPointMAP.begin()->second.coord.getY() );
|
||||
mEvent.initialize(getId(),getSource(),mEvent.getAction(),mEvent.getActionButton(),
|
||||
0/*flags*/, 0/*edgeFlags*/, 0/*metaState*/, mEvent.getButtonState() ,
|
||||
0/*xOffset*/,0/*yOffset*/ , 0/*xPrecision*/, 0/*yPrecision*/ ,
|
||||
@ -364,6 +362,8 @@ int TouchDevice::putRawEvent(const struct timeval&tv,int type,int code,int value
|
||||
for(auto p:mPointMAP){
|
||||
mEvent.addSample(mMoveTime,p.second.prop,p.second.coord);
|
||||
}
|
||||
LOGV_IF(mEvent.getAction()==MotionEvent::ACTION_UP,"%s pos=%.f,%.f",MotionEvent::actionToString(mEvent.getAction()).c_str(),
|
||||
mPointMAP.begin()->second.coord.getX(),mEvent.getX(),mEvent.getY());
|
||||
if(listener)listener(mEvent);
|
||||
if(mEvent.getAction()==MotionEvent::ACTION_UP)
|
||||
mPointMAP.clear();
|
||||
|
@ -67,7 +67,6 @@ ProgressBar::ProgressBar(int width, int height):View(width,height){
|
||||
indeterminatePos=0;
|
||||
mHasAnimation=false;
|
||||
mAttached=false;
|
||||
mRefreshIsPosted=false;
|
||||
mShouldStartAnimationDrawable=false;
|
||||
setProgressDrawable(mContext->getDrawable("cdroid:drawable/progress_horizontal.xml"));
|
||||
}
|
||||
@ -353,21 +352,7 @@ void ProgressBar::refreshProgress(int id, int progress, bool fromUser,bool anima
|
||||
rd.progress=progress;
|
||||
rd.fromUser=fromUser;
|
||||
rd.animate=animate;
|
||||
//doRefreshProgress(id, progress, fromUser, true, animate);
|
||||
//return ;
|
||||
if(!mRefreshIsPosted){
|
||||
if(mAttached&&!mRefreshIsPosted){
|
||||
mRefreshProgressRunnable =[this](){
|
||||
for(auto d:mDatas){
|
||||
RefreshData&rd=d.second;
|
||||
doRefreshProgress(d.first,rd.progress, rd.fromUser, true, rd.animate);
|
||||
}
|
||||
mRefreshIsPosted=false;
|
||||
};
|
||||
post(mRefreshProgressRunnable);
|
||||
mRefreshIsPosted=true;
|
||||
}
|
||||
}
|
||||
doRefreshProgress(id, progress, fromUser, true, animate);
|
||||
}
|
||||
|
||||
bool ProgressBar::setProgressInternal(int value, bool fromUser,bool animate){
|
||||
|
Loading…
Reference in New Issue
Block a user