Skip to content

Commit

Permalink
#1886 Support for themed icons
Browse files Browse the repository at this point in the history
  • Loading branch information
sictiru committed Nov 12, 2024
1 parent adfdb55 commit 80fb506
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clients/android/NewsBlur/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backupscheme"
android:fullBackupOnly="true"
android:icon="@drawable/logo"
android:icon="@mipmap/ic_launcher"
android:label="@string/newsblur"
android:theme="@style/Theme.MaterialComponents.DayNight.NoActionBar">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private static Notification buildStoryNotification(Story story, Cursor cursor, C
NotificationCompat.Builder nb = new NotificationCompat.Builder(context, context.getString(R.string.story_notification_channel_id))
.setContentTitle(title.toString())
.setContentText(story.shortContent)
.setSmallIcon(R.drawable.logo_monochrome)
.setSmallIcon(R.drawable.ic_logo_monochrome)
.setContentIntent(pendingIntent)
.setDeleteIntent(dismissPendingIntent)
.setAutoCancel(true)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="48dp"
android:height="48dp"
android:viewportWidth="432"
android:viewportHeight="432">

<path android:pathData="M0,0h432v432h-432z">

<aapt:attr name="android:fillColor">

<gradient
android:endX="216"
android:endY="432"
android:startX="216"
android:startY="0"
android:type="linear">

<item
android:color="#FFE6A33F"
android:offset="0" />

<item
android:color="#FFC35F28"
android:offset="1" />

</gradient>

</aapt:attr>

</path>

</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="48dp"
android:height="48dp"
android:viewportWidth="432"
android:viewportHeight="432">

<path
android:fillType="evenOdd"
android:pathData="M237.9,135.78L243.89,148.68L257.15,143.83C270.23,151.34 281.11,162.28 288.54,175.42L283.74,188.53L296.37,194.4C298.31,201.45 299.34,208.88 299.34,216.55C299.34,224.35 298.27,231.9 296.27,239.07L283.74,244.89L288.46,257.8C280.97,271 270,281.97 256.8,289.46L243.89,284.74L238.07,297.27C230.9,299.27 223.35,300.34 215.55,300.34C207.88,300.34 200.45,299.31 193.39,297.37L187.53,284.74L174.42,289.54C161.28,282.11 150.34,271.23 142.83,258.15L147.68,244.89L134.78,238.9C132.8,231.78 131.75,224.28 131.75,216.55C131.75,208.94 132.77,201.58 134.67,194.57L147.68,188.53L142.75,175.07C150.2,162.05 161.04,151.2 174.07,143.75L187.53,148.68L193.57,135.67C200.57,133.77 207.94,132.75 215.55,132.75C223.28,132.75 230.78,133.8 237.9,135.78ZM263.87,141.37C274.76,148.4 284.04,157.73 291.01,168.67L295.09,157.49C289.4,149.84 282.62,143.03 275,137.3L263.87,141.37ZM302.88,197.42L313.65,202.42C314.31,207.03 314.65,211.75 314.65,216.55C314.65,221.46 314.29,226.3 313.6,231.02L302.8,236.04C304.2,229.76 304.94,223.24 304.94,216.55C304.94,209.98 304.23,203.58 302.88,197.42ZM321.27,216.55C321.27,220.32 321.07,224.06 320.68,227.74L330.49,223.18C330.61,220.99 330.68,218.77 330.68,216.55C330.68,214.43 330.62,212.33 330.51,210.25L320.71,205.7C321.08,209.27 321.27,212.88 321.27,216.55ZM304.48,131.84L306.72,125.7L300.59,127.94C301.2,128.52 301.8,129.11 302.39,129.7C303.1,130.41 303.79,131.12 304.48,131.84ZM218.39,93.76L215.71,88L213.04,93.75C213.87,93.74 214.71,93.73 215.55,93.73C216.49,93.73 217.44,93.74 218.39,93.76ZM209.4,101.58C211.44,101.47 213.49,101.42 215.55,101.42C217.72,101.42 219.88,101.47 222.02,101.6L226.57,111.4C222.95,111.02 219.27,110.82 215.55,110.82C211.94,110.82 208.38,111.01 204.86,111.36L209.4,101.58ZM138.75,130.84L148.89,134.54C143.27,139.12 138.12,144.27 133.54,149.89L129.84,139.75C132.65,136.62 135.62,133.65 138.75,130.84ZM130.59,127.85L124.7,125.7L126.85,131.59C127.46,130.95 128.08,130.32 128.7,129.7C129.32,129.08 129.96,128.46 130.59,127.85ZM292.43,130.92C295.62,133.78 298.64,136.82 301.49,140.01L297.77,150.17C293.17,144.47 287.98,139.26 282.31,134.63L292.43,130.92ZM338.33,213.88C338.35,214.77 338.36,215.66 338.36,216.55C338.36,217.55 338.35,218.54 338.33,219.54L344.42,216.71L338.33,213.88ZM301.4,293.17L297.69,283.03C293.03,288.78 287.78,294.03 282.03,298.69L292.17,302.4C295.42,299.5 298.5,296.42 301.4,293.17ZM300.35,305.39C301.03,304.73 301.71,304.07 302.39,303.39C303.07,302.71 303.73,302.03 304.39,301.35L306.72,307.72L300.35,305.39ZM222.18,331.49L226.74,321.68C223.06,322.07 219.32,322.27 215.55,322.27C211.88,322.27 208.27,322.08 204.7,321.71L209.25,331.51C211.33,331.62 213.43,331.68 215.55,331.68C217.77,331.68 219.99,331.61 222.18,331.49ZM212.88,339.33C213.77,339.35 214.66,339.36 215.55,339.36C216.55,339.36 217.54,339.35 218.54,339.33L215.71,345.42L212.88,339.33ZM139.01,302.49L149.17,298.77C143.47,294.17 138.26,288.98 133.63,283.31L129.92,293.43C132.78,296.62 135.82,299.64 139.01,302.49ZM100.6,223.02C100.48,220.88 100.42,218.72 100.42,216.55C100.42,214.49 100.47,212.44 100.58,210.4L110.36,205.86C110.01,209.38 109.82,212.94 109.82,216.55C109.82,220.27 110.02,223.95 110.4,227.58L100.6,223.02ZM92.75,214.04L87,216.71L92.76,219.39C92.74,218.44 92.73,217.49 92.73,216.54C92.73,215.71 92.74,214.87 92.75,214.04ZM126.94,301.59C127.52,302.2 128.11,302.8 128.7,303.39C129.41,304.1 130.12,304.79 130.84,305.48L124.7,307.72L126.94,301.59ZM290.93,264.54L295.01,275.7C289.26,283.41 282.41,290.26 274.7,296.01L263.54,291.93C274.54,284.9 283.9,275.54 290.93,264.54ZM235.04,303.79L230.02,314.6C225.3,315.29 220.46,315.65 215.55,315.65C210.75,315.65 206.03,315.31 201.42,314.65L196.41,303.88C202.58,305.22 208.98,305.94 215.55,305.94C222.24,305.94 228.76,305.2 235.04,303.79ZM167.67,292.01L156.5,296.09C148.84,290.4 142.03,283.62 136.3,276L140.37,264.87C147.4,275.76 156.73,285.04 167.67,292.01ZM128.26,235.87L117.47,230.86C116.79,226.19 116.44,221.41 116.44,216.55C116.44,211.81 116.78,207.15 117.42,202.58L128.18,197.59C126.85,203.7 126.16,210.04 126.16,216.55C126.16,223.18 126.88,229.65 128.26,235.87ZM167.34,141.29L156.2,137.22C148.63,142.9 141.9,149.63 136.22,157.2L140.29,168.34C147.26,157.51 156.51,148.26 167.34,141.29ZM215.55,117.44C210.81,117.44 206.15,117.78 201.58,118.42L196.59,129.18C202.7,127.85 209.04,127.16 215.55,127.16C222.18,127.16 228.65,127.88 234.87,129.26L229.86,118.47C225.19,117.79 220.41,117.44 215.55,117.44ZM215.55,283.71C178.51,283.71 148.38,253.58 148.38,216.55C148.38,179.51 178.51,149.38 215.55,149.38C252.58,149.38 282.71,179.51 282.71,216.55C282.71,253.58 252.58,283.71 215.55,283.71ZM215.55,160.48C184.63,160.48 159.48,185.63 159.48,216.55C159.48,247.46 184.63,272.61 215.55,272.61C246.46,272.61 271.61,247.46 271.61,216.55C271.61,185.63 246.46,160.48 215.55,160.48Z">

<aapt:attr name="android:fillColor">

<gradient
android:endX="124.5"
android:endY="52"
android:startX="252.5"
android:startY="276.5"
android:type="linear">

<item
android:color="#FFEEDA5C"
android:offset="0" />

<item
android:color="#FFF0DE81"
android:offset="0.23" />

<item
android:color="#FFF2E19C"
android:offset="0.45" />

<item
android:color="#FFF3E3B0"
android:offset="0.66" />

<item
android:color="#FFF4E5BC"
android:offset="0.85" />

<item
android:color="#FFF3E3AA"
android:offset="1" />

</gradient>

</aapt:attr>

</path>

</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="432"
android:viewportHeight="432">
<path
android:fillColor="#ffffff"
android:fillType="evenOdd"
android:pathData="M237.9,135.78L243.89,148.68L257.15,143.83C270.23,151.34 281.11,162.28 288.54,175.42L283.74,188.53L296.37,194.4C298.31,201.45 299.34,208.88 299.34,216.55C299.34,224.35 298.27,231.9 296.27,239.07L283.74,244.89L288.46,257.8C280.97,271 270,281.97 256.8,289.46L243.89,284.74L238.07,297.27C230.9,299.27 223.35,300.34 215.55,300.34C207.88,300.34 200.45,299.31 193.39,297.37L187.53,284.74L174.42,289.54C161.28,282.11 150.34,271.23 142.83,258.15L147.68,244.89L134.78,238.9C132.8,231.78 131.75,224.28 131.75,216.55C131.75,208.94 132.77,201.58 134.67,194.57L147.68,188.53L142.75,175.07C150.2,162.05 161.04,151.2 174.07,143.75L187.53,148.68L193.57,135.67C200.57,133.77 207.94,132.75 215.55,132.75C223.28,132.75 230.78,133.8 237.9,135.78ZM263.87,141.37C274.76,148.4 284.04,157.73 291.01,168.67L295.09,157.49C289.4,149.84 282.62,143.03 275,137.3L263.87,141.37ZM302.88,197.42L313.65,202.42C314.31,207.03 314.65,211.75 314.65,216.55C314.65,221.46 314.29,226.3 313.6,231.02L302.8,236.04C304.2,229.76 304.94,223.24 304.94,216.55C304.94,209.98 304.23,203.58 302.88,197.42ZM321.27,216.55C321.27,220.32 321.07,224.06 320.68,227.74L330.49,223.18C330.61,220.99 330.68,218.77 330.68,216.55C330.68,214.43 330.62,212.33 330.51,210.25L320.71,205.7C321.08,209.27 321.27,212.88 321.27,216.55ZM304.48,131.84L306.72,125.7L300.59,127.94C301.2,128.52 301.8,129.11 302.39,129.7C303.1,130.41 303.79,131.12 304.48,131.84ZM218.39,93.76L215.71,88L213.04,93.75C213.87,93.74 214.71,93.73 215.55,93.73C216.49,93.73 217.44,93.74 218.39,93.76ZM209.4,101.58C211.44,101.47 213.49,101.42 215.55,101.42C217.72,101.42 219.88,101.47 222.02,101.6L226.57,111.4C222.95,111.02 219.27,110.82 215.55,110.82C211.94,110.82 208.38,111.01 204.86,111.36L209.4,101.58ZM138.75,130.84L148.89,134.54C143.27,139.12 138.12,144.27 133.54,149.89L129.84,139.75C132.65,136.62 135.62,133.65 138.75,130.84ZM130.59,127.85L124.7,125.7L126.85,131.59C127.46,130.95 128.08,130.32 128.7,129.7C129.32,129.08 129.96,128.46 130.59,127.85ZM292.43,130.92C295.62,133.78 298.64,136.82 301.49,140.01L297.77,150.17C293.17,144.47 287.98,139.26 282.31,134.63L292.43,130.92ZM338.33,213.88C338.35,214.77 338.36,215.66 338.36,216.55C338.36,217.55 338.35,218.54 338.33,219.54L344.42,216.71L338.33,213.88ZM301.4,293.17L297.69,283.03C293.03,288.78 287.78,294.03 282.03,298.69L292.17,302.4C295.42,299.5 298.5,296.42 301.4,293.17ZM300.35,305.39C301.03,304.73 301.71,304.07 302.39,303.39C303.07,302.71 303.73,302.03 304.39,301.35L306.72,307.72L300.35,305.39ZM222.18,331.49L226.74,321.68C223.06,322.07 219.32,322.27 215.55,322.27C211.88,322.27 208.27,322.08 204.7,321.71L209.25,331.51C211.33,331.62 213.43,331.68 215.55,331.68C217.77,331.68 219.99,331.61 222.18,331.49ZM212.88,339.33C213.77,339.35 214.66,339.36 215.55,339.36C216.55,339.36 217.54,339.35 218.54,339.33L215.71,345.42L212.88,339.33ZM139.01,302.49L149.17,298.77C143.47,294.17 138.26,288.98 133.63,283.31L129.92,293.43C132.78,296.62 135.82,299.64 139.01,302.49ZM100.6,223.02C100.48,220.88 100.42,218.72 100.42,216.55C100.42,214.49 100.47,212.44 100.58,210.4L110.36,205.86C110.01,209.38 109.82,212.94 109.82,216.55C109.82,220.27 110.02,223.95 110.4,227.58L100.6,223.02ZM92.75,214.04L87,216.71L92.76,219.39C92.74,218.44 92.73,217.49 92.73,216.54C92.73,215.71 92.74,214.87 92.75,214.04ZM126.94,301.59C127.52,302.2 128.11,302.8 128.7,303.39C129.41,304.1 130.12,304.79 130.84,305.48L124.7,307.72L126.94,301.59ZM290.93,264.54L295.01,275.7C289.26,283.41 282.41,290.26 274.7,296.01L263.54,291.93C274.54,284.9 283.9,275.54 290.93,264.54ZM235.04,303.79L230.02,314.6C225.3,315.29 220.46,315.65 215.55,315.65C210.75,315.65 206.03,315.31 201.42,314.65L196.41,303.88C202.58,305.22 208.98,305.94 215.55,305.94C222.24,305.94 228.76,305.2 235.04,303.79ZM167.67,292.01L156.5,296.09C148.84,290.4 142.03,283.62 136.3,276L140.37,264.87C147.4,275.76 156.73,285.04 167.67,292.01ZM128.26,235.87L117.47,230.86C116.79,226.19 116.44,221.41 116.44,216.55C116.44,211.81 116.78,207.15 117.42,202.58L128.18,197.59C126.85,203.7 126.16,210.04 126.16,216.55C126.16,223.18 126.88,229.65 128.26,235.87ZM167.34,141.29L156.2,137.22C148.63,142.9 141.9,149.63 136.22,157.2L140.29,168.34C147.26,157.51 156.51,148.26 167.34,141.29ZM215.55,117.44C210.81,117.44 206.15,117.78 201.58,118.42L196.59,129.18C202.7,127.85 209.04,127.16 215.55,127.16C222.18,127.16 228.65,127.88 234.87,129.26L229.86,118.47C225.19,117.79 220.41,117.44 215.55,117.44ZM215.55,283.71C178.51,283.71 148.38,253.58 148.38,216.55C148.38,179.51 178.51,149.38 215.55,149.38C252.58,149.38 282.71,179.51 282.71,216.55C282.71,253.58 252.58,283.71 215.55,283.71ZM215.55,160.48C184.63,160.48 159.48,185.63 159.48,216.55C159.48,247.46 184.63,272.61 215.55,272.61C246.46,272.61 271.61,247.46 271.61,216.55C271.61,185.63 246.46,160.48 215.55,160.48Z" />
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_logo_background" />
<foreground android:drawable="@drawable/ic_logo_foreground" />
<monochrome android:drawable="@drawable/ic_logo_monochrome" />
</adaptive-icon>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_logo_background" />
<foreground android:drawable="@drawable/ic_logo_foreground" />
</adaptive-icon>
4 changes: 2 additions & 2 deletions clients/android/NewsBlur/buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import org.gradle.api.JavaVersion
object Config {

const val compileSdk = 34
const val minSdk = 24
const val minSdk = 26
const val targetSdk = 34
const val versionCode = 229
const val versionName = "13.3.1"

const val androidTestInstrumentation = "androidx.test.runner.AndroidJUnitRunner"

val javaVersion = JavaVersion.VERSION_17
val javaVersion = JavaVersion.VERSION_21
}

0 comments on commit 80fb506

Please sign in to comment.