Skip to content

Commit 9f8b340

Browse files
committed
Tweak notification to look nice on Android 6ish too
1 parent 4f23b44 commit 9f8b340

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/src/main/java/tech/httptoolkit/android/ProxyVpnService.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,11 @@ class ProxyVpnService : VpnService(), IProtectSocket {
114114

115115
val notification: Notification = NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
116116
.setContentIntent(pendingActivityIntent)
117-
.setContentTitle(getString(R.string.vpn_active_notification_content))
117+
.setContentTitle(getString(R.string.vpn_active_notification_title))
118+
.setContentText(getString(R.string.vpn_active_notification_content))
118119
.setSmallIcon(R.drawable.ic_transparent_icon)
119120
.setLargeIcon(BitmapFactory.decodeResource(resources, R.drawable.ic_transparent_icon))
120-
.addAction(R.drawable.ic_transparent_icon, getString(R.string.vpn_active_notification_action), pendingServiceIntent)
121+
.addAction(0, getString(R.string.vpn_active_notification_action), pendingServiceIntent)
121122
.build()
122123

123124
startForeground(NOTIFICATION_ID, notification)

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<resources>
22
<string name="app_name">HTTP Toolkit</string>
33

4+
<string name="vpn_active_notification_title">Interception active</string>
45
<string name="vpn_active_notification_content">HTTP Toolkit is currently intercepting this device</string>
56
<string name="vpn_active_notification_action">Stop intercepting</string>
67

0 commit comments

Comments
 (0)