Removed arrow icon
This commit is contained in:
parent
a3323aeb7f
commit
37109506a1
6 changed files with 11 additions and 48 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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<BitmapPaletteWrapper>? = 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)
|
|
@ -50,22 +50,11 @@ class PlayingNotificationOreo : PlayingNotification() {
|
|||
private var target: Target<BitmapPaletteWrapper>? = 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)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue