Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Briar Mailbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
briar
Briar Mailbox
Commits
b436adeb
Commit
b436adeb
authored
3 years ago
by
Sebastian
Browse files
Options
Downloads
Patches
Plain Diff
Move strings for notification and channel to strings.xml
parent
103c93e7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Basic project setup
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mailbox/src/main/java/org/briarproject/mailbox/MailboxService.kt
+2
-4
2 additions, 4 deletions
.../src/main/java/org/briarproject/mailbox/MailboxService.kt
mailbox/src/main/res/values/strings.xml
+2
-0
2 additions, 0 deletions
mailbox/src/main/res/values/strings.xml
with
4 additions
and
4 deletions
mailbox/src/main/java/org/briarproject/mailbox/MailboxService.kt
+
2
−
4
View file @
b436adeb
...
...
@@ -18,11 +18,9 @@ class MailboxService : Service() {
companion
object
{
private
const
val
CHANNEL_ID
=
"Briar Mailbox Service"
private
const
val
CHANNEL_NAME
=
"Briar Mailbox Channel"
private
const
val
ARG_MESSAGE
=
"message"
private
const
val
NOTIFICATION_MAIN_ID
=
1
private
const
val
NOTIFICATION_MAIN_TITLE
=
"Briar Mailbox running"
fun
startService
(
context
:
Context
,
message
:
String
)
{
val
startIntent
=
Intent
(
context
,
MailboxService
::
class
.
java
)
...
...
@@ -45,7 +43,7 @@ class MailboxService : Service() {
)
val
notification
=
NotificationCompat
.
Builder
(
this
,
CHANNEL_ID
)
.
setContentTitle
(
NOTIFICATION_MAIN_TITLE
)
.
setContentTitle
(
getString
(
R
.
string
.
notification_mailbox_running
)
)
.
setContentText
(
input
)
.
setSmallIcon
(
R
.
drawable
.
ic_launcher_foreground
)
.
setContentIntent
(
pendingIntent
)
...
...
@@ -62,7 +60,7 @@ class MailboxService : Service() {
private
fun
createNotificationChannel
()
{
if
(
VERSION
.
SDK_INT
>=
VERSION_CODES
.
O
)
{
val
serviceChannel
=
NotificationChannel
(
CHANNEL_ID
,
CHANNEL_NAME
,
CHANNEL_ID
,
getString
(
R
.
string
.
notification_channel_name
)
,
NotificationManager
.
IMPORTANCE_DEFAULT
)
...
...
This diff is collapsed.
Click to expand it.
mailbox/src/main/res/values/strings.xml
+
2
−
0
View file @
b436adeb
<resources>
<string
name=
"app_name"
>
Briar Mailbox
</string>
<string
name=
"notification_channel_name"
>
Briar Mailbox Channel
</string>
<string
name=
"notification_mailbox_running"
>
Briar Mailbox running
</string>
</resources>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment