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 {
|
android {
|
||||||
compileSdkVersion 25
|
compileSdkVersion 26
|
||||||
buildToolsVersion '25.0.3'
|
buildToolsVersion '26.0.1'
|
||||||
dataBinding {
|
dataBinding {
|
||||||
enabled = true
|
enabled = true
|
||||||
}
|
}
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 25
|
targetSdkVersion 26
|
||||||
|
|
||||||
renderscriptTargetApi 25
|
renderscriptTargetApi 26
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
|
|
||||||
applicationId 'com.kabouzeid.gramophone'
|
applicationId 'com.kabouzeid.gramophone'
|
||||||
|
|
@ -70,7 +70,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
supportLibVersion = '25.4.0'
|
supportLibVersion = '26.0.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@ import static android.content.Context.NOTIFICATION_SERVICE;
|
||||||
public abstract class PlayingNotification {
|
public abstract class PlayingNotification {
|
||||||
|
|
||||||
private static final int NOTIFICATION_ID = 1;
|
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_FOREGROUND = 1;
|
||||||
private static final int NOTIFY_MODE_BACKGROUND = 0;
|
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 clickIntent = PendingIntent.getActivity(service, 0, action, 0);
|
||||||
final PendingIntent deleteIntent = buildPendingIntent(service, MusicService.ACTION_QUIT, null);
|
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)
|
.setSmallIcon(R.drawable.ic_notification)
|
||||||
.setContentIntent(clickIntent)
|
.setContentIntent(clickIntent)
|
||||||
.setDeleteIntent(deleteIntent)
|
.setDeleteIntent(deleteIntent)
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,8 @@ import android.graphics.BitmapFactory;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Build;
|
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.support.v7.graphics.Palette;
|
||||||
import android.text.TextUtils;
|
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,
|
NotificationCompat.Action nextAction = new NotificationCompat.Action(R.drawable.ic_skip_next_white_24dp,
|
||||||
service.getString(R.string.action_next),
|
service.getString(R.string.action_next),
|
||||||
retrievePlaybackAction(ACTION_SKIP));
|
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)
|
.setSmallIcon(R.drawable.ic_notification)
|
||||||
.setLargeIcon(bitmap)
|
.setLargeIcon(bitmap)
|
||||||
.setContentIntent(clickIntent)
|
.setContentIntent(clickIntent)
|
||||||
|
|
@ -98,7 +99,7 @@ public class PlayingNotificationImpl24 extends PlayingNotification {
|
||||||
.addAction(nextAction);
|
.addAction(nextAction);
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
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);
|
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC);
|
||||||
if (PreferenceUtil.getInstance(service).coloredNotification())
|
if (PreferenceUtil.getInstance(service).coloredNotification())
|
||||||
builder.setColor(color);
|
builder.setColor(color);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue