mt6735 拖动歌曲计时条过程中,如何显示当前快进的时间
时间:10-02
整理:3721RD
点击:
[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 touch {@
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 touch {@
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;
}
}
。
};