本文整理汇总了Java中android.support.v4.media.VolumeProviderCompat类的典型用法代码示例。如果您正苦于以下问题:Java VolumeProviderCompat类的具体用法?Java VolumeProviderCompat怎么用?Java VolumeProviderCompat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VolumeProviderCompat类属于android.support.v4.media包,在下文中一共展示了VolumeProviderCompat类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getVolumeAttributes
import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
public ParcelableVolumeInfo getVolumeAttributes() {
int volumeType;
int stream;
int controlType;
int max;
int current;
synchronized (MediaSessionImplBase.this.mLock) {
volumeType = MediaSessionImplBase.this.mVolumeType;
stream = MediaSessionImplBase.this.mLocalStream;
VolumeProviderCompat vp = MediaSessionImplBase.this.mVolumeProvider;
if (volumeType == 2) {
controlType = vp.getVolumeControl();
max = vp.getMaxVolume();
current = vp.getCurrentVolume();
} else {
controlType = 2;
max = MediaSessionImplBase.this.mAudioManager.getStreamMaxVolume(stream);
current = MediaSessionImplBase.this.mAudioManager.getStreamVolume(stream);
}
}
return new ParcelableVolumeInfo(volumeType, stream, controlType, max, current);
}
开发者ID:JackChan1999,项目名称:letv,代码行数:23,代码来源:MediaSessionCompat.java
示例2: updatePlaybackInfoFromSelectedRoute
import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
private void updatePlaybackInfoFromSelectedRoute() {
if (mSelectedRoute != null) {
mPlaybackInfo.volume = mSelectedRoute.getVolume();
mPlaybackInfo.volumeMax = mSelectedRoute.getVolumeMax();
mPlaybackInfo.volumeHandling = mSelectedRoute.getVolumeHandling();
mPlaybackInfo.playbackStream = mSelectedRoute.getPlaybackStream();
mPlaybackInfo.playbackType = mSelectedRoute.getPlaybackType();
final int count = mRemoteControlClients.size();
for (int i = 0; i < count; i++) {
RemoteControlClientRecord record = mRemoteControlClients.get(i);
record.updatePlaybackInfo();
}
if (mMediaSession != null) {
int controlType = VolumeProviderCompat.VOLUME_CONTROL_FIXED;
if (mPlaybackInfo.volumeHandling
== RouteInfo.PLAYBACK_VOLUME_VARIABLE) {
controlType = VolumeProviderCompat.VOLUME_CONTROL_ABSOLUTE;
}
mMediaSession.configureVolume(controlType, mPlaybackInfo.volumeMax,
mPlaybackInfo.volume);
}
}
}
开发者ID:commonsguy,项目名称:cwac-mediarouter,代码行数:25,代码来源:MediaRouter.java
示例3: setPlaybackToRemote
import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
public void setPlaybackToRemote(VolumeProviderCompat volumeProvider) {
if (volumeProvider == null) {
throw new IllegalArgumentException("volumeProvider may not be null");
}
if (this.mVolumeProvider != null) {
this.mVolumeProvider.setCallback(null);
}
this.mVolumeType = 2;
this.mVolumeProvider = volumeProvider;
sendVolumeInfoChanged(new ParcelableVolumeInfo(this.mVolumeType, this.mLocalStream, this.mVolumeProvider.getVolumeControl(), this.mVolumeProvider.getMaxVolume(), this.mVolumeProvider.getCurrentVolume()));
volumeProvider.setCallback(this.mVolumeCallback);
}
开发者ID:JackChan1999,项目名称:letv,代码行数:13,代码来源:MediaSessionCompat.java
示例4: getTypedValue
import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
/**
* 获取单个自定义属性的TypedValue
* @param context 上下文
* @param attrRes attrid
* @return {@link TypedValue}
*/
public static TypedValue getTypedValue(@NonNull Context context, @VolumeProviderCompat.ControlType int attrRes)
{
TypedValue typedValue = new TypedValue();
context.getTheme().resolveAttribute(attrRes, typedValue, true);
return typedValue;
}
开发者ID:tyzlmjj,项目名称:Tools,代码行数:13,代码来源:AttrUtils.java
示例5: getBoolean
import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
/**
* 获取boolean类型值
* @param context 上下文
* @param attrRes attrid
* @return boolean类型值
*/
public static boolean getBoolean(@NonNull Context context, @VolumeProviderCompat.ControlType int attrRes)
{
if("true".equals(getTypedValue(context,attrRes).coerceToString()))
{
return true;
}
return false;
}
开发者ID:tyzlmjj,项目名称:Tools,代码行数:15,代码来源:AttrUtils.java
示例6: setPlaybackToRemote
import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
public void setPlaybackToRemote(VolumeProviderCompat volumeprovidercompat)
{
if (volumeprovidercompat == null)
{
throw new IllegalArgumentException("volumeProvider may not be null");
}
if (mVolumeProvider != null)
{
mVolumeProvider.setCallback(null);
}
mVolumeType = 2;
mVolumeProvider = volumeprovidercompat;
sendVolumeInfoChanged(new ParcelableVolumeInfo(mVolumeType, mLocalStream, mVolumeProvider.getVolumeControl(), mVolumeProvider.getMaxVolume(), mVolumeProvider.getCurrentVolume()));
volumeprovidercompat.setCallback(mVolumeCallback);
}
开发者ID:Hamz-a,项目名称:MyCTFWriteUps,代码行数:16,代码来源:MediaSessionCompat.java
示例7: onVolumeChanged
import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
public void onVolumeChanged(VolumeProviderCompat volumeprovidercompat)
{
if (mVolumeProvider != volumeprovidercompat)
{
return;
} else
{
volumeprovidercompat = new ParcelableVolumeInfo(mVolumeType, mLocalStream, volumeprovidercompat.getVolumeControl(), volumeprovidercompat.getMaxVolume(), volumeprovidercompat.getCurrentVolume());
sendVolumeInfoChanged(volumeprovidercompat);
return;
}
}
开发者ID:Hamz-a,项目名称:MyCTFWriteUps,代码行数:13,代码来源:MediaSessionCompat.java
示例8: onLoad
import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
@Override
protected void onLoad(Bundle savedInstanceState) {
super.onLoad(savedInstanceState);
controller.getCurrentRenderer(new Action1<ComponentName>() {
@Override
public void call(ComponentName componentName) {
final List<RendererInfo> infos = loader.getPluginInfos();
for (RendererInfo info : infos) {
if (componentName == null) {
//local is null
info.setActive(info.getComponentName() == null);
} else {
info.setActive(componentName.equals(info.getComponentName()));
}
}
if (hasView()) {
getView().getAdapter().replaceAll(infos);
}
}
});
PlaybackInfoCompat playbackInfo = controller.getPlaybackInfo();
if (playbackInfo == null || playbackInfo.getPlaybackType() !=
MediaControllerCompat.PlaybackInfo.PLAYBACK_TYPE_REMOTE ||
playbackInfo.getVolumeControl() != VolumeProviderCompat.VOLUME_CONTROL_ABSOLUTE) {
getView().mVolumeControl.setVisibility(View.GONE);
} else {
getView().mVolumeSeekbar.setMax(playbackInfo.getMaxVolume());
getView().mVolumeSeekbar.setProgress(playbackInfo.getCurrentVolume());
getView().mVolumeSeekbar.setOnSeekBarChangeListener(this);
}
}
开发者ID:OpenSilk,项目名称:Orpheus,代码行数:32,代码来源:RendererScreenPresenter.java
示例9: onVolumeChanged
import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
public void onVolumeChanged(VolumeProviderCompat volumeProvider) {
if (MediaSessionImplBase.this.mVolumeProvider == volumeProvider) {
MediaSessionImplBase.this.sendVolumeInfoChanged(new ParcelableVolumeInfo(MediaSessionImplBase.this.mVolumeType, MediaSessionImplBase.this.mLocalStream, volumeProvider.getVolumeControl(), volumeProvider.getMaxVolume(), volumeProvider.getCurrentVolume()));
}
}
开发者ID:JackChan1999,项目名称:letv,代码行数:6,代码来源:MediaSessionCompat.java
示例10: isChangeable
import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
public boolean isChangeable() {
return getVolumeControl() != VolumeProviderCompat.VOLUME_CONTROL_FIXED;
}
开发者ID:tanguyantoine,项目名称:react-native-music-control,代码行数:4,代码来源:MusicControlListener.java
示例11: CustomVolumeProvider
import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
public CustomVolumeProvider() {
super(VolumeProviderCompat.VOLUME_CONTROL_ABSOLUTE, 100, 50);
inactive = checkInactivity();
}
开发者ID:SpiritCroc,项目名称:Modular-Remote,代码行数:5,代码来源:GlobalActionHandler.java
示例12: setPlaybackToRemote
import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
public void setPlaybackToRemote(VolumeProviderCompat volumeprovidercompat)
{
MediaSessionCompatApi21.setPlaybackToRemote(mSessionObj, volumeprovidercompat.getVolumeProvider());
}
开发者ID:Hamz-a,项目名称:MyCTFWriteUps,代码行数:5,代码来源:MediaSessionCompat$MediaSessionImplApi21.java
示例13: setPlaybackToRemote
import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
@Override
public void setPlaybackToRemote(VolumeProviderCompat volumeProvider) {
}
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:4,代码来源:MediaSessionCompat.java
示例14: getVolumeProvider
import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
@Override
public VolumeProviderCompat getVolumeProvider() {
return null;
}
开发者ID:OpenSilk,项目名称:Orpheus,代码行数:5,代码来源:LocalRenderer.java
示例15: setPlaybackToRemote
import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
public void setPlaybackToRemote(VolumeProviderCompat volumeProviderCompat) {
mProxy.setPlaybackToRemote(volumeProviderCompat);
}
开发者ID:OpenSilk,项目名称:Orpheus,代码行数:4,代码来源:MediaSessionHolder.java
示例16: setPlaybackToRemote
import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
@Override
public void setPlaybackToRemote(VolumeProviderCompat volumeProviderCompat) {
mSession.setPlaybackToRemote(volumeProviderCompat);
}
开发者ID:OpenSilk,项目名称:Orpheus,代码行数:5,代码来源:MediaSessionHolderK.java
示例17: setPlaybackToRemote
import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
@Override
public void setPlaybackToRemote(VolumeProviderCompat volumeProviderCompat) {
mSession.setPlaybackToRemote((VolumeProvider)volumeProviderCompat.getVolumeProvider());
}
开发者ID:OpenSilk,项目名称:Orpheus,代码行数:5,代码来源:MediaSessionHolderL.java
示例18: getVolumeProvider
import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
@Override
public VolumeProviderCompat getVolumeProvider() {
return mService.get().getVolumeProvider();
}
开发者ID:OpenSilk,项目名称:Orpheus,代码行数:5,代码来源:CastRendererServiceBinder.java
示例19: getVolumeProvider
import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
@Override
public VolumeProviderCompat getVolumeProvider() {
setupVolumeProvider();
return mVolumeProvider;
}
开发者ID:OpenSilk,项目名称:Orpheus,代码行数:6,代码来源:CastRendererService.java
示例20: getString
import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
/**
* 获取字符串
* @param context 上下文
* @param attrRes attrid
* @return String类型内容
*/
public static String getString(@NonNull Context context, @VolumeProviderCompat.ControlType int attrRes)
{
return getTypedValue(context,attrRes).coerceToString().toString();
}
开发者ID:tyzlmjj,项目名称:Tools,代码行数:11,代码来源:AttrUtils.java
注:本文中的android.support.v4.media.VolumeProviderCompat类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论