android.widget.SeekBar#getTag ( )源码实例Demo

下面列出了android.widget.SeekBar#getTag ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: Noyze   文件: VolumePanel.java
/**
 * Notification that the user has finished a touch gesture. Clients may want to use this
 * to re-enable advancing the seekbar. 
 */
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
	final Object tag = seekBar.getTag();
       if (tag instanceof StreamResources) {
           StreamResources sr = (StreamResources) tag;
           // because remote volume updates are asynchronous, AudioService might have received
           // a new remote volume value since the finger adjusted the slider. So when the
           // progress of the slider isn't being tracked anymore, adjust the slider to the last
           // "published" remote volume value, so the UI reflects the actual volume.
           if (sr.getStreamType() == STREAM_REMOTE_MUSIC) {
               seekBar.setProgress(getStreamVolume(STREAM_REMOTE_MUSIC));
           }
       }
       onUserInteraction();
}
 
源代码2 项目: Noyze   文件: EqualizerVolumePanel.java
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
    if (!fromUser) return;
    if (isVirtualizerSupported() && seekBar.getId() == R.id.virtualizer) {
        virtualizer.setStrength((short) progress);
        LOGI(virtualizer.getClass().getSimpleName(), "setStrength(" + progress + ')');
    } else if (isBassBostSupported() && seekBar.getId() == R.id.bass_boost) {
        bassBoost.setStrength((short) progress);
        LOGI(bassBoost.getClass().getSimpleName(), "setStrength(" + progress + ')');
    } else if (null != equalizer) {
        Object tag = seekBar.getTag();
        if (tag instanceof Short) {
            short band = (Short) tag;
            equalizer.setBandLevel(band, (short) (progress + range[0]));
            LOGI(equalizer.getClass().getSimpleName(), "setBandLevel(" + (progress + range[0]) + ')');
        }
    }
    onUserInteraction();
}
 
源代码3 项目: Noyze   文件: VolumePanel.java
/**
 * Notification that the user has finished a touch gesture. Clients may want to use this
 * to re-enable advancing the seekbar. 
 */
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
	final Object tag = seekBar.getTag();
       if (tag instanceof StreamResources) {
           StreamResources sr = (StreamResources) tag;
           // because remote volume updates are asynchronous, AudioService might have received
           // a new remote volume value since the finger adjusted the slider. So when the
           // progress of the slider isn't being tracked anymore, adjust the slider to the last
           // "published" remote volume value, so the UI reflects the actual volume.
           if (sr.getStreamType() == STREAM_REMOTE_MUSIC) {
               seekBar.setProgress(getStreamVolume(STREAM_REMOTE_MUSIC));
           }
       }
       onUserInteraction();
}
 
源代码4 项目: Noyze   文件: EqualizerVolumePanel.java
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
    if (!fromUser) return;
    if (isVirtualizerSupported() && seekBar.getId() == R.id.virtualizer) {
        virtualizer.setStrength((short) progress);
        LOGI(virtualizer.getClass().getSimpleName(), "setStrength(" + progress + ')');
    } else if (isBassBostSupported() && seekBar.getId() == R.id.bass_boost) {
        bassBoost.setStrength((short) progress);
        LOGI(bassBoost.getClass().getSimpleName(), "setStrength(" + progress + ')');
    } else if (null != equalizer) {
        Object tag = seekBar.getTag();
        if (tag instanceof Short) {
            short band = (Short) tag;
            equalizer.setBandLevel(band, (short) (progress + range[0]));
            LOGI(equalizer.getClass().getSimpleName(), "setBandLevel(" + (progress + range[0]) + ')');
        }
    }
    onUserInteraction();
}
 
源代码5 项目: Noyze   文件: ParanoidVolumePanel.java
@Override public void onProgressChanged(SeekBar seekBar, int progress,
                              boolean fromUser) {
    final Object tag = seekBar.getTag();
    if (fromUser && tag instanceof StreamControl) {
        StreamControl sc = (StreamControl) tag;
        if (getStreamVolume(sc.streamType) != progress) {
            LOGI(TAG, "setStreamVolume(" + sc.streamType + ", " + progress + ')');
            setStreamVolume(sc.streamType, progress);
        }
    }
    onUserInteraction();
}
 
源代码6 项目: Noyze   文件: ParanoidVolumePanel.java
@Override public void onStopTrackingTouch(SeekBar seekBar) {
    final Object tag = seekBar.getTag();
    if (tag instanceof StreamControl) {
        StreamControl sc = (StreamControl) tag;
        // because remote volume updates are asynchronous, AudioService might have received
        // a new remote volume value since the finger adjusted the slider. So when the
        // progress of the slider isn't being tracked anymore, adjust the slider to the last
        // "published" remote volume value, so the UI reflects the actual volume.
        if (sc.streamType == STREAM_REMOTE_MUSIC) {
            seekBar.setProgress(getStreamVolume(STREAM_REMOTE_MUSIC));
        }
    }
}
 
源代码7 项目: Noyze   文件: VolumePanel.java
/**
 * Notification that the progress level has changed. Clients can use the fromUser parameter
 * to distinguish user-initiated changes from those that occurred programmatically.
 */
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
       LOGD("VolumePanel", "onProgressChanged(" + progress + ")");
	final Object tag = seekBar.getTag();
       if (fromUser && tag instanceof StreamResources) {
           StreamResources sr = (StreamResources) tag;
           if (getStreamVolume(sr.getStreamType()) != progress) {
               setStreamVolume(sr.getStreamType(), progress);
               mVolumeDirty = true;
           }
       }
       onUserInteraction();
}
 
源代码8 项目: Noyze   文件: ParanoidVolumePanel.java
@Override public void onProgressChanged(SeekBar seekBar, int progress,
                              boolean fromUser) {
    final Object tag = seekBar.getTag();
    if (fromUser && tag instanceof StreamControl) {
        StreamControl sc = (StreamControl) tag;
        if (getStreamVolume(sc.streamType) != progress) {
            LOGI(TAG, "setStreamVolume(" + sc.streamType + ", " + progress + ')');
            setStreamVolume(sc.streamType, progress);
        }
    }
    onUserInteraction();
}
 
源代码9 项目: Noyze   文件: ParanoidVolumePanel.java
@Override public void onStopTrackingTouch(SeekBar seekBar) {
    final Object tag = seekBar.getTag();
    if (tag instanceof StreamControl) {
        StreamControl sc = (StreamControl) tag;
        // because remote volume updates are asynchronous, AudioService might have received
        // a new remote volume value since the finger adjusted the slider. So when the
        // progress of the slider isn't being tracked anymore, adjust the slider to the last
        // "published" remote volume value, so the UI reflects the actual volume.
        if (sc.streamType == STREAM_REMOTE_MUSIC) {
            seekBar.setProgress(getStreamVolume(STREAM_REMOTE_MUSIC));
        }
    }
}
 
源代码10 项目: Noyze   文件: VolumePanel.java
/**
 * Notification that the progress level has changed. Clients can use the fromUser parameter
 * to distinguish user-initiated changes from those that occurred programmatically.
 */
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
       LOGD("VolumePanel", "onProgressChanged(" + progress + ")");
	final Object tag = seekBar.getTag();
       if (fromUser && tag instanceof StreamResources) {
           StreamResources sr = (StreamResources) tag;
           if (getStreamVolume(sr.getStreamType()) != progress) {
               setStreamVolume(sr.getStreamType(), progress);
               mVolumeDirty = true;
           }
       }
       onUserInteraction();
}