mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-11-07 18:53:58 +00:00
Add option to not colorize notification
This commit is contained in:
@@ -120,7 +120,10 @@ public final class NotificationUtil {
|
||||
.setCategory(NotificationCompat.CATEGORY_TRANSPORT)
|
||||
.setShowWhen(false)
|
||||
.setSmallIcon(R.drawable.ic_newpipe_triangle_white)
|
||||
.setColor(ContextCompat.getColor(player.context, R.color.gray))
|
||||
.setColor(ContextCompat.getColor(player.context, R.color.dark_background_color))
|
||||
.setColorized(player.sharedPreferences.getBoolean(
|
||||
player.context.getString(R.string.notification_colorize_key),
|
||||
true))
|
||||
.setDeleteIntent(PendingIntent.getBroadcast(player.context, NOTIFICATION_ID,
|
||||
new Intent(ACTION_CLOSE), FLAG_UPDATE_CURRENT));
|
||||
|
||||
|
||||
@@ -1,10 +1,19 @@
|
||||
package org.schabi.newpipe.settings
|
||||
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import androidx.preference.Preference
|
||||
import org.schabi.newpipe.R
|
||||
|
||||
class NotificationSettingsFragment : BasePreferenceFragment() {
|
||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
addPreferencesFromResource(R.xml.notification_settings)
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
||||
val colorizePref: Preference? = findPreference(getString(R.string.notification_colorize_key))
|
||||
colorizePref?.let {
|
||||
preferenceScreen.removePreference(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user