• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java MusicService类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中com.example.android.uamp.MusicService的典型用法代码示例。如果您正苦于以下问题:Java MusicService类的具体用法?Java MusicService怎么用?Java MusicService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

MusicService类属于com.example.android.uamp包,在下文中一共展示了MusicService类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onCreate

点赞 3

import com.example.android.uamp.MusicService; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    LogHelper.d(TAG, "Activity onCreate");

    // Since our app icon has the same color as colorPrimary, our entry in the Recent Apps
    // list gets weird. We need to change either the icon or the color of the TaskDescription.
    ActivityManager.TaskDescription taskDesc = new ActivityManager.TaskDescription(
        getTitle().toString(),
        BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher_white),
        ResourceHelper.getThemeColor(this, R.attr.colorPrimary, android.R.color.darker_gray));
    setTaskDescription(taskDesc);

    // Connect a media browser just to get the media session token. There are other ways
    // this can be done, for example by sharing the session token directly.
    mMediaBrowser = new MediaBrowser(this,
        new ComponentName(this, MusicService.class), mConnectionCallback, null);
}
 

开发者ID:mrinalgit-dev,
项目名称:MrinalMusicPlayer,
代码行数:20,
代码来源:BaseActivity.java

示例2: onCreate

点赞 3

import com.example.android.uamp.MusicService; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    LogHelper.d(TAG, "Activity onCreate");

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        // Since our app icon has the same color as colorPrimary, our entry in the Recent Apps
        // list gets weird. We need to change either the icon or the color of the TaskDescription.
        ActivityManager.TaskDescription taskDesc = new ActivityManager.TaskDescription(
                getTitle().toString(),
                BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher_white),
                ResourceHelper.getThemeColor(this, R.attr.colorPrimary, android.R.color.darker_gray));
        setTaskDescription(taskDesc);
    }

    // Connect a media browser just to get the media session token. There are other ways
    // this can be done, for example by sharing the session token directly.
    mMediaBrowser = new MediaBrowserCompat(this, new ComponentName(this, MusicService.class), mMediaBrowserConnectionCallback, null);
}
 

开发者ID:SoumyaParida,
项目名称:MyGaana-Universal,
代码行数:21,
代码来源:BaseActivity.java

示例3: onCreate

点赞 3

import com.example.android.uamp.MusicService; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    LogHelper.d(TAG, "Activity onCreate");

    if (Build.VERSION.SDK_INT >= 21) {
        // Since our app icon has the same color as colorPrimary, our entry in the Recent Apps
        // list gets weird. We need to change either the icon or the color
        // of the TaskDescription.
        ActivityManager.TaskDescription taskDesc = new ActivityManager.TaskDescription(
                getTitle().toString(),
                BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher_white),
                ResourceHelper.getThemeColor(this, R.attr.colorPrimary,
                        android.R.color.darker_gray));
        setTaskDescription(taskDesc);
    }

    // Connect a media browser just to get the media session token. There are other ways
    // this can be done, for example by sharing the session token directly.
    mMediaBrowser = new MediaBrowserCompat(this,
        new ComponentName(this, MusicService.class), mConnectionCallback, null);
}
 

开发者ID:googlesamples,
项目名称:android-UniversalMusicPlayer,
代码行数:24,
代码来源:BaseActivity.java

示例4: onCreate

点赞 2

import com.example.android.uamp.MusicService; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.tv_vertical_grid);

    mMediaId = getIntent().getStringExtra(TvBrowseActivity.SAVED_MEDIA_ID);
    mTitle = getIntent().getStringExtra(TvBrowseActivity.BROWSE_TITLE);

    getWindow().setBackgroundDrawableResource(R.drawable.bg);

    mMediaBrowser = new MediaBrowser(this,
            new ComponentName(this, MusicService.class),
            mConnectionCallback, null);
}
 

开发者ID:mrinalgit-dev,
项目名称:MrinalMusicPlayer,
代码行数:16,
代码来源:TvVerticalGridActivity.java

示例5: onCreate

点赞 2

import com.example.android.uamp.MusicService; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    LogHelper.d(TAG, "Activity onCreate");

    setContentView(R.layout.tv_activity_player);

    mMediaBrowser = new MediaBrowser(this,
            new ComponentName(this, MusicService.class),
            mConnectionCallback, null);
}
 

开发者ID:mrinalgit-dev,
项目名称:MrinalMusicPlayer,
代码行数:12,
代码来源:TvBrowseActivity.java

示例6: onCreate

点赞 2

import com.example.android.uamp.MusicService; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    LogHelper.d(TAG, "Activity onCreate");

    mMediaBrowser = new MediaBrowser(this,
            new ComponentName(this, MusicService.class),
            mConnectionCallback, null);

    setContentView(R.layout.tv_playback_controls);

    mPlaybackFragment = (TvPlaybackFragment) getFragmentManager()
            .findFragmentById(R.id.playback_controls_fragment);
}
 

开发者ID:mrinalgit-dev,
项目名称:MrinalMusicPlayer,
代码行数:15,
代码来源:TvPlaybackActivity.java

示例7: onPlaybackStateChanged

点赞 2

import com.example.android.uamp.MusicService; //导入依赖的package包/类
private void onPlaybackStateChanged(PlaybackState state) {
    LogHelper.d(TAG, "onPlaybackStateChanged ", state);
    if (getActivity() == null) {
        LogHelper.w(TAG, "onPlaybackStateChanged called when getActivity null," +
                "this should not happen if the callback was properly unregistered. Ignoring.");
        return;
    }
    if (state == null) {
        return;
    }
    boolean enablePlay = false;
    switch (state.getState()) {
        case PlaybackState.STATE_PAUSED:
        case PlaybackState.STATE_STOPPED:
            enablePlay = true;
            break;
        case PlaybackState.STATE_ERROR:
            LogHelper.e(TAG, "error playbackstate: ", state.getErrorMessage());
            Toast.makeText(getActivity(), state.getErrorMessage(), Toast.LENGTH_LONG).show();
            break;
    }

    if (enablePlay) {
        mPlayPause.setImageDrawable(
                getActivity().getDrawable(R.drawable.ic_play_arrow_black_36dp));
    } else {
        mPlayPause.setImageDrawable(getActivity().getDrawable(R.drawable.ic_pause_black_36dp));
    }

    MediaController controller = getActivity().getMediaController();
    String extraInfo = null;
    if (controller != null && controller.getExtras() != null) {
        String castName = controller.getExtras().getString(MusicService.EXTRA_CONNECTED_CAST);
        if (castName != null) {
            extraInfo = getResources().getString(R.string.casting_to_device, castName);
        }
    }
    setExtraInfo(extraInfo);
}
 

开发者ID:mrinalgit-dev,
项目名称:MrinalMusicPlayer,
代码行数:40,
代码来源:PlaybackControlsFragment.java

示例8: onPlaybackStateChanged

点赞 2

import com.example.android.uamp.MusicService; //导入依赖的package包/类
private void onPlaybackStateChanged(PlaybackStateCompat state) {
    LogHelper.d(TAG, "onPlaybackStateChanged ", state);
    if (getActivity() == null) {
        LogHelper.w(TAG, "onPlaybackStateChanged called when getActivity null," +
                "this should not happen if the callback was properly unregistered. Ignoring.");
        return;
    }
    if (state == null) {
        return;
    }
    boolean enablePlay = false;
    switch (state.getState()) {
        case PlaybackStateCompat.STATE_PAUSED:
        case PlaybackStateCompat.STATE_STOPPED:
            enablePlay = true;
            break;
        case PlaybackStateCompat.STATE_ERROR:
            LogHelper.e(TAG, "error playbackstate: ", state.getErrorMessage());
            Toast.makeText(getActivity(), state.getErrorMessage(), Toast.LENGTH_LONG).show();
            break;
    }

    if (enablePlay) {
        mPlayPause.setImageDrawable(ActivityCompat.getDrawable(getActivity(), R.drawable.ic_play_arrow_black_36dp));
    } else {
        mPlayPause.setImageDrawable(ActivityCompat.getDrawable(getActivity(), R.drawable.ic_pause_black_36dp));
    }

    MediaControllerCompat controller = mMediaControllerProvider.getSupportMediaController();
    String extraInfo = null;
    if (controller != null && controller.getExtras() != null) {
        String castName = controller.getExtras().getString(MusicService.EXTRA_CONNECTED_CAST);
        if (castName != null) {
            extraInfo = getResources().getString(R.string.casting_to_device, castName);
        }
    }
    setExtraInfo(extraInfo);
}
 

开发者ID:SoumyaParida,
项目名称:MyGaana-Universal,
代码行数:39,
代码来源:PlaybackControlsFragment.java

示例9: onCreate

点赞 2

import com.example.android.uamp.MusicService; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.tv_vertical_grid);

    mMediaId = getIntent().getStringExtra(TvBrowseActivity.SAVED_MEDIA_ID);
    mTitle = getIntent().getStringExtra(TvBrowseActivity.BROWSE_TITLE);

    getWindow().setBackgroundDrawableResource(R.drawable.bg);

    mMediaBrowser = new MediaBrowserCompat(this,
            new ComponentName(this, MusicService.class),
            mConnectionCallback, null);
}
 

开发者ID:googlesamples,
项目名称:android-UniversalMusicPlayer,
代码行数:16,
代码来源:TvVerticalGridActivity.java

示例10: onCreate

点赞 2

import com.example.android.uamp.MusicService; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    LogHelper.d(TAG, "Activity onCreate");

    setContentView(R.layout.tv_activity_player);

    mMediaBrowser = new MediaBrowserCompat(this,
            new ComponentName(this, MusicService.class),
            mConnectionCallback, null);
}
 

开发者ID:googlesamples,
项目名称:android-UniversalMusicPlayer,
代码行数:12,
代码来源:TvBrowseActivity.java

示例11: onCreate

点赞 2

import com.example.android.uamp.MusicService; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    LogHelper.d(TAG, "Activity onCreate");

    mMediaBrowser = new MediaBrowserCompat(this,
            new ComponentName(this, MusicService.class),
            mConnectionCallback, null);

    setContentView(R.layout.tv_playback_controls);

    mPlaybackFragment = (TvPlaybackFragment) getSupportFragmentManager()
            .findFragmentById(R.id.playback_controls_fragment);
}
 

开发者ID:googlesamples,
项目名称:android-UniversalMusicPlayer,
代码行数:15,
代码来源:TvPlaybackActivity.java

示例12: onPlaybackStateChanged

点赞 2

import com.example.android.uamp.MusicService; //导入依赖的package包/类
private void onPlaybackStateChanged(PlaybackStateCompat state) {
    LogHelper.d(TAG, "onPlaybackStateChanged ", state);
    if (getActivity() == null) {
        LogHelper.w(TAG, "onPlaybackStateChanged called when getActivity null," +
                "this should not happen if the callback was properly unregistered. Ignoring.");
        return;
    }
    if (state == null) {
        return;
    }
    boolean enablePlay = false;
    switch (state.getState()) {
        case PlaybackStateCompat.STATE_PAUSED:
        case PlaybackStateCompat.STATE_STOPPED:
            enablePlay = true;
            break;
        case PlaybackStateCompat.STATE_ERROR:
            LogHelper.e(TAG, "error playbackstate: ", state.getErrorMessage());
            Toast.makeText(getActivity(), state.getErrorMessage(), Toast.LENGTH_LONG).show();
            break;
    }

    if (enablePlay) {
        mPlayPause.setImageDrawable(
                ContextCompat.getDrawable(getActivity(), R.drawable.ic_play_arrow_black_36dp));
    } else {
        mPlayPause.setImageDrawable(
                ContextCompat.getDrawable(getActivity(), R.drawable.ic_pause_black_36dp));
    }

    MediaControllerCompat controller = MediaControllerCompat.getMediaController(getActivity());
    String extraInfo = null;
    if (controller != null && controller.getExtras() != null) {
        String castName = controller.getExtras().getString(MusicService.EXTRA_CONNECTED_CAST);
        if (castName != null) {
            extraInfo = getResources().getString(R.string.casting_to_device, castName);
        }
    }
    setExtraInfo(extraInfo);
}
 

开发者ID:googlesamples,
项目名称:android-UniversalMusicPlayer,
代码行数:41,
代码来源:PlaybackControlsFragment.java

示例13: onReceive

点赞 2

import com.example.android.uamp.MusicService; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    if (AudioManager.ACTION_AUDIO_BECOMING_NOISY.equals(intent.getAction())) {
        LogHelper.d(TAG, "Headphones disconnected.");
        if (isPlaying()) {
            Intent i = new Intent(context, MusicService.class);
            i.setAction(MusicService.ACTION_CMD);
            i.putExtra(MusicService.CMD_NAME, MusicService.CMD_PAUSE);
            mContext.startService(i);
        }
    }
}
 

开发者ID:googlesamples,
项目名称:android-UniversalMusicPlayer,
代码行数:13,
代码来源:LocalPlayback.java

示例14: onPlaybackStateChanged

点赞 2

import com.example.android.uamp.MusicService; //导入依赖的package包/类
private void onPlaybackStateChanged(PlaybackState state) {
    LogHelper.d(TAG, "onPlaybackStateChanged ", state);
    if (getActivity() == null) {
        LogHelper.w(TAG, "onPlaybackStateChanged called when getActivity null," +
                "this should not happen if the callback was properly unregistered. Ignoring.");
        return;
    }
    if (state == null) {
        return;
    }
    boolean enablePlay = false;
    switch (state.getState()) {
        case PlaybackState.STATE_PAUSED:
        case PlaybackState.STATE_STOPPED:
            enablePlay = true;
            break;
        case PlaybackState.STATE_ERROR:
            LogHelper.e(TAG, "error playbackstate: ", state.getErrorMessage());
            break;
    }

    if (enablePlay) {
        mPlayPause.setImageDrawable(
                getActivity().getDrawable(R.drawable.ic_play_arrow_black_36dp));
    } else {
        mPlayPause.setImageDrawable(getActivity().getDrawable(R.drawable.ic_pause_black_36dp));
    }

    MediaController controller = getActivity().getMediaController();
    String extraInfo = null;
    if (controller != null && controller.getExtras() != null) {
        String castName = controller.getExtras().getString(MusicService.EXTRA_CONNECTED_CAST);
        if (castName != null) {
            extraInfo = getResources().getString(R.string.casting_to_device, castName);
        }
    }
    setExtraInfo(extraInfo);
}
 

开发者ID:ErNaveen,
项目名称:UniversalMusicPlayer,
代码行数:39,
代码来源:PlaybackControlsFragment.java

示例15: updatePlaybackState

点赞 2

import com.example.android.uamp.MusicService; //导入依赖的package包/类
private void updatePlaybackState(PlaybackState state) {
    if (state == null) {
        return;
    }
    mLastPlaybackState = state;
    if (getMediaController() != null && getMediaController().getExtras() != null) {
        String castName = getMediaController()
                .getExtras().getString(MusicService.EXTRA_CONNECTED_CAST);
        String line3Text = castName == null ? "" : getResources()
                    .getString(R.string.casting_to_device, castName);
        mLine3.setText(line3Text);
    }

    switch (state.getState()) {
        case PlaybackState.STATE_PLAYING:
            mLoading.setVisibility(INVISIBLE);
            mPlayPause.setVisibility(VISIBLE);
            mPlayPause.setImageDrawable(mPauseDrawable);
            mControllers.setVisibility(VISIBLE);
            scheduleSeekbarUpdate();
            break;
        case PlaybackState.STATE_PAUSED:
            mControllers.setVisibility(VISIBLE);
            mLoading.setVisibility(INVISIBLE);
            mPlayPause.setVisibility(VISIBLE);
            mPlayPause.setImageDrawable(mPlayDrawable);
            stopSeekbarUpdate();
            break;
        case PlaybackState.STATE_NONE:
        case PlaybackState.STATE_STOPPED:
            mLoading.setVisibility(INVISIBLE);
            mPlayPause.setVisibility(VISIBLE);
            mPlayPause.setImageDrawable(mPlayDrawable);
            stopSeekbarUpdate();
            break;
        case PlaybackState.STATE_BUFFERING:
            mPlayPause.setVisibility(INVISIBLE);
            mLoading.setVisibility(VISIBLE);
            mLine3.setText(R.string.loading);
            stopSeekbarUpdate();
            break;
        default:
            LogHelper.d(TAG, "Unhandled state ", state.getState());
    }

    mSkipNext.setVisibility((state.getActions() & PlaybackState.ACTION_SKIP_TO_NEXT) == 0
        ? INVISIBLE : VISIBLE );
    mSkipPrev.setVisibility((state.getActions() & PlaybackState.ACTION_SKIP_TO_PREVIOUS) == 0
        ? INVISIBLE : VISIBLE );
}
 

开发者ID:mrinalgit-dev,
项目名称:MrinalMusicPlayer,
代码行数:51,
代码来源:FullScreenPlayerActivity.java

示例16: updatePlaybackState

点赞 2

import com.example.android.uamp.MusicService; //导入依赖的package包/类
private void updatePlaybackState(PlaybackStateCompat state) {
    if (state == null) {
        return;
    }
    mLastPlaybackState = state;
    String castName = mMediaController.getExtras().getString(MusicService.EXTRA_CONNECTED_CAST);
    String line3Text = "";
    if (castName != null) {
        line3Text = getResources()
                .getString(R.string.casting_to_device, castName);
    }
    mLine3.setText(line3Text);

    switch (state.getState()) {
        case PlaybackStateCompat.STATE_PLAYING:
            mLoading.setVisibility(INVISIBLE);
            mPlayPause.setVisibility(VISIBLE);
            mPlayPause.setImageDrawable(mPauseDrawable);
            mControllers.setVisibility(VISIBLE);
            scheduleSeekbarUpdate();
            break;
        case PlaybackStateCompat.STATE_PAUSED:
            mControllers.setVisibility(VISIBLE);
            mLoading.setVisibility(INVISIBLE);
            mPlayPause.setVisibility(VISIBLE);
            mPlayPause.setImageDrawable(mPlayDrawable);
            stopSeekbarUpdate();
            break;
        case PlaybackStateCompat.STATE_NONE:
        case PlaybackStateCompat.STATE_STOPPED:
            mLoading.setVisibility(INVISIBLE);
            mPlayPause.setVisibility(VISIBLE);
            mPlayPause.setImageDrawable(mPlayDrawable);
            stopSeekbarUpdate();
            break;
        case PlaybackStateCompat.STATE_BUFFERING:
            mPlayPause.setVisibility(INVISIBLE);
            mLoading.setVisibility(VISIBLE);
            mLine3.setText(R.string.loading);
            stopSeekbarUpdate();
            break;
        default:
            LogHelper.d(TAG, "Unhandled state ", state.getState());
    }

    mSkipNext.setVisibility((state.getActions() & PlaybackStateCompat.ACTION_SKIP_TO_NEXT) == 0
        ? INVISIBLE : VISIBLE );
    mSkipPrev.setVisibility((state.getActions() & PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS) == 0
        ? INVISIBLE : VISIBLE );
}
 

开发者ID:SoumyaParida,
项目名称:MyGaana-Universal,
代码行数:51,
代码来源:FullScreenPlayerActivity.java

示例17: updatePlaybackState

点赞 2

import com.example.android.uamp.MusicService; //导入依赖的package包/类
private void updatePlaybackState(PlaybackStateCompat state) {
    if (state == null) {
        return;
    }
    mLastPlaybackState = state;
    MediaControllerCompat controllerCompat = MediaControllerCompat.getMediaController(FullScreenPlayerActivity.this);
    if (controllerCompat != null && controllerCompat.getExtras() != null) {
        String castName = controllerCompat.getExtras().getString(MusicService.EXTRA_CONNECTED_CAST);
        String line3Text = castName == null ? "" : getResources()
                    .getString(R.string.casting_to_device, castName);
        mLine3.setText(line3Text);
    }

    switch (state.getState()) {
        case PlaybackStateCompat.STATE_PLAYING:
            mLoading.setVisibility(INVISIBLE);
            mPlayPause.setVisibility(VISIBLE);
            mPlayPause.setImageDrawable(mPauseDrawable);
            mControllers.setVisibility(VISIBLE);
            scheduleSeekbarUpdate();
            break;
        case PlaybackStateCompat.STATE_PAUSED:
            mControllers.setVisibility(VISIBLE);
            mLoading.setVisibility(INVISIBLE);
            mPlayPause.setVisibility(VISIBLE);
            mPlayPause.setImageDrawable(mPlayDrawable);
            stopSeekbarUpdate();
            break;
        case PlaybackStateCompat.STATE_NONE:
        case PlaybackStateCompat.STATE_STOPPED:
            mLoading.setVisibility(INVISIBLE);
            mPlayPause.setVisibility(VISIBLE);
            mPlayPause.setImageDrawable(mPlayDrawable);
            stopSeekbarUpdate();
            break;
        case PlaybackStateCompat.STATE_BUFFERING:
            mPlayPause.setVisibility(INVISIBLE);
            mLoading.setVisibility(VISIBLE);
            mLine3.setText(R.string.loading);
            stopSeekbarUpdate();
            break;
        default:
            LogHelper.d(TAG, "Unhandled state ", state.getState());
    }

    mSkipNext.setVisibility((state.getActions() & PlaybackStateCompat.ACTION_SKIP_TO_NEXT) == 0
        ? INVISIBLE : VISIBLE );
    mSkipPrev.setVisibility((state.getActions() & PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS) == 0
        ? INVISIBLE : VISIBLE );
}
 

开发者ID:googlesamples,
项目名称:android-UniversalMusicPlayer,
代码行数:51,
代码来源:FullScreenPlayerActivity.java

示例18: updatePlaybackState

点赞 2

import com.example.android.uamp.MusicService; //导入依赖的package包/类
private void updatePlaybackState(PlaybackState state) {
    if (state == null) {
        return;
    }
    mLastPlaybackState = state;
    String castName = getMediaController()
            .getExtras().getString(MusicService.EXTRA_CONNECTED_CAST);
    String line3Text = "";
    if (castName != null) {
        line3Text = getResources()
                .getString(R.string.casting_to_device, castName);
    }
    mLine3.setText(line3Text);

    switch (state.getState()) {
        case PlaybackState.STATE_PLAYING:
            mLoading.setVisibility(INVISIBLE);
            mPlayPause.setVisibility(VISIBLE);
            mPlayPause.setImageDrawable(mPauseDrawable);
            mControllers.setVisibility(VISIBLE);
            scheduleSeekbarUpdate();
            break;
        case PlaybackState.STATE_PAUSED:
            mControllers.setVisibility(VISIBLE);
            mLoading.setVisibility(INVISIBLE);
            mPlayPause.setVisibility(VISIBLE);
            mPlayPause.setImageDrawable(mPlayDrawable);
            stopSeekbarUpdate();
            break;
        case PlaybackState.STATE_NONE:
        case PlaybackState.STATE_STOPPED:
            mLoading.setVisibility(INVISIBLE);
            mPlayPause.setVisibility(VISIBLE);
            mPlayPause.setImageDrawable(mPlayDrawable);
            stopSeekbarUpdate();
            break;
        case PlaybackState.STATE_BUFFERING:
            mPlayPause.setVisibility(INVISIBLE);
            mLoading.setVisibility(VISIBLE);
            mLine3.setText(R.string.loading);
            stopSeekbarUpdate();
            break;
        default:
            LogHelper.d(TAG, "Unhandled state ", state.getState());
    }

    mSkipNext.setVisibility((state.getActions() & PlaybackState.ACTION_SKIP_TO_NEXT) == 0
        ? INVISIBLE : VISIBLE );
    mSkipPrev.setVisibility((state.getActions() & PlaybackState.ACTION_SKIP_TO_PREVIOUS) == 0
        ? INVISIBLE : VISIBLE );
}
 

开发者ID:ErNaveen,
项目名称:UniversalMusicPlayer,
代码行数:52,
代码来源:FullScreenPlayerActivity.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)