-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathDevkitWalletApplication.kt
More file actions
29 lines (23 loc) · 1.04 KB
/
DevkitWalletApplication.kt
File metadata and controls
29 lines (23 loc) · 1.04 KB
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
/*
* Copyright 2021 thunderbiscuit and contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the ./LICENSE file.
*/
package com.goldenraven.devkitwallet
import android.app.Application
import android.content.Context
import com.goldenraven.devkitwallet.utils.SharedPreferencesManager
import com.goldenraven.devkitwallet.domain.Repository
import com.goldenraven.devkitwallet.domain.Wallet
class DevkitWalletApplication : Application() {
override fun onCreate() {
super.onCreate()
// initialize Wallet object (singleton) with path variable
Wallet.setPath(applicationContext.filesDir.toString())
// initialize shared preferences manager object (singleton)
val sharedPreferencesManager = SharedPreferencesManager(
sharedPreferences = applicationContext.getSharedPreferences("current_wallet", Context.MODE_PRIVATE)
)
// initialize Repository object with shared preferences
Repository.setSharedPreferences(sharedPreferencesManager)
}
}