Skip to content

Commit 157d05f

Browse files
committed
[native] fix(status bar): Try to fix status bar
Signed-off-by: Marcel Klehr <[email protected]>
1 parent e7ab3be commit 157d05f

File tree

9 files changed

+129
-12
lines changed

9 files changed

+129
-12
lines changed

_locales/en/messages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@
745745
"message": "Git branch"
746746
},
747747
"LabelTelemetry": {
748-
"message": "\uD83D\uDC1B Automated Error Reporting"
748+
"message": "Automated Error Reporting"
749749
},
750750
"DescriptionTelemetry": {
751751
"message": "Floccus can automatically send error data to me, the developer. This is a tremendous help for discovering and resolving bugs in floccus more quickly and will help improve your experience with floccus in the long run. Even when error reporting is enabled, the floccus developers will never be able to see your bookmarks."

android/app/src/main/assets/capacitor.config.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@
1818
"enabled": true
1919
},
2020
"StatusBar": {
21-
"overlaysWebView": true
21+
"overlaysWebView": false
2222
}
2323
},
24-
"cordova": {}
24+
"cordova": {},
25+
"android": {
26+
"adjustMarginsForEdgeToEdge": "force"
27+
}
2528
}

capacitor.config.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@
1818
"enabled": true
1919
},
2020
"StatusBar": {
21-
"overlaysWebView": true
21+
"overlaysWebView": false
2222
}
2323
},
24-
"cordova": {}
24+
"cordova": {},
25+
"android": {
26+
"adjustMarginsForEdgeToEdge": "force"
27+
}
2528
}

ios/App/App/capacitor.config.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@
1818
"enabled": true
1919
},
2020
"StatusBar": {
21-
"overlaysWebView": true
21+
"overlaysWebView": false
2222
}
2323
},
2424
"cordova": {},
25+
"android": {
26+
"adjustMarginsForEdgeToEdge": "force"
27+
},
2528
"packageClassList": [
2629
"OAuth2ClientPlugin",
2730
"AppPlugin",

src/lib/native/NativeController.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Cryptography from '../Crypto'
44
import NativeAccountStorage from './NativeAccountStorage'
55
import Account from '../Account'
66
import { STATUS_ALLGOOD, STATUS_DISABLED, STATUS_ERROR, STATUS_SYNCING } from '../interfaces/Controller'
7+
import { initSharp } from '../sentry'
78

89
const INACTIVITY_TIMEOUT = 1000 * 7
910
const MAX_BACKOFF_INTERVAL = 1000 * 60 * 60 // 1 hour
@@ -244,6 +245,10 @@ export default class NativeController {
244245
}
245246

246247
async onLoad() {
248+
if (await NativeAccountStorage.getEntry('telemetryEnabled', false)) {
249+
initSharp()
250+
}
251+
247252
const accounts = await Account.getAllAccounts()
248253
await Promise.all(
249254
accounts.map(async acc => {

src/ui/NativeApp.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import { version as VERSION } from '../../package.json'
1111
import { actions } from './store/definitions'
1212
import Controller from '../lib/Controller'
13+
import {StatusBar, Style} from '@capacitor/status-bar'
1314
export default {
1415
name: 'NativeApp',
1516
data() {
@@ -28,6 +29,13 @@ export default {
2829
}
2930
},
3031
async created() {
32+
if (this.$vuetify.theme.dark) {
33+
StatusBar.setStyle({ style: Style.Light })
34+
StatusBar.setBackgroundColor(this.background)
35+
} else {
36+
StatusBar.setStyle({ style: Style.Dark })
37+
StatusBar.setBackgroundColor(this.background)
38+
}
3139
const controller = await Controller.getSingleton()
3240
await controller.onLoad()
3341
setInterval(() => {

src/ui/NativeRouter.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import Tree from './views/native/Tree'
44
import Home from './views/native/Home'
55
import AddBookmarkIntent from './views/native/AddBookmarkIntent'
66
import ImportExport from './views/native/ImportExport'
7-
import About from './views/native/About'
8-
import Feedback from './views/native/Feedback.vue'
97

108
Vue.use(Router)
119

@@ -20,7 +18,8 @@ export const routes = {
2018
IMPORTEXPORT: 'IMPORTEXPORT',
2119
FEEDBACK: 'FEEDBACK',
2220
DONATE: 'DONATE',
23-
ABOUT: 'ABOUT'
21+
ABOUT: 'ABOUT',
22+
TELEMETRY: 'TELEMETRY',
2423
}
2524

2625
export const router = new Router({
@@ -64,12 +63,17 @@ export const router = new Router({
6463
{
6564
path: '/feedback',
6665
name: routes.FEEDBACK,
67-
component: Feedback,
66+
component: () => import(/* webpackPrefetch: true */ './views/native/Feedback'),
67+
},
68+
{
69+
path: '/telemetry',
70+
name: routes.TELEMETRY,
71+
component: () => import(/* webpackPrefetch: true */ './views/native/Telemetry'),
6872
},
6973
{
7074
path: '/about',
7175
name: routes.ABOUT,
72-
component: About,
76+
component: () => import(/* webpackPrefetch: true */ './views/native/About'),
7377
},
7478
],
7579
})

src/ui/components/native/Drawer.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
</v-list-item-content>
7272
</v-list-item>
7373
<v-list-item
74-
key="bugs"
74+
key="feedback"
7575
link
7676
:to="{name: routes.FEEDBACK}">
7777
<v-list-item-icon>
@@ -81,6 +81,17 @@
8181
<v-list-item-title>{{ t('LabelGivefeedback') }}</v-list-item-title>
8282
</v-list-item-content>
8383
</v-list-item>
84+
<v-list-item
85+
key="telemetry"
86+
link
87+
:to="{name: routes.TELEMETRY}">
88+
<v-list-item-icon>
89+
<v-icon>mdi-bug-play-outline</v-icon>
90+
</v-list-item-icon>
91+
<v-list-item-content>
92+
<v-list-item-title>{{ t('LabelTelemetry') }}</v-list-item-title>
93+
</v-list-item-content>
94+
</v-list-item>
8495
<v-list-item
8596
key="about"
8697
link

src/ui/views/native/Telemetry.vue

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<template>
2+
<div class="native-scroll-container">
3+
<v-main>
4+
<v-container>
5+
<v-card
6+
class="options mt-3">
7+
<v-container class="pa-5">
8+
<v-card-title>
9+
{{ t("LabelTelemetry") }}
10+
</v-card-title>
11+
<v-card-text>
12+
<div class="body-1">
13+
{{ t("DescriptionTelemetry") }}
14+
</div>
15+
<v-radio-group
16+
v-model="telemetry"
17+
class="mt-4">
18+
<v-radio :value="true">
19+
<template #label>
20+
<div class="heading">
21+
{{ t("LabelTelemetryenable") }}
22+
</div>
23+
</template>
24+
</v-radio>
25+
<v-radio :value="false">
26+
<template #label>
27+
<div class="heading">
28+
{{ t("LabelTelemetrydisable") }}
29+
</div>
30+
</template>
31+
</v-radio>
32+
</v-radio-group>
33+
</v-card-text>
34+
<v-card-title>
35+
{{ t("LabelReportproblem") }}
36+
</v-card-title>
37+
<v-card-text>
38+
<div class="body-1">
39+
{{ t("DescriptionReportproblem") }}
40+
</div>
41+
<v-btn href="https://github.com/floccusaddon/floccus/issues">
42+
{{ t("LabelReportproblem") }}
43+
</v-btn>
44+
</v-card-text>
45+
</v-container>
46+
</v-card>
47+
</v-container>
48+
</v-main>
49+
</div>
50+
</template>
51+
52+
<script>
53+
import NativeAccountStorage from '../../../lib/native/NativeAccountStorage'
54+
55+
export default {
56+
name: 'Telemetry',
57+
components: {},
58+
data() {
59+
return {
60+
telemetry: false,
61+
}
62+
},
63+
watch: {
64+
telemetry(enabled) {
65+
NativeAccountStorage.changeEntry('telemetryEnabled', () => enabled, false)
66+
},
67+
},
68+
async created() {
69+
const telemetryEnabled = await NativeAccountStorage.getEntry('telemetryEnabled', false)
70+
this.telemetry = telemetryEnabled
71+
},
72+
}
73+
</script>
74+
75+
<style scoped>
76+
.options {
77+
max-width: 600px;
78+
margin: 0 auto;
79+
}
80+
</style>

0 commit comments

Comments
 (0)