[DESCRIPTION]
拖动歌曲计时条过程中,如何显示当前快进的时间
[SOLUTION]
在mediaplaybackactivity.java进行修改
private OnSeekBarChangeListener mSeekListener = new OnSeekBarChangeListener() {
。。。。。。。。
public void onProgressChanged(SeekBar bar, int progress, boolean fROMuser) {
if (!fromuser || (mService == null)) return;
//添加如下
/// M: only respond when progress bar don't change from tocuh {@
long now = SystemClock.elapsedRealtime();
if ((now - mLastSeekEventTime) > 250) {
mLastSeekEventTime = now;
mPosOverride = mDuration * progress / 1000;
try {
mService.seek(mPosOverride);
} catch (RemoteException ex) {
}
}
// trackball event, allow progress updates
//添加如上
if (!mFromTouch) {
mPosOverride = mDuration * progress / 1000;
try {
mService.seek(mPosOverride);
} catch (RemoteException ex) {
MusicLogUtils.e(TAG, "Error:" + ex);
}
/// @}
refreshNow();
mPosOverride = -1;
}
}
。。。。。。。。。。
拖动歌曲计时条过程中,如何显示当前快进的时间
[SOLUTION]
在mediaplaybackactivity.java进行修改
private OnSeekBarChangeListener mSeekListener = new OnSeekBarChangeListener() {
。。。。。。。。
public void onProgressChanged(SeekBar bar, int progress, boolean fROMuser) {
if (!fromuser || (mService == null)) return;
//添加如下
/// M: only respond when progress bar don't change from tocuh {@
long now = SystemClock.elapsedRealtime();
if ((now - mLastSeekEventTime) > 250) {
mLastSeekEventTime = now;
mPosOverride = mDuration * progress / 1000;
try {
mService.seek(mPosOverride);
} catch (RemoteException ex) {
}
}
// trackball event, allow progress updates
//添加如上
if (!mFromTouch) {
mPosOverride = mDuration * progress / 1000;
try {
mService.seek(mPosOverride);
} catch (RemoteException ex) {
MusicLogUtils.e(TAG, "Error:" + ex);
}
/// @}
refreshNow();
mPosOverride = -1;
}
}
。。。。。。。。。。
};
资料来源:一牛网论坛 MT6735 http://bbs.16rd.com/thread-454408-1-1.html