Initial alpha release

This commit is contained in:
Kevin Gorham 2019-02-28 13:56:25 -07:00 committed by Kevin Gorham
parent 49017cb1d1
commit 6e728592f2
5 changed files with 23 additions and 5 deletions

View File

@ -15,8 +15,9 @@ android {
minSdkVersion buildConfig.minSdkVersion minSdkVersion buildConfig.minSdkVersion
targetSdkVersion buildConfig.targetSdkVersion targetSdkVersion buildConfig.targetSdkVersion
versionCode 19 // todo: change this to 1_00_04 format, once we graduate beyond zero for the major version number because leading zeros indicate on octal number. versionCode 19 // todo: change this to 1_00_04 format, once we graduate beyond zero for the major version number because leading zeros indicate on octal number.
versionName "0.5.1-alpha" versionName "0.6.0-alpha"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
multiDexEnabled true multiDexEnabled true
} }

View File

@ -93,7 +93,7 @@ object MyWallet : WalletConfig {
} }
enum class Servers(val host: String, val displayName: String) { enum class Servers(val host: String, val displayName: String) {
EMULATOR("10.0.2.2", "Localhost"), LOCALHOST("10.0.0.191", "Localhost"),
// WLAN("10.0.0.26"), // WLAN("10.0.0.26"),
WLAN1("10.0.2.24", "WLAN Conference"), WLAN1("10.0.2.24", "WLAN Conference"),
WLAN2("192.168.1.235", "WLAN Office"), WLAN2("192.168.1.235", "WLAN Office"),

View File

@ -54,9 +54,17 @@ class SettingsFragment : BaseFragment() {
setOnClickListener { setOnClickListener {
val userName = binding.spinnerDemoUser.selectedItem.toString() val userName = binding.spinnerDemoUser.selectedItem.toString()
val server = binding.spinnerServers.selectedItem.toString() val server = binding.spinnerServers.selectedItem.toString()
view.context.alert("Are you sure you want to apply these changes?\n\nUser: $userName\nServer: $server\n\nTHIS WILL EXIT THE APP.") { view.context.alert("Are you sure you want to apply these changes?\n\nUser: $userName\nServer: $server\n\nTHIS WILL EXIT THE APP!") {
onApplySettings(userName, server) onApplySettings(userName, server)
view.postDelayed({ mainActivity?.finish() }, 2000L) // TODO: handle this whole reset thing better. For now, just aggressively kill the app. A better
// approach is to create a custom scope for the synchronizer and then just manage that like any
// other subcomponent. In that scenario, we would simply navigate up from this fragment at this
// point (after installing a new synchronizer subcomponent)
view.postDelayed({
mainActivity?.finish()
Thread.sleep(1000L) // if you're going to cut a corner, lean into it! sleep FTW!
android.os.Process.killProcess(android.os.Process.myPid())
}, 2000L)
} }
} }
} }

View File

@ -1,5 +1,6 @@
package cash.z.android.wallet.ui.fragment package cash.z.android.wallet.ui.fragment
import android.content.SharedPreferences
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
@ -10,18 +11,25 @@ import androidx.transition.TransitionInflater
import cash.z.android.wallet.BuildConfig import cash.z.android.wallet.BuildConfig
import cash.z.android.wallet.R import cash.z.android.wallet.R
import cash.z.android.wallet.databinding.FragmentWelcomeBinding import cash.z.android.wallet.databinding.FragmentWelcomeBinding
import cash.z.android.wallet.sample.SampleProperties
import cash.z.android.wallet.sample.WalletConfig import cash.z.android.wallet.sample.WalletConfig
import cash.z.wallet.sdk.data.twig
import dagger.Module import dagger.Module
import dagger.android.ContributesAndroidInjector import dagger.android.ContributesAndroidInjector
import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import javax.inject.Inject import javax.inject.Inject
import javax.inject.Named
class WelcomeFragment : ProgressFragment(R.id.progress_welcome) { class WelcomeFragment : ProgressFragment(R.id.progress_welcome) {
@Inject @Inject
lateinit var walletConfig: WalletConfig lateinit var walletConfig: WalletConfig
@Inject
lateinit var prefs: SharedPreferences
private lateinit var binding: FragmentWelcomeBinding private lateinit var binding: FragmentWelcomeBinding
// //
@ -44,9 +52,10 @@ class WelcomeFragment : ProgressFragment(R.id.progress_welcome) {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
val userName = walletConfig.displayName.substringAfterLast('.').capitalize() val userName = walletConfig.displayName.substringAfterLast('.').capitalize()
val serverName = prefs.getString(SampleProperties.PREFS_SERVER_NAME, "Unknown")
val network = if (resources.getBoolean(R.bool.is_testnet)) "Testnet 2.0.1" else "Mainnet 2.0.1" val network = if (resources.getBoolean(R.bool.is_testnet)) "Testnet 2.0.1" else "Mainnet 2.0.1"
var buildInfo = "PoC v${BuildConfig.VERSION_NAME} $network\n" + var buildInfo = "PoC v${BuildConfig.VERSION_NAME} $network\n" +
"Zcash Company - For demo purposes only\nUser: $userName" "Zcash Company - For demo purposes only\nUser: $userName\nServer: $serverName"
binding.textWelcomeBuildInfo.text = buildInfo binding.textWelcomeBuildInfo.text = buildInfo
} }