Merge branch 'arkon-appcompat-26'

This commit is contained in:
Karim Abou Zeid 2017-08-30 18:40:52 +02:00
commit c0c91688b4
4 changed files with 14 additions and 10 deletions

View file

@ -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 {
@ -105,7 +105,8 @@ dependencies {
compile 'com.afollestad.material-dialogs:commons:0.9.4.5'
compile 'com.afollestad:material-cab:0.1.12'
compile 'com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.10.6'
// compile 'com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.10.6'
compile 'com.github.h6ah4i:android-advancedrecyclerview:feature~support_libraries_v26-SNAPSHOT' // TODO: go back to master branch as soon as possible
compile 'com.github.ksoichiro:android-observablescrollview:1.6.0'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'

View file

@ -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;

View file

@ -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)

View file

@ -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);