added send/receive assets and incorporated sdk type changes

This commit is contained in:
Kevin Gorham 2019-02-08 09:21:10 -05:00 committed by Kevin Gorham
parent 78c18faee0
commit dd5d042b2d
8 changed files with 81 additions and 29 deletions

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
xmlns:tools="http://schemas.android.com/tools"
package="cash.z.android.wallet">
<dist:module dist:instant="true" />
@ -12,7 +13,8 @@
android:roundIcon="@mipmap/ic_launcher_shield_round"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/ZcashTheme">
android:theme="@style/ZcashTheme"
tools:replace="android:name">
<activity
android:name=".ui.activity.MainActivity"
android:label="@string/app_name"

View File

@ -40,7 +40,7 @@ class SampleTransactionRepository(val scope: CoroutineScope) : TransactionReposi
private fun createSampleTransaction(oldestTimestamp: Long): WalletTransaction {
// up to 20% of the delta
val upperBound = System.currentTimeMillis() + Math.round(0.2 * (System.currentTimeMillis() - oldestTimestamp))
val txId = Random.nextInt(0..(Int.MAX_VALUE - 1))
val txId = Random.nextLong(0L..(Long.MAX_VALUE - 1L))
val value = Random.nextLong(1L..1_500_000_000L) - 750_000_000L
val height = Random.nextInt(0..(Int.MAX_VALUE - 1))
val isSend = value > 0L

View File

@ -63,8 +63,8 @@ internal object SynchronizerModule {
@JvmStatic
@Provides
@Singleton
fun provideManager(twigger: Twig): ActiveTransactionManager {
return ActiveTransactionManager(twigger)
fun provideManager(wallet: Wallet, repository: TransactionRepository, downloader: CompactBlockStream, twigger: Twig): ActiveTransactionManager {
return ActiveTransactionManager(repository, downloader.connection, wallet, twigger)
}
@JvmStatic
@ -97,10 +97,10 @@ internal object SynchronizerModule {
object Properties {
val COMPACT_BLOCK_SERVER = Servers.EMULATOR.host
const val COMPACT_BLOCK_PORT = 9067
const val CACHE_DB_NAME = "wallet_cache50.db"
const val DATA_DB_NAME = "wallet_data50.db"
val SEED_PROVIDER = SampleSeedProvider("dummyseed")
val SPENDING_KEY_PROVIDER = SampleSpendingKeyProvider("dummyseed")
const val CACHE_DB_NAME = "wallet_cache421.db"
const val DATA_DB_NAME = "wallet_data421.db"
val SEED_PROVIDER = SampleImportedSeedProvider("295761fce7fdc89fa1095259f5be6375c4a36f7a214767d668f9ef6e17aa6314")
val SPENDING_KEY_PROVIDER = SampleSpendingKeyProvider2("dummyseed")
}
enum class Servers(val host: String) {
@ -118,22 +118,6 @@ class SampleImportedSeedProvider(private val seedHex: String) : ReadOnlyProperty
}
fun decodeHex(hex: String): ByteArray {
val result = ByteArray(hex.length / 2)
for (i in result.indices) {
@ -155,6 +139,7 @@ class SampleImportedSeedProvider(private val seedHex: String) : ReadOnlyProperty
class SampleSpendingKeyProvider2(private val seedValue: String) : ReadOnlyProperty<Any?, String> {
override fun getValue(thisRef: Any?, property: KProperty<*>): String {
// dynamically generating keyes, based on seed is out of scope for this sample
return "secret-extended-key-test1q0f0urnmqqqqpqxlree5urprcmg9pdgvr2c88qhm862etv65eu84r9zwannpz4g88299xyhv7wf9xke5cag653jlwwwyxrymfraqsnz8qfgds70qjammscxxyl7s7p9xz9w906epdpy8ztsjd7ez7phcd5vj7syx68sjskqs8j9lef2uuacghsh8puuvsy9u25pfvcdznta33qe6xh5lrlnhdkgymnpdug4jm6tpf803cad6tqa9c0ewq9l03fqxatevm97jmuv8u0ccxjews5"
return "secret-extended-key-test1q0ks5jkcqqqqpqywf2mh5g2aw5smt252mqscphjr8svrqyvgtgss0av3jh37jc05pngstr6qcqu5x64zuk8entc97pfla68jd7g9fyhwv5l8pdey662qy3lr07w9yddpgwdlwt3tjgzhpszatyw90kpn4zs7feu5cudwnxcpts5k0za96xy0wt59nu7hg3ntalck7gwhn0nuyztmf8yceuhp0fn3wmrtr9mk9v6fhg8hwvsxp0thr4cn9r8pc0w3zh45czmnr7e3mrctlzaq7"
// return "secret-extended-key-test1q0f0urnmqqqqpqxlree5urprcmg9pdgvr2c88qhm862etv65eu84r9zwannpz4g88299xyhv7wf9xkecag653jlwwwyxrymfraqsnz8qfgds70qjammscxxyl7s7p9xz9w906epdpy8ztsjd7ez7phcd5vj7syx68sjskqs8j9lef2uuacghsh8puuvsy9u25pfvcdznta33qe6xh5lrlnhdkgymnpdug4jm6tpf803cad6tqa9c0ewq9l03fqxatevm97jmuv8u0ccxjews5"
}
}

View File

@ -48,4 +48,3 @@ class TransactionViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView)
amount.setTextColor(amountColor.toAppColor())
}
}

View File

@ -558,6 +558,4 @@ class HomeFragment : BaseFragment(), HomePresenter.HomeView {
abstract class HomeFragmentModule {
@ContributesAndroidInjector
abstract fun contributeHomeFragment(): HomeFragment
}
}

View File

@ -0,0 +1,37 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="160dp"
android:height="160dp"
android:viewportWidth="160"
android:viewportHeight="160">
<group
android:name="_R_G_L_1_G"
android:rotation="-20"
android:scaleX="1"
android:scaleY="1"
android:translateX="80"
android:translateY="80">
<path
android:name="_R_G_L_1_G_D_0_P_0"
android:fillAlpha="1"
android:fillColor="#009688"
android:fillType="nonZero"
android:pathData=" M66 0 C66,36.45 36.45,66 0,66 C-36.45,66 -66,36.45 -66,0 C-66,-36.45 -36.45,-66 0,-66 C36.45,-66 66,-36.45 66,0c " />
</group>
<group
android:name="_R_G_L_0_G_T_1"
android:rotation="180"
android:translateX="80"
android:translateY="80">
<group
android:name="_R_G_L_0_G"
android:translateY="-3">
<path
android:name="_R_G_L_0_G_D_0_P_0"
android:fillAlpha="1"
android:fillColor="#ffffff"
android:fillType="nonZero"
android:pathData=" M-17.21 17.58 C-17.21,17.58 -25.85,9.26 -25.85,9.26 C-25.85,9.26 0,-17.58 0,-17.58 C0,-17.58 25.85,9.26 25.85,9.26 C25.85,9.26 17.21,17.58 17.21,17.58 C17.21,17.58 0,-0.28 0,-0.28 C0,-0.28 -17.21,17.58 -17.21,17.58c " />
</group>
</group>
</vector>

View File

@ -0,0 +1,31 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="160dp"
android:height="160dp"
android:viewportWidth="160"
android:viewportHeight="160">
<group
android:name="_R_G_L_3_G"
android:translateX="80"
android:translateY="80">
<path
android:name="_R_G_L_3_G_D_0_P_0"
android:fillAlpha="1"
android:fillColor="#f5a623"
android:fillType="nonZero"
android:pathData=" M55.59 0 C55.59,30.7 30.7,55.59 0,55.59 C-30.7,55.59 -55.58,30.7 -55.58,0 C-55.58,-30.7 -30.7,-55.58 0,-55.58 C30.7,-55.58 55.59,-30.7 55.59,0c " />
</group>
<group
android:name="_R_G_L_2_G"
android:translateX="76"
android:translateY="84">
<path
android:name="_R_G_L_2_G_D_0_P_0"
android:fillAlpha="1"
android:fillColor="#ffffff"
android:fillType="nonZero"
android:pathData=" M10.76 -10.09 C10.76,-10.09 -4.17,8.75 -4.17,8.75 C-4.17,8.75 5.67,25.78 5.67,25.78 C7.07,27.55 9.88,27.06 10.6,24.92 C10.6,24.92 26.8,-23.19 26.8,-23.19 C27.55,-25.42 25.42,-27.55 23.19,-26.8 C23.19,-26.8 -24.92,-10.6 -24.92,-10.6 C-27.06,-9.88 -27.55,-7.07 -25.77,-5.67 C-25.77,-5.67 -8.75,4.18 -8.75,4.18 C-8.75,4.18 10.09,-10.76 10.09,-10.76 C10.54,-11.12 11.12,-10.54 10.76,-10.09c " />
</group>
</vector>