Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
android:theme="@style/Theme.AppSplash">
<intent-filter>
Expand Down Expand Up @@ -44,9 +45,20 @@
</intent-filter>
</activity>

<service
android:name=".AppLaunchTileService"
android:exported="true"
android:icon="@drawable/credit_card"
android:label="@string/quick_settings_tile_label"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
</service>

<meta-data
android:name="com.google.mlkit.vision.DEPENDENCIES"
android:value="barcode_ui" />
</application>

</manifest>
</manifest>
30 changes: 30 additions & 0 deletions app/src/main/java/de/pawcode/cardstore/AppLaunchTileService.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package de.pawcode.cardstore

import android.app.PendingIntent
import android.content.Intent
import android.os.Build
import android.service.quicksettings.TileService

class AppLaunchTileService : TileService() {
override fun onClick() {
super.onClick()

val launchIntent =
Intent(this, MainActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description claims this code uses FLAG_ACTIVITY_CLEAR_TOP but the actual implementation only uses FLAG_ACTIVITY_NEW_TASK. Since MainActivity is configured with launchMode="singleTask" in the manifest, the current approach will work correctly - singleTask mode automatically clears activities above it in the task. However, the PR description should be updated to match the actual implementation, or if FLAG_ACTIVITY_CLEAR_TOP was intentionally omitted, this should be documented.

Copilot uses AI. Check for mistakes.
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
startActivityAndCollapse(
PendingIntent.getActivity(
this,
0,
launchIntent,
PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT,
),
)
} else {
@Suppress("DEPRECATION") startActivityAndCollapse(launchIntent)
}
}
}
1 change: 1 addition & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
<string name="playstore">Im Play Store anzeigen</string>
<string name="playstore_description">App bewerten und rezensieren</string>
<string name="report_issue">Ein Problem entdeckt?</string>
<string name="quick_settings_tile_label">CardStore öffnen</string>
<string name="scan_barcode">Barcode scannen</string>
<string name="scan_error">Fehler beim Scannen</string>
<string name="settings">Einstellungen</string>
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<string name="playstore">View in Play Store</string>
<string name="playstore_description">Rate and review the app</string>
<string name="report_issue">Report an issue</string>
<string name="quick_settings_tile_label">Open CardStore</string>
<string name="scan_barcode">Scan barcode</string>
<string name="scan_error">Error while trying to scan barcode</string>
<string name="settings">App settings</string>
Expand All @@ -85,4 +86,4 @@
<string name="version">Version</string>
<string name="website">Visit website</string>
<string name="website_link"><![CDATA[https://pawcode.de/?mtm_campaign=CardStore&mtm_kwd=About&mtm_source=App]]></string>
</resources>
</resources>