Merge "Stop the ringtone when other seek bar is adjust"
This commit is contained in:
committed by
Android (Google) Code Review
commit
74e3692ab9
@@ -204,10 +204,6 @@ public class SoundSettings extends DashboardFragment implements OnActivityResult
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSampleStarting(SeekBarVolumizer sbv) {
|
public void onSampleStarting(SeekBarVolumizer sbv) {
|
||||||
if (mCurrent != null && mCurrent != sbv) {
|
|
||||||
mCurrent.stopSample();
|
|
||||||
}
|
|
||||||
mCurrent = sbv;
|
|
||||||
if (mCurrent != null) {
|
if (mCurrent != null) {
|
||||||
mHandler.removeMessages(STOP_SAMPLE);
|
mHandler.removeMessages(STOP_SAMPLE);
|
||||||
mHandler.sendEmptyMessageDelayed(STOP_SAMPLE, SAMPLE_CUTOFF);
|
mHandler.sendEmptyMessageDelayed(STOP_SAMPLE, SAMPLE_CUTOFF);
|
||||||
@@ -222,6 +218,15 @@ public class SoundSettings extends DashboardFragment implements OnActivityResult
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStartTrackingTouch(SeekBarVolumizer sbv) {
|
||||||
|
// stop the ringtone when other seek bar is adjust
|
||||||
|
if (mCurrent != null && mCurrent != sbv) {
|
||||||
|
mCurrent.stopSample();
|
||||||
|
}
|
||||||
|
mCurrent = sbv;
|
||||||
|
}
|
||||||
|
|
||||||
public void stopSample() {
|
public void stopSample() {
|
||||||
if (mCurrent != null) {
|
if (mCurrent != null) {
|
||||||
mCurrent.stopSample();
|
mCurrent.stopSample();
|
||||||
|
@@ -138,6 +138,12 @@ public class VolumeSeekBarPreference extends SeekBarPreference {
|
|||||||
mZenMuted = zenMuted;
|
mZenMuted = zenMuted;
|
||||||
updateIconView();
|
updateIconView();
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public void onStartTrackingTouch(SeekBarVolumizer sbv) {
|
||||||
|
if (mCallback != null) {
|
||||||
|
mCallback.onStartTrackingTouch(sbv);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
final Uri sampleUri = mStream == AudioManager.STREAM_MUSIC ? getMediaVolumeUri() : null;
|
final Uri sampleUri = mStream == AudioManager.STREAM_MUSIC ? getMediaVolumeUri() : null;
|
||||||
if (mVolumizer == null) {
|
if (mVolumizer == null) {
|
||||||
@@ -201,5 +207,10 @@ public class VolumeSeekBarPreference extends SeekBarPreference {
|
|||||||
public interface Callback {
|
public interface Callback {
|
||||||
void onSampleStarting(SeekBarVolumizer sbv);
|
void onSampleStarting(SeekBarVolumizer sbv);
|
||||||
void onStreamValueChanged(int stream, int progress);
|
void onStreamValueChanged(int stream, int progress);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback reporting that the seek bar is start tracking.
|
||||||
|
*/
|
||||||
|
void onStartTrackingTouch(SeekBarVolumizer sbv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user