-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat]: brand color in notification on older versions
- Loading branch information
Showing
6 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
app/src/main/java/com/f0x1d/logfox/extensions/notifications/NotificationBuilderExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.f0x1d.logfox.extensions.notifications | ||
|
||
import android.content.Context | ||
import androidx.core.app.NotificationCompat | ||
import com.f0x1d.logfox.R | ||
import com.f0x1d.logfox.extensions.notificationsDynamicColorAvailable | ||
|
||
fun NotificationCompat.Builder.applyPrimaryColorIfNeeded(context: Context): NotificationCompat.Builder { | ||
if (!notificationsDynamicColorAvailable) color = context.getColor(R.color.color_primary) | ||
return this | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="color_primary">#F78D1E</color> | ||
<color name="black">#FF000000</color> | ||
<color name="white">#FFFFFFFF</color> | ||
|
||
<color name="transparent_black">#40000000</color> | ||
|
||
<color name="ic_launcher_background">@color/white</color> | ||
<color name="ic_launcher_foreground">#F78D1E</color> | ||
<color name="ic_launcher_foreground">@color/color_primary</color> | ||
|
||
<color name="card_stroke_color">#ffdadce0</color> | ||
</resources> |