fix: Prevent UnsupportedOperationException in PachliTileService (#288)

Previous code always called `startActivityAndCollapse()` with a regular
intent, which triggers an `UnsupportedOperationException` at API 34.

Use the non-deprecated variant that uses pending intents when
appropriate.

While looking at this I noticed the icon for the tile was incorrect, so
replaced that with the notification icon.
This commit is contained in:
Nik Clayton 2023-12-02 14:24:29 +01:00 committed by GitHub
parent d2ef0b0713
commit f9fb0e87b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 170 additions and 182 deletions

View File

@ -634,17 +634,6 @@
column="32"/>
</issue>
<issue
id="Typos"
message="&quot;caracter&quot; is a common misspelling; did you mean &quot;carácter&quot;?"
errorLine1="\n(Límite de %d caracter)&lt;/item>"
errorLine2=" ^">
<location
file="src/main/res/values-es/strings.xml"
line="256"
column="17"/>
</issue>
<issue
id="Typos"
message="&quot;Media&quot; is a common misspelling; did you mean &quot;Medier&quot;?"
@ -718,7 +707,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="115"
line="107"
column="5"/>
</issue>
@ -729,7 +718,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="339"
line="312"
column="5"/>
</issue>
@ -740,7 +729,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="396"
line="361"
column="5"/>
</issue>
@ -751,7 +740,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="569"
line="511"
column="5"/>
</issue>
@ -762,7 +751,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="784"
line="697"
column="5"/>
</issue>
@ -1261,17 +1250,6 @@
column="27"/>
</issue>
<issue
id="VectorPath"
message="Very long vector path (2052 characters), which is bad for performance. Considering reducing precision, removing minor details or rasterizing vector."
errorLine1=" android:pathData=&quot;M240,0A240,240 0,0 0,0 240A240,240 0,0 0,240 480A240,240 0,0 0,480 240A240,240 0,0 0,240 0zM261.77,69.69C262.51,69.69 263.25,69.78 263.99,69.96C279.07,73.56 293.35,79.6 306.45,87.7C309.08,89.32 310.99,92.09 311.71,95.34C312.42,98.59 311.9,102.02 310.25,104.82C301.19,120.19 284.38,148.7 275.67,163.46C272.7,168.5 266.84,170.32 261.95,167.72C258.23,165.72 254.32,164.08 250.27,162.84C245.06,161.22 241.72,155.57 242.46,149.61C244.6,132.11 248.76,98.32 251,80.1C251.41,76.78 253.04,73.8 255.5,71.88C257.35,70.43 259.55,69.68 261.77,69.69zM194.32,83.56C196.55,83.39 198.78,83.99 200.72,85.3C203.3,87.05 205.1,89.92 205.69,93.22C208.48,108.82 213.24,135.51 215.91,150.49C216.96,156.39 213.94,162.25 208.82,164.22C204.85,165.73 201.04,167.63 197.42,169.87C192.68,172.79 186.74,171.36 183.5,166.53C175.3,154.29 160.68,132.49 152.15,119.74C150.34,117.05 149.63,113.63 150.19,110.33C150.74,107.02 152.52,104.12 155.08,102.34C166.46,94.4 178.9,88.18 192.12,84C192.84,83.77 193.58,83.62 194.32,83.56zM342.83,145.33C343.58,145.3 344.33,145.35 345.07,145.49C348.05,146.05 350.69,147.98 352.34,150.79C359.67,163.33 365.48,177.06 369.47,191.67C370.35,194.89 369.98,198.37 368.45,201.27C366.92,204.17 364.37,206.22 361.41,206.94C347.44,210.32 323.54,216.08 310.13,219.31C304.85,220.58 299.53,217.32 297.67,211.67C296.25,207.27 294.48,203.06 292.4,199.08C289.69,193.86 290.87,187.22 295.15,183.54C306,174.19 325.34,157.56 336.64,147.84C338.44,146.29 340.6,145.43 342.83,145.33zM205.43,211.01C207.63,210.96 209.69,212.17 210.88,214.23C215.56,222.22 222.11,233.48 225.95,240.1C227.83,243.33 231.4,244.79 234.7,243.66C241.1,241.49 251.83,237.85 260.62,234.87C263.04,234.05 265.66,234.89 267.31,237.03C268.95,239.17 269.3,242.18 268.2,244.71C262.96,256.75 257.62,271.2 255.1,284.02C246.96,325.56 287.23,341.85 304.47,386.83C304.81,387.69 305.12,388.56 305.43,389.42C289.76,398.91 272.35,405.52 253.67,408.52C235.31,411.47 217.23,410.7 200.05,406.71C191.6,368.52 171.27,321.18 181.63,261.74C184.41,245.8 193.97,226.04 200.11,214.5C201.22,212.39 203.23,211.07 205.43,211.01z&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/drawable/ic_quicksettings.xml"
line="4"
column="27"/>
</issue>
<issue
id="Overdraw"
message="Possible overdraw: Root element paints background `@color/black` with a theme that also paints a background (inferred theme is `@style/AppTheme`)"
@ -1477,7 +1455,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/dimens.xml"
line="6"
line="8"
column="12"/>
</issue>
@ -1488,7 +1466,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/donottranslate.xml"
line="52"
line="53"
column="19"/>
</issue>
@ -1499,7 +1477,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/donottranslate.xml"
line="293"
line="294"
column="19"/>
</issue>
@ -1510,7 +1488,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/donottranslate.xml"
line="298"
line="299"
column="19"/>
</issue>
@ -1653,7 +1631,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="27"
line="25"
column="13"/>
</issue>
@ -1664,7 +1642,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="38"
line="35"
column="13"/>
</issue>
@ -1675,7 +1653,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="48"
line="45"
column="13"/>
</issue>
@ -1686,7 +1664,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="96"
line="90"
column="13"/>
</issue>
@ -1697,7 +1675,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="104"
line="97"
column="13"/>
</issue>
@ -1708,7 +1686,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="118"
line="109"
column="13"/>
</issue>
@ -1719,7 +1697,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="127"
line="117"
column="13"/>
</issue>
@ -1730,7 +1708,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="167"
line="157"
column="13"/>
</issue>
@ -1741,7 +1719,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="232"
line="217"
column="13"/>
</issue>
@ -1752,7 +1730,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="272"
line="250"
column="13"/>
</issue>
@ -1763,7 +1741,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="273"
line="251"
column="13"/>
</issue>
@ -1774,7 +1752,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="298"
line="274"
column="13"/>
</issue>
@ -1785,7 +1763,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="329"
line="302"
column="13"/>
</issue>
@ -1796,7 +1774,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="409"
line="372"
column="13"/>
</issue>
@ -1807,7 +1785,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="466"
line="424"
column="13"/>
</issue>
@ -1818,7 +1796,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="517"
line="471"
column="13"/>
</issue>
@ -1829,7 +1807,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="521"
line="475"
column="13"/>
</issue>
@ -1840,7 +1818,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="522"
line="476"
column="13"/>
</issue>
@ -1851,7 +1829,7 @@
errorLine2=" ~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="523"
line="477"
column="13"/>
</issue>
@ -1862,7 +1840,7 @@
errorLine2=" ~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="524"
line="478"
column="13"/>
</issue>
@ -1873,7 +1851,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="525"
line="479"
column="13"/>
</issue>
@ -1884,7 +1862,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="526"
line="480"
column="13"/>
</issue>
@ -1895,7 +1873,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="527"
line="481"
column="13"/>
</issue>
@ -1906,7 +1884,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="528"
line="482"
column="13"/>
</issue>
@ -1917,7 +1895,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="530"
line="483"
column="13"/>
</issue>
@ -1928,7 +1906,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="608"
line="549"
column="13"/>
</issue>
@ -1939,7 +1917,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="609"
line="550"
column="13"/>
</issue>
@ -1950,7 +1928,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="624"
line="563"
column="13"/>
</issue>
@ -1961,7 +1939,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="626"
line="564"
column="13"/>
</issue>
@ -1972,7 +1950,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="627"
line="565"
column="13"/>
</issue>
@ -1983,7 +1961,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="630"
line="567"
column="13"/>
</issue>
@ -1994,7 +1972,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="675"
line="607"
column="13"/>
</issue>
@ -2005,7 +1983,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="723"
line="650"
column="13"/>
</issue>
@ -2016,7 +1994,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="729"
line="656"
column="13"/>
</issue>
@ -2027,7 +2005,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="772"
line="688"
column="13"/>
</issue>
@ -2038,7 +2016,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/strings.xml"
line="807"
line="716"
column="13"/>
</issue>
@ -2049,7 +2027,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/styles.xml"
line="126"
line="127"
column="12"/>
</issue>
@ -2060,7 +2038,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values/styles.xml"
line="164"
line="165"
column="12"/>
</issue>
@ -2423,7 +2401,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/app/pachli/components/compose/ComposeActivity.kt"
line="537"
line="547"
column="21"/>
</issue>
@ -2434,7 +2412,7 @@
errorLine2=" ~~~~~~~~~">
<location
file="src/main/java/app/pachli/components/compose/ComposeActivity.kt"
line="546"
line="556"
column="17"/>
</issue>
@ -2445,7 +2423,7 @@
errorLine2=" ~~~~~~~~~">
<location
file="src/main/java/app/pachli/components/compose/ComposeActivity.kt"
line="546"
line="556"
column="17"/>
</issue>
@ -2984,7 +2962,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="243"
line="244"
column="37"/>
</issue>
@ -2995,7 +2973,7 @@
errorLine2=" ~~~~~~~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="247"
line="248"
column="37"/>
</issue>
@ -3006,7 +2984,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="351"
line="352"
column="25"/>
</issue>
@ -3017,7 +2995,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="352"
line="353"
column="29"/>
</issue>
@ -3028,7 +3006,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="354"
line="355"
column="25"/>
</issue>
@ -3039,7 +3017,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="355"
line="356"
column="29"/>
</issue>
@ -3050,7 +3028,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="622"
line="638"
column="17"/>
</issue>
@ -3061,7 +3039,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="625"
line="641"
column="21"/>
</issue>
@ -3072,51 +3050,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="630"
column="17"/>
</issue>
<issue
id="SyntheticAccessor"
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
errorLine1=" onClick = {"
errorLine2=" ~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="634"
column="21"/>
</issue>
<issue
id="SyntheticAccessor"
message="Access to `private` method `primaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
errorLine1=" primaryDrawerItem {"
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="639"
column="17"/>
</issue>
<issue
id="SyntheticAccessor"
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
errorLine1=" onClick = {"
errorLine2=" ~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="642"
column="21"/>
</issue>
<issue
id="SyntheticAccessor"
message="Access to `private` method `primaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
errorLine1=" primaryDrawerItem {"
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="647"
line="646"
column="17"/>
</issue>
@ -3160,7 +3094,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="662"
line="663"
column="17"/>
</issue>
@ -3171,7 +3105,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="665"
line="666"
column="21"/>
</issue>
@ -3182,7 +3116,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="670"
line="671"
column="17"/>
</issue>
@ -3193,7 +3127,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="673"
line="674"
column="21"/>
</issue>
@ -3204,7 +3138,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="677"
line="678"
column="17"/>
</issue>
@ -3221,12 +3155,12 @@
<issue
id="SyntheticAccessor"
message="Access to `private` method `secondaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
errorLine1=" secondaryDrawerItem {"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
message="Access to `private` method `primaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
errorLine1=" primaryDrawerItem {"
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="690"
line="686"
column="17"/>
</issue>
@ -3237,18 +3171,18 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="693"
line="689"
column="21"/>
</issue>
<issue
id="SyntheticAccessor"
message="Access to `private` method `secondaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
errorLine1=" secondaryDrawerItem {"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
message="Access to `private` method `primaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
errorLine1=" primaryDrawerItem {"
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="698"
line="693"
column="17"/>
</issue>
@ -3259,7 +3193,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="701"
line="697"
column="21"/>
</issue>
@ -3299,7 +3233,7 @@
<issue
id="SyntheticAccessor"
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
errorLine1=" onClick = ::logout"
errorLine1=" onClick = {"
errorLine2=" ~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
@ -3309,34 +3243,12 @@
<issue
id="SyntheticAccessor"
message="Access to `private` method `primaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
errorLine1=" primaryDrawerItem {"
errorLine2=" ~~~~~~~~~~~~~~~~~">
message="Access to `private` method `secondaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
errorLine1=" secondaryDrawerItem {"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="724"
column="21"/>
</issue>
<issue
id="SyntheticAccessor"
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
errorLine1=" onClick = {"
errorLine2=" ~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="727"
column="25"/>
</issue>
<issue
id="SyntheticAccessor"
message="Access to `private` method `primaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
errorLine1=" primaryDrawerItem {"
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="736"
line="722"
column="17"/>
</issue>
@ -3347,7 +3259,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="739"
line="725"
column="21"/>
</issue>
@ -3356,6 +3268,50 @@
message="Access to `private` method `secondaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
errorLine1=" secondaryDrawerItem {"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="730"
column="17"/>
</issue>
<issue
id="SyntheticAccessor"
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
errorLine1=" onClick = ::logout"
errorLine2=" ~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="733"
column="21"/>
</issue>
<issue
id="SyntheticAccessor"
message="Access to `private` method `primaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
errorLine1=" primaryDrawerItem {"
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="740"
column="21"/>
</issue>
<issue
id="SyntheticAccessor"
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
errorLine1=" onClick = {"
errorLine2=" ~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="743"
column="25"/>
</issue>
<issue
id="SyntheticAccessor"
message="Access to `private` method `primaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
errorLine1=" primaryDrawerItem {"
errorLine2=" ~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="752"
@ -3369,7 +3325,29 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="756"
line="755"
column="21"/>
</issue>
<issue
id="SyntheticAccessor"
message="Access to `private` method `secondaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
errorLine1=" secondaryDrawerItem {"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="768"
column="17"/>
</issue>
<issue
id="SyntheticAccessor"
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
errorLine1=" onClick = {"
errorLine2=" ~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="772"
column="21"/>
</issue>
@ -3380,7 +3358,7 @@
errorLine2=" ~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="877"
line="897"
column="17"/>
</issue>
@ -3391,7 +3369,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="879"
line="899"
column="17"/>
</issue>
@ -3402,7 +3380,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/app/pachli/MainActivity.kt"
line="890"
line="910"
column="17"/>
</issue>

View File

@ -189,7 +189,7 @@
<service
android:name=".service.PachliTileService"
android:icon="@drawable/ic_quicksettings"
android:icon="@drawable/ic_notify"
android:label="@string/pachli_compose_post_quicksetting_label"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"
android:exported="true"

View File

@ -16,23 +16,39 @@
package app.pachli.service
import android.annotation.SuppressLint
import android.annotation.TargetApi
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.os.Build
import android.service.quicksettings.TileService
import app.pachli.MainActivity
import app.pachli.components.compose.ComposeActivity
import app.pachli.components.notifications.pendingIntentFlags
/**
* Small Addition that adds in a QuickSettings tile
* opens the Compose activity or shows an account selector when multiple accounts are present
*/
@TargetApi(24)
class PachliTileService : TileService() {
@SuppressLint("StartActivityAndCollapseDeprecated")
override fun onClick() {
val intent = MainActivity.composeIntent(this, ComposeActivity.ComposeOptions())
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
startActivityAndCollapse(intent)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
startActivityAndCollapse(getActivityPendingIntent(this, 0, intent))
} else {
startActivityAndCollapse(intent)
}
}
private fun getActivityPendingIntent(context: Context, requestCode: Int, intent: Intent): PendingIntent {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
PendingIntent.getActivity(context, requestCode, intent, pendingIntentFlags(false))
} else {
PendingIntent.getActivity(context, requestCode, intent, pendingIntentFlags(false))
}
}
}

View File

@ -1,6 +0,0 @@
<vector android:height="24dp" android:viewportHeight="480"
android:viewportWidth="480" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#000000"
android:pathData="M240,0A240,240 0,0 0,0 240A240,240 0,0 0,240 480A240,240 0,0 0,480 240A240,240 0,0 0,240 0zM261.77,69.69C262.51,69.69 263.25,69.78 263.99,69.96C279.07,73.56 293.35,79.6 306.45,87.7C309.08,89.32 310.99,92.09 311.71,95.34C312.42,98.59 311.9,102.02 310.25,104.82C301.19,120.19 284.38,148.7 275.67,163.46C272.7,168.5 266.84,170.32 261.95,167.72C258.23,165.72 254.32,164.08 250.27,162.84C245.06,161.22 241.72,155.57 242.46,149.61C244.6,132.11 248.76,98.32 251,80.1C251.41,76.78 253.04,73.8 255.5,71.88C257.35,70.43 259.55,69.68 261.77,69.69zM194.32,83.56C196.55,83.39 198.78,83.99 200.72,85.3C203.3,87.05 205.1,89.92 205.69,93.22C208.48,108.82 213.24,135.51 215.91,150.49C216.96,156.39 213.94,162.25 208.82,164.22C204.85,165.73 201.04,167.63 197.42,169.87C192.68,172.79 186.74,171.36 183.5,166.53C175.3,154.29 160.68,132.49 152.15,119.74C150.34,117.05 149.63,113.63 150.19,110.33C150.74,107.02 152.52,104.12 155.08,102.34C166.46,94.4 178.9,88.18 192.12,84C192.84,83.77 193.58,83.62 194.32,83.56zM342.83,145.33C343.58,145.3 344.33,145.35 345.07,145.49C348.05,146.05 350.69,147.98 352.34,150.79C359.67,163.33 365.48,177.06 369.47,191.67C370.35,194.89 369.98,198.37 368.45,201.27C366.92,204.17 364.37,206.22 361.41,206.94C347.44,210.32 323.54,216.08 310.13,219.31C304.85,220.58 299.53,217.32 297.67,211.67C296.25,207.27 294.48,203.06 292.4,199.08C289.69,193.86 290.87,187.22 295.15,183.54C306,174.19 325.34,157.56 336.64,147.84C338.44,146.29 340.6,145.43 342.83,145.33zM205.43,211.01C207.63,210.96 209.69,212.17 210.88,214.23C215.56,222.22 222.11,233.48 225.95,240.1C227.83,243.33 231.4,244.79 234.7,243.66C241.1,241.49 251.83,237.85 260.62,234.87C263.04,234.05 265.66,234.89 267.31,237.03C268.95,239.17 269.3,242.18 268.2,244.71C262.96,256.75 257.62,271.2 255.1,284.02C246.96,325.56 287.23,341.85 304.47,386.83C304.81,387.69 305.12,388.56 305.43,389.42C289.76,398.91 272.35,405.52 253.67,408.52C235.31,411.47 217.23,410.7 200.05,406.71C191.6,368.52 171.27,321.18 181.63,261.74C184.41,245.8 193.97,226.04 200.11,214.5C201.22,212.39 203.23,211.07 205.43,211.01z"
android:strokeColor="#ed0000" android:strokeWidth="0"/>
</vector>