Search in sources :

Example 1 with NotificationCreater

use of com.lzx.musiclibrary.notification.NotificationCreater in project NiceMusic by lizixian18.

the class NiceMusicApplication method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    sContext = this;
    SpUtil.getInstance().init(this);
    CrashHandler.getInstance().init(this);
    // 直播链接在喜马拉雅获取,需要集成他们的sdk
    CommonRequest mXimalaya = CommonRequest.getInstanse();
    String mAppSecret = "8646d66d6abe2efd14f2891f9fd1c8af";
    mXimalaya.setAppkey("9f9ef8f10bebeaa83e71e62f935bede8");
    mXimalaya.setPackid("com.app.test.android");
    mXimalaya.init(this, mAppSecret);
    if (!BaseUtil.getCurProcessName(this).contains(":musicLibrary")) {
        NotificationCreater creater = new NotificationCreater.Builder().setTargetClass("com.lzx.nicemusic.module.main.HomeActivity").setFavoriteIntent(getPendingIntent(favoriteActionName)).setLyricsIntent(getPendingIntent(lyricsActionName)).setCreateSystemNotification(true).build();
        MusicManager.get().setContext(this).setNotificationCreater(creater).init();
    }
}
Also used : NotificationCreater(com.lzx.musiclibrary.notification.NotificationCreater) CommonRequest(com.ximalaya.ting.android.opensdk.datatrasfer.CommonRequest)

Example 2 with NotificationCreater

use of com.lzx.musiclibrary.notification.NotificationCreater in project NiceMusic by lizixian18.

the class MusicService method onBind.

@Nullable
@Override
public IBinder onBind(Intent intent) {
    boolean isUseMediaPlayer = intent.getBooleanExtra("isUseMediaPlayer", false);
    boolean isAutoPlayNext = intent.getBooleanExtra("isAutoPlayNext", true);
    NotificationCreater notificationCreater = intent.getParcelableExtra("notificationCreater");
    mBinder = new PlayControl.Builder(this).setAutoPlayNext(isAutoPlayNext).setUseMediaPlayer(isUseMediaPlayer).setNotificationCreater(notificationCreater).build();
    return mBinder;
}
Also used : NotificationCreater(com.lzx.musiclibrary.notification.NotificationCreater) PlayControl(com.lzx.musiclibrary.control.PlayControl) Nullable(android.support.annotation.Nullable)

Example 3 with NotificationCreater

use of com.lzx.musiclibrary.notification.NotificationCreater in project MusicLibrary by lizixian18.

the class MusicService method onBind.

@Nullable
@Override
public IBinder onBind(Intent intent) {
    boolean isUseMediaPlayer = intent.getBooleanExtra("isUseMediaPlayer", false);
    boolean isAutoPlayNext = intent.getBooleanExtra("isAutoPlayNext", true);
    NotificationCreater notificationCreater = intent.getParcelableExtra("notificationCreater");
    mBinder = new PlayControl.Builder(this).setAutoPlayNext(isAutoPlayNext).setUseMediaPlayer(isUseMediaPlayer).setNotificationCreater(notificationCreater).build();
    return mBinder;
}
Also used : NotificationCreater(com.lzx.musiclibrary.notification.NotificationCreater) PlayControl(com.lzx.musiclibrary.control.PlayControl) Nullable(android.support.annotation.Nullable)

Aggregations

NotificationCreater (com.lzx.musiclibrary.notification.NotificationCreater)3 Nullable (android.support.annotation.Nullable)2 PlayControl (com.lzx.musiclibrary.control.PlayControl)2 CommonRequest (com.ximalaya.ting.android.opensdk.datatrasfer.CommonRequest)1