-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
62 lines (54 loc) · 2.11 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import 'react-native-gesture-handler'
import { enableScreens } from 'react-native-screens'
enableScreens()
import { LogBox } from 'react-native'
LogBox.ignoreLogs([
"The action 'POP_TO_TOP'",
'`new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method.',
'`new NativeEventEmitter()` was called with a non-null argument without the required `removeListeners` method.',
"[react-native-gesture-handler] Seems like you're using an old API with gesture components, check out new Gestures system!",
])
import i18next from 'i18next'
import { initReactI18next } from 'react-i18next'
import { backend, languageDetector } from '@app/i18n/i18n'
import * as RNLocalize from 'react-native-localize'
i18next.use(backend).use(languageDetector).use(initReactI18next).init({
compatibilityJSON: 'v3',
fallbackLng: 'en',
debug: true,
})
RNLocalize.addEventListener('change', () => {
languageDetector.detect(lng => i18next.changeLanguage(lng))
})
import { AppRegistry } from 'react-native'
import App from '@app/App'
import { name as appName } from '@app/app.json'
import TrackPlayer, { Capability } from 'react-native-track-player'
AppRegistry.registerComponent(appName, () => App)
TrackPlayer.registerPlaybackService(() => require('@app/trackplayer/service'))
async function start() {
await TrackPlayer.setupPlayer()
await TrackPlayer.updateOptions({
capabilities: [
Capability.Play,
Capability.Pause,
Capability.Stop,
Capability.SkipToNext,
Capability.SkipToPrevious,
Capability.SeekTo,
],
compactCapabilities: [
Capability.Play, //
Capability.Pause,
Capability.SkipToNext,
Capability.SkipToPrevious,
],
playIcon: require('@res/icons/notification/ic_stat_play.png'),
pauseIcon: require('@res/icons/notification/ic_stat_pause.png'),
stopIcon: require('@res/icons/notification/ic_stat_stop.png'),
nextIcon: require('@res/icons/notification/ic_stat_next.png'),
previousIcon: require('@res/icons/notification/ic_stat_previous.png'),
icon: require('@res/icons/notification/ic_stat_play.png'),
})
}
start()