Update support libs and build tools to v26
This commit is contained in:
parent
41b81ce14c
commit
4951997676
4 changed files with 12 additions and 9 deletions
|
|
@ -29,16 +29,16 @@ def gitBranch() {
|
|||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 25
|
||||
buildToolsVersion '25.0.3'
|
||||
compileSdkVersion 26
|
||||
buildToolsVersion '26.0.1'
|
||||
dataBinding {
|
||||
enabled = true
|
||||
}
|
||||
defaultConfig {
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 25
|
||||
targetSdkVersion 26
|
||||
|
||||
renderscriptTargetApi 25
|
||||
renderscriptTargetApi 26
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
|
||||
applicationId 'com.kabouzeid.gramophone'
|
||||
|
|
@ -70,7 +70,7 @@ android {
|
|||
}
|
||||
|
||||
ext {
|
||||
supportLibVersion = '25.4.0'
|
||||
supportLibVersion = '26.0.1'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import static android.content.Context.NOTIFICATION_SERVICE;
|
|||
public abstract class PlayingNotification {
|
||||
|
||||
private static final int NOTIFICATION_ID = 1;
|
||||
protected static final String NOTIFICATION_CHANNEL = "notif_channel";
|
||||
|
||||
private static final int NOTIFY_MODE_FOREGROUND = 1;
|
||||
private static final int NOTIFY_MODE_BACKGROUND = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public class PlayingNotificationImpl extends PlayingNotification {
|
|||
final PendingIntent clickIntent = PendingIntent.getActivity(service, 0, action, 0);
|
||||
final PendingIntent deleteIntent = buildPendingIntent(service, MusicService.ACTION_QUIT, null);
|
||||
|
||||
final Notification notification = new NotificationCompat.Builder(service)
|
||||
final Notification notification = new NotificationCompat.Builder(service, NOTIFICATION_CHANNEL)
|
||||
.setSmallIcon(R.drawable.ic_notification)
|
||||
.setContentIntent(clickIntent)
|
||||
.setDeleteIntent(deleteIntent)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ import android.graphics.BitmapFactory;
|
|||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.support.v7.app.NotificationCompat;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
import android.support.v4.media.app.NotificationCompat.MediaStyle;
|
||||
import android.support.v7.graphics.Palette;
|
||||
import android.text.TextUtils;
|
||||
|
||||
|
|
@ -84,7 +85,7 @@ public class PlayingNotificationImpl24 extends PlayingNotification {
|
|||
NotificationCompat.Action nextAction = new NotificationCompat.Action(R.drawable.ic_skip_next_white_24dp,
|
||||
service.getString(R.string.action_next),
|
||||
retrievePlaybackAction(ACTION_SKIP));
|
||||
NotificationCompat.Builder builder = (NotificationCompat.Builder) new NotificationCompat.Builder(service)
|
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(service, NOTIFICATION_CHANNEL)
|
||||
.setSmallIcon(R.drawable.ic_notification)
|
||||
.setLargeIcon(bitmap)
|
||||
.setContentIntent(clickIntent)
|
||||
|
|
@ -98,7 +99,7 @@ public class PlayingNotificationImpl24 extends PlayingNotification {
|
|||
.addAction(nextAction);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
builder.setStyle(new NotificationCompat.MediaStyle().setMediaSession(service.getMediaSession().getSessionToken()).setShowActionsInCompactView(0, 1, 2))
|
||||
builder.setStyle(new MediaStyle().setMediaSession(service.getMediaSession().getSessionToken()).setShowActionsInCompactView(0, 1, 2))
|
||||
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC);
|
||||
if (PreferenceUtil.getInstance(service).coloredNotification())
|
||||
builder.setColor(color);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue