Skip to content

Commit

Permalink
Tweak notification to look nice on Android 6ish too
Browse files Browse the repository at this point in the history
  • Loading branch information
pimterry committed Feb 18, 2020
1 parent 4f23b44 commit 9f8b340
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/src/main/java/tech/httptoolkit/android/ProxyVpnService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,11 @@ class ProxyVpnService : VpnService(), IProtectSocket {

val notification: Notification = NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
.setContentIntent(pendingActivityIntent)
.setContentTitle(getString(R.string.vpn_active_notification_content))
.setContentTitle(getString(R.string.vpn_active_notification_title))
.setContentText(getString(R.string.vpn_active_notification_content))
.setSmallIcon(R.drawable.ic_transparent_icon)
.setLargeIcon(BitmapFactory.decodeResource(resources, R.drawable.ic_transparent_icon))
.addAction(R.drawable.ic_transparent_icon, getString(R.string.vpn_active_notification_action), pendingServiceIntent)
.addAction(0, getString(R.string.vpn_active_notification_action), pendingServiceIntent)
.build()

startForeground(NOTIFICATION_ID, notification)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<resources>
<string name="app_name">HTTP Toolkit</string>

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

Expand Down

0 comments on commit 9f8b340

Please sign in to comment.