diff --git a/app/build.gradle b/app/build.gradle index 9358d533..c86696d9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,10 +4,10 @@ apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' android { - compileSdkVersion 29 + compileSdkVersion 28 defaultConfig { minSdkVersion 21 - targetSdkVersion 29 + targetSdkVersion 28 renderscriptTargetApi 28 //must match target sdk and build tools vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/code/name/monkey/retromusic/service/MusicService.java b/app/src/main/java/code/name/monkey/retromusic/service/MusicService.java index 42553bcd..b7737f59 100644 --- a/app/src/main/java/code/name/monkey/retromusic/service/MusicService.java +++ b/app/src/main/java/code/name/monkey/retromusic/service/MusicService.java @@ -73,7 +73,7 @@ import code.name.monkey.retromusic.providers.HistoryStore; import code.name.monkey.retromusic.providers.MusicPlaybackQueueStore; import code.name.monkey.retromusic.providers.SongPlayCountStore; import code.name.monkey.retromusic.service.notification.PlayingNotification; -import code.name.monkey.retromusic.service.notification.PlayingNotificationImpl24; +import code.name.monkey.retromusic.service.notification.PlayingNotificationImpl; import code.name.monkey.retromusic.service.notification.PlayingNotificationOreo; import code.name.monkey.retromusic.service.playback.Playback; import code.name.monkey.retromusic.util.MusicUtil; @@ -640,7 +640,7 @@ public class MusicService extends Service implements public void initNotification() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && !PreferenceUtil.getInstance(this).classicNotification()) { - playingNotification = new PlayingNotificationImpl24(); + playingNotification = new PlayingNotificationImpl(); } else { playingNotification = new PlayingNotificationOreo(); } diff --git a/app/src/main/java/code/name/monkey/retromusic/service/notification/PlayingNotificationImpl24.kt b/app/src/main/java/code/name/monkey/retromusic/service/notification/PlayingNotificationImpl.kt similarity index 97% rename from app/src/main/java/code/name/monkey/retromusic/service/notification/PlayingNotificationImpl24.kt rename to app/src/main/java/code/name/monkey/retromusic/service/notification/PlayingNotificationImpl.kt index bc8d802e..c4890a69 100644 --- a/app/src/main/java/code/name/monkey/retromusic/service/notification/PlayingNotificationImpl24.kt +++ b/app/src/main/java/code/name/monkey/retromusic/service/notification/PlayingNotificationImpl.kt @@ -39,7 +39,7 @@ import com.bumptech.glide.request.animation.GlideAnimation import com.bumptech.glide.request.target.SimpleTarget import com.bumptech.glide.request.target.Target -class PlayingNotificationImpl24 : PlayingNotification() { +class PlayingNotificationImpl : PlayingNotification() { private var target: Target? = null @Synchronized override fun update() { @@ -54,8 +54,7 @@ class PlayingNotificationImpl24 : PlayingNotification() { val action = Intent(service, MainActivity::class.java) action.putExtra("expand", true) action.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP - val clickIntent = PendingIntent - .getActivity(service, 0, action, PendingIntent.FLAG_UPDATE_CURRENT) + val clickIntent = PendingIntent.getActivity(service, 0, action, PendingIntent.FLAG_UPDATE_CURRENT) val serviceName = ComponentName(service, MusicService::class.java) val intent = Intent(ACTION_QUIT) diff --git a/app/src/main/java/code/name/monkey/retromusic/service/notification/PlayingNotificationOreo.kt b/app/src/main/java/code/name/monkey/retromusic/service/notification/PlayingNotificationOreo.kt index b1e2185b..0d2f1ccf 100644 --- a/app/src/main/java/code/name/monkey/retromusic/service/notification/PlayingNotificationOreo.kt +++ b/app/src/main/java/code/name/monkey/retromusic/service/notification/PlayingNotificationOreo.kt @@ -50,22 +50,11 @@ class PlayingNotificationOreo : PlayingNotification() { private var target: Target? = null private fun getCombinedRemoteViews(collapsed: Boolean, song: Song): RemoteViews { - val remoteViews = RemoteViews(service.packageName, - if (collapsed) R.layout.layout_notification_collapsed else R.layout.layout_notification_expanded) - + val remoteViews = RemoteViews(service.packageName, if (collapsed) R.layout.layout_notification_collapsed else R.layout.layout_notification_expanded) remoteViews.setTextViewText(R.id.appName, service.getString(R.string.app_name) + " • " + song.albumName) remoteViews.setTextViewText(R.id.title, song.title) remoteViews.setTextViewText(R.id.subtitle, song.artistName) - - val typedArray = service.obtainStyledAttributes(intArrayOf(android.R.attr.selectableItemBackground)) - val selectableItemBackground = typedArray.getResourceId(0, 0) - typedArray.recycle() - - remoteViews.setInt(R.id.content, "setBackgroundResource", selectableItemBackground) - linkButtons(remoteViews) - - //setNotificationContent(remoteViews, ColorUtil.isColorLight(backgroundColor)); return remoteViews } @@ -177,9 +166,6 @@ class PlayingNotificationOreo : PlayingNotification() { notificationLayout.setImageViewBitmap(R.id.smallIcon, createBitmap(RetroUtil.getTintedVectorDrawable(service, R.drawable.ic_notification, secondary)!!, 0.6f)) notificationLayoutBig.setImageViewBitmap(R.id.smallIcon, createBitmap(RetroUtil.getTintedVectorDrawable(service, R.drawable.ic_notification, secondary)!!, 0.6f)) - notificationLayout.setInt(R.id.arrow, "setColorFilter", secondary) - notificationLayoutBig.setInt(R.id.arrow, "setColorFilter", secondary) - } }) } diff --git a/app/src/main/res/layout/layout_notification_collapsed.xml b/app/src/main/res/layout/layout_notification_collapsed.xml index 619a069c..7c021635 100644 --- a/app/src/main/res/layout/layout_notification_collapsed.xml +++ b/app/src/main/res/layout/layout_notification_collapsed.xml @@ -41,7 +41,7 @@ android:layout_width="14dp" android:layout_height="14dp" android:layout_marginStart="8dp" - tools:src="@drawable/ic_audiotrack_black_24dp" + tools:src="@drawable/ic_notification" tools:tint="@color/md_black_1000" /> - - - @@ -45,7 +44,7 @@ android:layout_width="12dp" android:layout_height="12dp" android:layout_marginStart="16dp" - tools:src="@drawable/ic_audiotrack_black_24dp" + tools:src="@drawable/ic_notification" tools:tint="@color/md_black_1000" /> - -