forked from FreesideVirtual/zcash-android-wallet
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* dagger removal * analytics removal
- Loading branch information
Showing
59 changed files
with
687 additions
and
1,137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
app/src/main/java/cash/z/ecc/android/di/DependenciesHolder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package cash.z.ecc.android.di | ||
|
||
import android.content.ClipboardManager | ||
import android.content.Context | ||
import cash.z.ecc.android.ZcashWalletApp | ||
import cash.z.ecc.android.ext.Const | ||
import cash.z.ecc.android.feedback.* | ||
import cash.z.ecc.android.lockbox.LockBox | ||
import cash.z.ecc.android.sdk.Synchronizer | ||
import cash.z.ecc.android.ui.util.DebugFileTwig | ||
import cash.z.ecc.android.util.SilentTwig | ||
import cash.z.ecc.android.util.Twig | ||
import cash.z.ecc.kotlin.mnemonic.Mnemonics | ||
|
||
object DependenciesHolder { | ||
|
||
fun provideAppContext(): Context = ZcashWalletApp.instance | ||
|
||
val initializerComponent by lazy { InitializerComponent() } | ||
|
||
val synchronizer by lazy { Synchronizer.newBlocking(initializerComponent.initializer) } | ||
|
||
val clipboardManager by lazy { provideAppContext().getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager } | ||
|
||
val lockBox by lazy { LockBox(provideAppContext()) } | ||
|
||
val prefs by lazy { LockBox(provideAppContext()) } | ||
|
||
val feedback by lazy { Feedback() } | ||
|
||
val feedbackCoordinator by lazy { | ||
lockBox.getBoolean(Const.Pref.FEEDBACK_ENABLED).let { isEnabled -> | ||
// observe nothing unless feedback is enabled | ||
Twig.plant(if (isEnabled) DebugFileTwig() else SilentTwig()) | ||
FeedbackCoordinator(feedback) | ||
} | ||
} | ||
|
||
val feedbackFile by lazy { FeedbackFile() } | ||
|
||
val feedbackConsole by lazy { FeedbackConsole() } | ||
|
||
val mnemonics by lazy { Mnemonics() } | ||
} |
14 changes: 14 additions & 0 deletions
14
app/src/main/java/cash/z/ecc/android/di/InitializerComponent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package cash.z.ecc.android.di | ||
|
||
import cash.z.ecc.android.sdk.Initializer | ||
|
||
class InitializerComponent { | ||
|
||
lateinit var initializer: Initializer | ||
private set | ||
|
||
fun createInitializer(config: Initializer.Config) { | ||
initializer = Initializer.newBlocking(DependenciesHolder.provideAppContext(), config) | ||
} | ||
|
||
} |
7 changes: 0 additions & 7 deletions
7
app/src/main/java/cash/z/ecc/android/di/annotation/ActivityScope.kt
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
app/src/main/java/cash/z/ecc/android/di/annotation/ApplicationScope.kt
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
app/src/main/java/cash/z/ecc/android/di/annotation/FragmentScope.kt
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
app/src/main/java/cash/z/ecc/android/di/annotation/SynchronizerScope.kt
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
app/src/main/java/cash/z/ecc/android/di/annotation/ViewModelKey.kt
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
app/src/main/java/cash/z/ecc/android/di/component/AppComponent.kt
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
app/src/main/java/cash/z/ecc/android/di/component/InitializerSubcomponent.kt
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
app/src/main/java/cash/z/ecc/android/di/component/MainActivitySubcomponent.kt
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
app/src/main/java/cash/z/ecc/android/di/component/SynchronizerSubcomponent.kt
This file was deleted.
Oops, something went wrong.
87 changes: 0 additions & 87 deletions
87
app/src/main/java/cash/z/ecc/android/di/module/AppModule.kt
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
app/src/main/java/cash/z/ecc/android/di/module/InitializerModule.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.