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
b8ffe3e2
Verified
Commit
b8ffe3e2
authored
3 years ago
by
Sebastian
Browse files
Options
Downloads
Patches
Plain Diff
Map lifecycle/tor plugin state to translatable messages
parent
4e76bf76
No related branches found
No related tags found
1 merge request
!67
Map lifecycle/tor plugin state to translatable messages
Pipeline
#10371
passed
3 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mailbox-android/src/main/java/org/briarproject/mailbox/android/ui/MailboxViewModel.kt
+10
-2
10 additions, 2 deletions
...a/org/briarproject/mailbox/android/ui/MailboxViewModel.kt
mailbox-android/src/main/res/values/strings.xml
+4
-0
4 additions, 0 deletions
mailbox-android/src/main/res/values/strings.xml
with
14 additions
and
2 deletions
mailbox-android/src/main/java/org/briarproject/mailbox/android/ui/MailboxViewModel.kt
+
10
−
2
View file @
b8ffe3e2
...
@@ -33,6 +33,7 @@ import kotlinx.coroutines.flow.StateFlow
...
@@ -33,6 +33,7 @@ import kotlinx.coroutines.flow.StateFlow
import
kotlinx.coroutines.flow.combine
import
kotlinx.coroutines.flow.combine
import
kotlinx.coroutines.flow.flowOn
import
kotlinx.coroutines.flow.flowOn
import
org.briarproject.android.dontkillmelib.DozeHelper
import
org.briarproject.android.dontkillmelib.DozeHelper
import
org.briarproject.mailbox.R
import
org.briarproject.mailbox.android.MailboxService
import
org.briarproject.mailbox.android.MailboxService
import
org.briarproject.mailbox.android.QrCodeUtils
import
org.briarproject.mailbox.android.QrCodeUtils
import
org.briarproject.mailbox.core.lifecycle.LifecycleManager
import
org.briarproject.mailbox.core.lifecycle.LifecycleManager
...
@@ -78,9 +79,16 @@ class MailboxViewModel @Inject constructor(
...
@@ -78,9 +79,16 @@ class MailboxViewModel @Inject constructor(
val
setupState
=
combine
(
val
setupState
=
combine
(
lifecycleState
,
torPluginState
,
setupManager
.
setupComplete
lifecycleState
,
torPluginState
,
setupManager
.
setupComplete
)
{
ls
,
ts
,
sc
->
)
{
ls
,
ts
,
sc
->
val
resources
=
getApplication
<
Application
>().
resources
when
{
when
{
ls
!=
LifecycleState
.
RUNNING
->
Starting
(
ls
.
name
)
ls
!=
LifecycleState
.
RUNNING
->
Starting
(
ts
!=
TorPlugin
.
State
.
PUBLISHED
->
Starting
(
ts
.
name
+
" TOR"
)
resources
.
getString
(
R
.
string
.
startup_starting_services
)
)
ts
!=
TorPlugin
.
State
.
PUBLISHED
->
when
{
ts
<
TorPlugin
.
State
.
ACTIVE
->
Starting
(
resources
.
getString
(
R
.
string
.
startup_starting_tor
))
else
->
Starting
(
resources
.
getString
(
R
.
string
.
startup_publishing_onion_service
))
}
sc
==
SetupComplete
.
FALSE
->
{
sc
==
SetupComplete
.
FALSE
->
{
val
dm
=
Resources
.
getSystem
().
displayMetrics
val
dm
=
Resources
.
getSystem
().
displayMetrics
val
size
=
min
(
dm
.
widthPixels
,
dm
.
heightPixels
)
val
size
=
min
(
dm
.
widthPixels
,
dm
.
heightPixels
)
...
...
This diff is collapsed.
Click to expand it.
mailbox-android/src/main/res/values/strings.xml
+
4
−
0
View file @
b8ffe3e2
...
@@ -28,4 +28,8 @@
...
@@ -28,4 +28,8 @@
<string
name=
"link_title"
>
Link via QR code
</string>
<string
name=
"link_title"
>
Link via QR code
</string>
<string
name=
"link_description"
>
Scan this QR code with Briar
</string>
<string
name=
"link_description"
>
Scan this QR code with Briar
</string>
<string
name=
"link_cancel"
>
Cancel Setup
</string>
<string
name=
"link_cancel"
>
Cancel Setup
</string>
<string
name=
"startup_starting_services"
>
Starting services
</string>
<string
name=
"startup_starting_tor"
>
Starting Tor
</string>
<string
name=
"startup_publishing_onion_service"
>
Publishing onion service
</string>
</resources>
</resources>
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