Removed arrow icon
This commit is contained in:
parent
a3323aeb7f
commit
37109506a1
6 changed files with 11 additions and 48 deletions
|
@ -4,10 +4,10 @@ apply plugin: 'kotlin-android-extensions'
|
||||||
apply plugin: 'kotlin-kapt'
|
apply plugin: 'kotlin-kapt'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 29
|
compileSdkVersion 28
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 29
|
targetSdkVersion 28
|
||||||
|
|
||||||
renderscriptTargetApi 28 //must match target sdk and build tools
|
renderscriptTargetApi 28 //must match target sdk and build tools
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
|
|
|
@ -73,7 +73,7 @@ import code.name.monkey.retromusic.providers.HistoryStore;
|
||||||
import code.name.monkey.retromusic.providers.MusicPlaybackQueueStore;
|
import code.name.monkey.retromusic.providers.MusicPlaybackQueueStore;
|
||||||
import code.name.monkey.retromusic.providers.SongPlayCountStore;
|
import code.name.monkey.retromusic.providers.SongPlayCountStore;
|
||||||
import code.name.monkey.retromusic.service.notification.PlayingNotification;
|
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.notification.PlayingNotificationOreo;
|
||||||
import code.name.monkey.retromusic.service.playback.Playback;
|
import code.name.monkey.retromusic.service.playback.Playback;
|
||||||
import code.name.monkey.retromusic.util.MusicUtil;
|
import code.name.monkey.retromusic.util.MusicUtil;
|
||||||
|
@ -640,7 +640,7 @@ public class MusicService extends Service implements
|
||||||
|
|
||||||
public void initNotification() {
|
public void initNotification() {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && !PreferenceUtil.getInstance(this).classicNotification()) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && !PreferenceUtil.getInstance(this).classicNotification()) {
|
||||||
playingNotification = new PlayingNotificationImpl24();
|
playingNotification = new PlayingNotificationImpl();
|
||||||
} else {
|
} else {
|
||||||
playingNotification = new PlayingNotificationOreo();
|
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.SimpleTarget
|
||||||
import com.bumptech.glide.request.target.Target
|
import com.bumptech.glide.request.target.Target
|
||||||
|
|
||||||
class PlayingNotificationImpl24 : PlayingNotification() {
|
class PlayingNotificationImpl : PlayingNotification() {
|
||||||
private var target: Target<BitmapPaletteWrapper>? = null
|
private var target: Target<BitmapPaletteWrapper>? = null
|
||||||
@Synchronized
|
@Synchronized
|
||||||
override fun update() {
|
override fun update() {
|
||||||
|
@ -54,8 +54,7 @@ class PlayingNotificationImpl24 : PlayingNotification() {
|
||||||
val action = Intent(service, MainActivity::class.java)
|
val action = Intent(service, MainActivity::class.java)
|
||||||
action.putExtra("expand", true)
|
action.putExtra("expand", true)
|
||||||
action.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
|
action.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
|
||||||
val clickIntent = PendingIntent
|
val clickIntent = PendingIntent.getActivity(service, 0, action, PendingIntent.FLAG_UPDATE_CURRENT)
|
||||||
.getActivity(service, 0, action, PendingIntent.FLAG_UPDATE_CURRENT)
|
|
||||||
|
|
||||||
val serviceName = ComponentName(service, MusicService::class.java)
|
val serviceName = ComponentName(service, MusicService::class.java)
|
||||||
val intent = Intent(ACTION_QUIT)
|
val intent = Intent(ACTION_QUIT)
|
|
@ -50,22 +50,11 @@ class PlayingNotificationOreo : PlayingNotification() {
|
||||||
private var target: Target<BitmapPaletteWrapper>? = null
|
private var target: Target<BitmapPaletteWrapper>? = null
|
||||||
|
|
||||||
private fun getCombinedRemoteViews(collapsed: Boolean, song: Song): RemoteViews {
|
private fun getCombinedRemoteViews(collapsed: Boolean, song: Song): RemoteViews {
|
||||||
val remoteViews = RemoteViews(service.packageName,
|
val remoteViews = RemoteViews(service.packageName, if (collapsed) R.layout.layout_notification_collapsed else R.layout.layout_notification_expanded)
|
||||||
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.appName, service.getString(R.string.app_name) + " • " + song.albumName)
|
||||||
remoteViews.setTextViewText(R.id.title, song.title)
|
remoteViews.setTextViewText(R.id.title, song.title)
|
||||||
remoteViews.setTextViewText(R.id.subtitle, song.artistName)
|
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)
|
linkButtons(remoteViews)
|
||||||
|
|
||||||
//setNotificationContent(remoteViews, ColorUtil.isColorLight(backgroundColor));
|
|
||||||
return remoteViews
|
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))
|
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))
|
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)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
android:layout_width="14dp"
|
android:layout_width="14dp"
|
||||||
android:layout_height="14dp"
|
android:layout_height="14dp"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
tools:src="@drawable/ic_audiotrack_black_24dp"
|
tools:src="@drawable/ic_notification"
|
||||||
tools:tint="@color/md_black_1000" />
|
tools:tint="@color/md_black_1000" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -52,19 +52,8 @@
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:lines="1"
|
android:lines="1"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textSize="10sp"
|
android:textSize="12sp"
|
||||||
tools:text="@string/app_name" />
|
tools:text="@string/app_name" />
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/arrow"
|
|
||||||
android:layout_width="14dp"
|
|
||||||
android:layout_height="14dp"
|
|
||||||
android:layout_marginStart="2dp"
|
|
||||||
android:scaleType="centerInside"
|
|
||||||
android:src="@drawable/ic_keyboard_arrow_down_black_24dp"
|
|
||||||
android:tint="@color/md_black_1000"
|
|
||||||
tools:ignore="VectorDrawableCompat" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
android:id="@+id/largeIcon"
|
android:id="@+id/largeIcon"
|
||||||
android:layout_width="@dimen/notification_big_image_size"
|
android:layout_width="@dimen/notification_big_image_size"
|
||||||
android:layout_height="@dimen/notification_big_image_size"
|
android:layout_height="@dimen/notification_big_image_size"
|
||||||
android:forceDarkAllowed="false"
|
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
tools:src="@tools:sample/avatars" />
|
tools:src="@tools:sample/avatars" />
|
||||||
|
@ -45,7 +44,7 @@
|
||||||
android:layout_width="12dp"
|
android:layout_width="12dp"
|
||||||
android:layout_height="12dp"
|
android:layout_height="12dp"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
tools:src="@drawable/ic_audiotrack_black_24dp"
|
tools:src="@drawable/ic_notification"
|
||||||
tools:tint="@color/md_black_1000" />
|
tools:tint="@color/md_black_1000" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -56,19 +55,9 @@
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:lines="1"
|
android:lines="1"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textSize="10sp"
|
android:textSize="12sp"
|
||||||
tools:text="@string/app_name" />
|
tools:text="@string/app_name" />
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/arrow"
|
|
||||||
android:layout_width="12dp"
|
|
||||||
android:layout_height="12dp"
|
|
||||||
android:layout_marginStart="2dp"
|
|
||||||
android:scaleType="centerInside"
|
|
||||||
android:src="@drawable/ic_keyboard_arrow_up_24dp"
|
|
||||||
android:tint="@color/dark_grey"
|
|
||||||
tools:ignore="VectorDrawableCompat" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
Loading…
Reference in a new issue