UX updates from Tomek's feedback

pull/785/head
James Brown 5 years ago
parent 1efced680b
commit 29b4e7ae20
  1. 3
      app/src/main/AndroidManifest.xml
  2. 9
      app/src/main/java/io/stormbird/wallet/service/KeyService.java
  3. 40
      app/src/main/java/io/stormbird/wallet/ui/BackupKeyActivity.java
  4. 7
      app/src/main/java/io/stormbird/wallet/ui/ConfirmationActivity.java
  5. 7
      app/src/main/java/io/stormbird/wallet/ui/FunctionActivity.java
  6. 54
      app/src/main/java/io/stormbird/wallet/ui/HomeActivity.java
  7. 1
      app/src/main/java/io/stormbird/wallet/ui/ImportTokenActivity.java
  8. 2
      app/src/main/java/io/stormbird/wallet/ui/ImportWalletActivity.java
  9. 7
      app/src/main/java/io/stormbird/wallet/ui/RedeemSignatureDisplayActivity.java
  10. 7
      app/src/main/java/io/stormbird/wallet/ui/SellDetailActivity.java
  11. 7
      app/src/main/java/io/stormbird/wallet/ui/TransferTicketDetailActivity.java
  12. 1
      app/src/main/java/io/stormbird/wallet/ui/WalletActionsActivity.java
  13. 10
      app/src/main/java/io/stormbird/wallet/ui/WalletsActivity.java
  14. 5
      app/src/main/java/io/stormbird/wallet/viewmodel/BackupKeyViewModel.java
  15. 5
      app/src/main/java/io/stormbird/wallet/viewmodel/ConfirmationViewModel.java
  16. 5
      app/src/main/java/io/stormbird/wallet/viewmodel/DappBrowserViewModel.java
  17. 5
      app/src/main/java/io/stormbird/wallet/viewmodel/ImportTokenViewModel.java
  18. 5
      app/src/main/java/io/stormbird/wallet/viewmodel/ImportWalletViewModel.java
  19. 5
      app/src/main/java/io/stormbird/wallet/viewmodel/RedeemSignatureDisplayModel.java
  20. 5
      app/src/main/java/io/stormbird/wallet/viewmodel/SellDetailViewModel.java
  21. 5
      app/src/main/java/io/stormbird/wallet/viewmodel/TokenFunctionViewModel.java
  22. 5
      app/src/main/java/io/stormbird/wallet/viewmodel/TransferTicketDetailViewModel.java
  23. 6
      app/src/main/java/io/stormbird/wallet/viewmodel/WalletsViewModel.java
  24. BIN
      app/src/main/res/drawable-hdpi/ic_logo.png
  25. BIN
      app/src/main/res/drawable-hdpi/ic_splash_welcome.png
  26. BIN
      app/src/main/res/drawable-mdpi/ic_logo.png
  27. BIN
      app/src/main/res/drawable-mdpi/ic_splash_welcome.png
  28. BIN
      app/src/main/res/drawable-xhdpi/ic_logo.png
  29. BIN
      app/src/main/res/drawable-xhdpi/ic_splash_welcome.png
  30. BIN
      app/src/main/res/drawable-xxhdpi/ic_logo.png
  31. BIN
      app/src/main/res/drawable-xxhdpi/ic_splash_welcome.png
  32. BIN
      app/src/main/res/drawable-xxxhdpi/ic_logo.png
  33. BIN
      app/src/main/res/drawable-xxxhdpi/ic_splash_welcome.png
  34. 39
      app/src/main/res/drawable/ic_logo.xml
  35. 14
      app/src/main/res/drawable/item_white_triangle.xml
  36. 10
      app/src/main/res/drawable/splash_background.xml
  37. 32
      app/src/main/res/layout/activity_backup.xml
  38. 2
      app/src/main/res/layout/activity_backup_write_seed.xml
  39. 95
      app/src/main/res/layout/activity_json_backup.xml
  40. 1
      app/src/main/res/layout/activity_set_json_password.xml
  41. 3
      app/src/main/res/layout/activity_show_seed_phrase.xml
  42. 33
      app/src/main/res/layout/activity_splash.xml
  43. 2
      app/src/main/res/layout/activity_verify_seed_phrase.xml
  44. 35
      app/src/main/res/layout/layout_white_toolbar.xml
  45. 13
      app/src/main/res/layout/showcase_backup_wallet.xml
  46. 12
      app/src/main/res/layout/showcase_find_wallet.xml
  47. 2
      app/src/main/res/values-es/strings.xml
  48. 2
      app/src/main/res/values-zh/strings.xml
  49. 2
      app/src/main/res/values/strings.xml
  50. 9
      app/src/main/res/values/styles.xml
  51. 5
      dmz/src/main/java/io/stormbird/token/web/Service/CryptoFunctions.java

@ -223,8 +223,7 @@
<activity <activity
android:name="io.stormbird.wallet.ui.BackupKeyActivity" android:name="io.stormbird.wallet.ui.BackupKeyActivity"
android:windowSoftInputMode="stateHidden|adjustResize" android:windowSoftInputMode="stateHidden|adjustResize" />
android:label="Backup Seed Phrase" />
</application> </application>
</manifest> </manifest>

@ -737,6 +737,9 @@ public class KeyService implements AuthenticationCallback, PinAuthenticationCall
signDialog.setCancelListener(v -> { signDialog.setCancelListener(v -> {
authenticateFail("Cancelled", AuthenticationFailType.AUTHENTICATION_DIALOG_CANCELLED, operation.ordinal()); authenticateFail("Cancelled", AuthenticationFailType.AUTHENTICATION_DIALOG_CANCELLED, operation.ordinal());
}); });
signDialog.setOnDismissListener(v -> {
signDialog = null;
});
signDialog.show(); signDialog.show();
signDialog.getFingerprintAuthorisation(this); signDialog.getFingerprintAuthorisation(this);
} }
@ -1132,6 +1135,12 @@ public class KeyService implements AuthenticationCallback, PinAuthenticationCall
return securityStatus == SecurityStatus.HAS_STRONGBOX; return securityStatus == SecurityStatus.HAS_STRONGBOX;
} }
public void resetSigningDialog()
{
if (signDialog != null) signDialog.dismiss();
signDialog = null;
}
private boolean deviceIsLocked() private boolean deviceIsLocked()
{ {
KeyguardManager keyguardManager = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE); KeyguardManager keyguardManager = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);

@ -4,6 +4,7 @@ import android.arch.lifecycle.ViewModelProviders;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.text.Editable; import android.text.Editable;
import android.text.TextWatcher; import android.text.TextWatcher;
@ -41,7 +42,7 @@ import static io.stormbird.wallet.C.Key.WALLET;
import static io.stormbird.wallet.C.SHARE_REQUEST_CODE; import static io.stormbird.wallet.C.SHARE_REQUEST_CODE;
public class BackupKeyActivity extends BaseActivity implements View.OnClickListener, public class BackupKeyActivity extends BaseActivity implements View.OnClickListener,
CreateWalletCallbackInterface, TextWatcher, SignAuthenticationCallback CreateWalletCallbackInterface, TextWatcher, SignAuthenticationCallback, Runnable
{ {
@Inject @Inject
BackupKeyViewModelFactory backupKeyViewModelFactory; BackupKeyViewModelFactory backupKeyViewModelFactory;
@ -60,6 +61,8 @@ public class BackupKeyActivity extends BaseActivity implements View.OnClickListe
private String[] mnemonicArray; private String[] mnemonicArray;
private PinAuthenticationCallbackInterface authInterface; private PinAuthenticationCallbackInterface authInterface;
private ImageView spacerImage; private ImageView spacerImage;
private LinearLayout successOverlay;
private Handler handler;
private AWalletAlertDialog alertDialog; private AWalletAlertDialog alertDialog;
@ -119,7 +122,12 @@ public class BackupKeyActivity extends BaseActivity implements View.OnClickListe
setContentView(R.layout.activity_backup); setContentView(R.layout.activity_backup);
initViews(); initViews();
setTitle(getString(R.string.action_upgrade_key)); successOverlay = findViewById(R.id.layout_success_overlay);
if (successOverlay != null) successOverlay.setVisibility(View.VISIBLE);
handler = new Handler();
handler.postDelayed(this, 1000);
setTitle(getString(R.string.empty));
state = BackupState.UPGRADE_KEY_SECURITY; state = BackupState.UPGRADE_KEY_SECURITY;
if (wallet.type == WalletType.KEYSTORE) title.setText(R.string.lock_keystore_upgrade); if (wallet.type == WalletType.KEYSTORE) title.setText(R.string.lock_keystore_upgrade);
else title.setText(R.string.lock_key_upgrade); else title.setText(R.string.lock_key_upgrade);
@ -189,7 +197,7 @@ public class BackupKeyActivity extends BaseActivity implements View.OnClickListe
setContentView(R.layout.activity_backup); setContentView(R.layout.activity_backup);
initViews(); initViews();
setTitle(getString(R.string.title_backup_seed)); setTitle(getString(R.string.empty));
title.setText(R.string.backup_seed_phrase); title.setText(R.string.backup_seed_phrase);
backupImage.setImageResource(R.drawable.seed_graphic); backupImage.setImageResource(R.drawable.seed_graphic);
detail.setText(R.string.backup_seed_phrase_detail); detail.setText(R.string.backup_seed_phrase_detail);
@ -198,7 +206,7 @@ public class BackupKeyActivity extends BaseActivity implements View.OnClickListe
private void setupJSONExport() private void setupJSONExport()
{ {
setContentView(R.layout.activity_backup); setContentView(R.layout.activity_json_backup);
initViews(); initViews();
setTitle(getString(R.string.export_keystore_json)); setTitle(getString(R.string.export_keystore_json));
@ -214,15 +222,33 @@ public class BackupKeyActivity extends BaseActivity implements View.OnClickListe
setContentView(R.layout.activity_show_seed_phrase); setContentView(R.layout.activity_show_seed_phrase);
initViews(); initViews();
setTitle(getString(R.string.seed_phrase)); setTitle(getString(R.string.empty));
title.setText(getString(R.string.make_a_backup, "12")); title.setText(getString(R.string.make_a_backup, "12"));
nextButton.setText(R.string.test_seed_phrase); nextButton.setText(R.string.test_seed_phrase);
} }
@Override
public void run()
{
if (successOverlay == null) return;
if (successOverlay.getAlpha() > 0)
{
successOverlay.animate().alpha(0.0f).setDuration(500);
handler.postDelayed(this, 750);
}
else
{
successOverlay.setVisibility(View.GONE);
successOverlay.setAlpha(1.0f);
handler = null;
}
}
@Override @Override
public void onPause() public void onPause()
{ {
super.onPause(); super.onPause();
viewModel.resetSignDialog();
//hide seed phrase and any visible words //hide seed phrase and any visible words
if (layoutWordHolder != null) layoutWordHolder.removeAllViews(); if (layoutWordHolder != null) layoutWordHolder.removeAllViews();
@ -499,7 +525,7 @@ public class BackupKeyActivity extends BaseActivity implements View.OnClickListe
spacerImage.setVisibility(View.GONE); spacerImage.setVisibility(View.GONE);
} }
setTitle(getString(R.string.title_backup_seed)); setTitle(getString(R.string.empty));
state = BackupState.VERIFY_SEED_PHRASE; state = BackupState.VERIFY_SEED_PHRASE;
title.setText(R.string.verify_seed_phrase); title.setText(R.string.verify_seed_phrase);
nextButton.setText(R.string.action_continue); nextButton.setText(R.string.action_continue);
@ -557,7 +583,7 @@ public class BackupKeyActivity extends BaseActivity implements View.OnClickListe
setContentView(R.layout.activity_backup_write_seed); setContentView(R.layout.activity_backup_write_seed);
initViews(); initViews();
setTitle(getString(R.string.title_backup_seed)); setTitle(getString(R.string.empty));
state = BackupState.WRITE_DOWN_SEED_PHRASE; state = BackupState.WRITE_DOWN_SEED_PHRASE;
title.setText(R.string.write_down_seed_phrase); title.setText(R.string.write_down_seed_phrase);
nextButton.setText(R.string.wrote_down_seed_phrase); nextButton.setText(R.string.wrote_down_seed_phrase);

@ -277,6 +277,13 @@ public class ConfirmationActivity extends BaseActivity implements SignAuthentica
viewModel.prepare(this); viewModel.prepare(this);
} }
@Override
public void onPause()
{
super.onPause();
viewModel.resetSignDialog();
}
private void onProgress(boolean shouldShowProgress) { private void onProgress(boolean shouldShowProgress) {
hideDialog(); hideDialog();
if (shouldShowProgress) { if (shouldShowProgress) {

@ -545,6 +545,13 @@ public class FunctionActivity extends BaseActivity implements View.OnClickListen
} }
@Override
public void onPause()
{
super.onPause();
viewModel.resetSignDialog();
}
@Override @Override
public void onSignPersonalMessage(Message<String> message) public void onSignPersonalMessage(Message<String> message)
{ {

@ -6,6 +6,7 @@ import android.app.Dialog;
import android.arch.lifecycle.*; import android.arch.lifecycle.*;
import android.content.*; import android.content.*;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.graphics.Color;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
@ -196,7 +197,7 @@ public class HomeActivity extends BaseNavigationActivity implements View.OnClick
} }
viewModel.cleanDatabases(this); viewModel.cleanDatabases(this);
showFindWalletAddressDialog(); showBackupWalletDialog();
} }
private void onBackup(String address) private void onBackup(String address)
@ -207,43 +208,44 @@ public class HomeActivity extends BaseNavigationActivity implements View.OnClick
} }
} }
// public void showBackupWalletDialog() { public void showBackupWalletDialog() {
// if (!viewModel.isBackupWalletDialogShown()) {
// backupWalletDialog = TutoShowcase.from(this);
// backupWalletDialog.setContentView(R.layout.showcase_backup_wallet)
// .onClickContentView(R.id.btn_close, view -> {
// backupWalletDialog.dismiss();
// })
// .on(R.id.layout_nav_settings)
// .addCircle()
// .onClick(v -> {
// backupWalletDialog.dismiss();
// showPage(SETTINGS);
// })
// .show();
// viewModel.setBackupWalletDialogShown(true);
// }
// }
public void showFindWalletAddressDialog() {
if (!viewModel.isFindWalletAddressDialogShown()) { if (!viewModel.isFindWalletAddressDialogShown()) {
findWalletAddressDialog = TutoShowcase.from(this); int lighterBackground = Color.argb(102, 0, 0, 0); //40% opacity
findWalletAddressDialog.setContentView(R.layout.showcase_find_wallet) backupWalletDialog = TutoShowcase.from(this);
backupWalletDialog.setContentView(R.layout.showcase_backup_wallet)
.setBackgroundColor(lighterBackground)
.onClickContentView(R.id.btn_close, view -> { .onClickContentView(R.id.btn_close, view -> {
findWalletAddressDialog.dismiss(); backupWalletDialog.dismiss();
findWalletAddressDialog = null;
}) })
.on(R.id.layout_nav_settings) .on(R.id.layout_nav_settings)
.addCircle() .addCircle()
.onClick(v -> { .onClick(v -> {
findWalletAddressDialog.dismiss(); backupWalletDialog.dismiss();
findWalletAddressDialog = null; showPage(SETTINGS);
}) })
.show(); .show();
viewModel.setFindWalletAddressDialogShown(true); viewModel.setFindWalletAddressDialogShown(true);
} }
} }
// public void showFindWalletAddressDialog() {
// if (!viewModel.isFindWalletAddressDialogShown()) {
// findWalletAddressDialog = TutoShowcase.from(this);
// findWalletAddressDialog.setContentView(R.layout.showcase_find_wallet)
// .onClickContentView(R.id.btn_close, view -> {
// findWalletAddressDialog.dismiss();
// findWalletAddressDialog = null;
// })
// .on(R.id.layout_nav_settings)
// .addCircle()
// .onClick(v -> {
// findWalletAddressDialog.dismiss();
// findWalletAddressDialog = null;
// })
// .show();
// viewModel.setFindWalletAddressDialogShown(true);
// }
// }
private void onWalletName(String name) { private void onWalletName(String name) {
if (name != null && !name.isEmpty()) { if (name != null && !name.isEmpty()) {

@ -216,6 +216,7 @@ public class ImportTokenActivity extends BaseActivity implements View.OnClickLis
{ {
super.onPause(); super.onPause();
hideDialog(); hideDialog();
viewModel.resetSignDialog();
} }
@Override @Override

@ -176,8 +176,8 @@ public class ImportWalletActivity extends BaseActivity implements OnImportSeedLi
@Override @Override
protected void onPause() { protected void onPause() {
super.onPause(); super.onPause();
hideDialog(); hideDialog();
importWalletViewModel.resetSignDialog();
} }
private void onWallet(Wallet wallet) { private void onWallet(Wallet wallet) {

@ -120,6 +120,13 @@ public class RedeemSignatureDisplayActivity extends BaseActivity implements View
viewModel.prepare(token.tokenInfo.address, token, ticketRange.range); viewModel.prepare(token.tokenInfo.address, token, ticketRange.range);
} }
@Override
public void onPause()
{
super.onPause();
viewModel.resetSignDialog();
}
@Override @Override
protected void onDestroy() protected void onDestroy()
{ {

@ -549,6 +549,13 @@ public class SellDetailActivity extends BaseActivity implements OnTokenClickList
handler = new Handler(); handler = new Handler();
} }
@Override
public void onPause()
{
super.onPause();
viewModel.resetSignDialog();
}
@Override @Override
public void onTokenClick(View view, Token token, List<BigInteger> ids, boolean selected) { public void onTokenClick(View view, Token token, List<BigInteger> ids, boolean selected) {
Context context = view.getContext(); Context context = view.getContext();

@ -448,6 +448,13 @@ public class TransferTicketDetailActivity extends BaseActivity implements Runnab
} }
} }
@Override
public void onPause()
{
super.onPause();
viewModel.resetSignDialog();
}
private void onProgress(boolean shouldShowProgress) private void onProgress(boolean shouldShowProgress)
{ {
hideDialog(); hideDialog();

@ -64,7 +64,6 @@ public class WalletActionsActivity extends BaseActivity implements View.OnClickL
walletCount++; walletCount++;
isNewWallet = getIntent().getBooleanExtra("isNewWallet", false); isNewWallet = getIntent().getBooleanExtra("isNewWallet", false);
initViews(); initViews();
//HDKeyService.flagAsNotBackedUp(this, wallet.address);
} else { } else {
finish(); finish();
} }

@ -42,6 +42,8 @@ import io.stormbird.wallet.widget.AddWalletView;
import io.stormbird.wallet.widget.SignTransactionDialog; import io.stormbird.wallet.widget.SignTransactionDialog;
import io.stormbird.wallet.widget.SystemView; import io.stormbird.wallet.widget.SystemView;
import static io.stormbird.wallet.C.Key.WALLET;
public class WalletsActivity extends BaseActivity implements public class WalletsActivity extends BaseActivity implements
View.OnClickListener, View.OnClickListener,
AddWalletView.OnNewWalletClickListener, AddWalletView.OnNewWalletClickListener,
@ -90,9 +92,17 @@ public class WalletsActivity extends BaseActivity implements
viewModel.createWalletError().observe(this, this::onCreateWalletError); viewModel.createWalletError().observe(this, this::onCreateWalletError);
viewModel.updateBalance().observe(this, this::onUpdatedBalance); viewModel.updateBalance().observe(this, this::onUpdatedBalance);
viewModel.updateENSName().observe(this, this::updateWalletName); viewModel.updateENSName().observe(this, this::updateWalletName);
viewModel.noWalletsError().observe(this, this::noWallets);
viewModel.findNetwork(); viewModel.findNetwork();
} }
private void noWallets(Boolean aBoolean)
{
Intent intent = new Intent(this, SplashActivity.class);
startActivity(intent);
finish();
}
private void updateWalletName(Wallet wallet) private void updateWalletName(Wallet wallet)
{ {
adapter.updateWalletName(wallet); adapter.updateWalletName(wallet);

@ -156,5 +156,10 @@ public class BackupKeyViewModel extends BaseViewModel {
{ {
fetchWalletsInteract.updateBackupTime(wallet.address).isDisposed(); fetchWalletsInteract.updateBackupTime(wallet.address).isDisposed();
} }
public void resetSignDialog()
{
keyService.resetSigningDialog();
}
} }

@ -245,4 +245,9 @@ public class ConfirmationViewModel extends BaseViewModel {
keyService.getAuthenticationForSignature(defaultWallet.getValue(), activity, callback); keyService.getAuthenticationForSignature(defaultWallet.getValue(), activity, callback);
} }
} }
public void resetSignDialog()
{
keyService.resetSigningDialog();
}
} }

@ -310,4 +310,9 @@ public class DappBrowserViewModel extends BaseViewModel {
{ {
keyService.getAuthenticationForSignature(wallet, activity, callback); keyService.getAuthenticationForSignature(wallet, activity, callback);
} }
public void resetSignDialog()
{
keyService.resetSigningDialog();
}
} }

@ -677,4 +677,9 @@ public class ImportTokenViewModel extends BaseViewModel
keyService.getAuthenticationForSignature(wallet.getValue(), activity, callback); keyService.getAuthenticationForSignature(wallet.getValue(), activity, callback);
} }
} }
public void resetSignDialog()
{
keyService.resetSigningDialog();
}
} }

@ -153,4 +153,9 @@ public class ImportWalletViewModel extends BaseViewModel implements OnSetWatchWa
return isValid; return isValid;
}); });
} }
public void resetSignDialog()
{
keyService.resetSigningDialog();
}
} }

@ -293,4 +293,9 @@ public class RedeemSignatureDisplayModel extends BaseViewModel
keyService.getAuthenticationForSignature(defaultWallet.getValue(), activity, callback); keyService.getAuthenticationForSignature(defaultWallet.getValue(), activity, callback);
} }
} }
public void resetSignDialog()
{
keyService.resetSigningDialog();
}
} }

@ -145,4 +145,9 @@ public class SellDetailViewModel extends BaseViewModel {
keyService.getAuthenticationForSignature(defaultWallet.getValue(), activity, callback); keyService.getAuthenticationForSignature(defaultWallet.getValue(), activity, callback);
} }
} }
public void resetSignDialog()
{
keyService.resetSigningDialog();
}
} }

@ -208,4 +208,9 @@ public class TokenFunctionViewModel extends BaseViewModel
.find() .find()
.subscribe(wallet -> { this.wallet = wallet; }, this::onError); .subscribe(wallet -> { this.wallet = wallet; }, this::onError);
} }
public void resetSignDialog()
{
keyService.resetSigningDialog();
}
} }

@ -277,4 +277,9 @@ public class TransferTicketDetailViewModel extends BaseViewModel {
keyService.getAuthenticationForSignature(defaultWallet.getValue(), activity, callback); keyService.getAuthenticationForSignature(defaultWallet.getValue(), activity, callback);
} }
} }
public void resetSignDialog()
{
keyService.resetSigningDialog();
}
} }

@ -63,6 +63,7 @@ public class WalletsViewModel extends BaseViewModel
private final MutableLiveData<Wallet> defaultWallet = new MutableLiveData<>(); private final MutableLiveData<Wallet> defaultWallet = new MutableLiveData<>();
private final MutableLiveData<Wallet> createdWallet = new MutableLiveData<>(); private final MutableLiveData<Wallet> createdWallet = new MutableLiveData<>();
private final MutableLiveData<ErrorEnvelope> createWalletError = new MutableLiveData<>(); private final MutableLiveData<ErrorEnvelope> createWalletError = new MutableLiveData<>();
private final MutableLiveData<Boolean> noWalletsError = new MutableLiveData<>();
private final MutableLiveData<Wallet> updateBalance = new MutableLiveData<>(); private final MutableLiveData<Wallet> updateBalance = new MutableLiveData<>();
private final MutableLiveData<NetworkInfo> defaultNetwork = new MutableLiveData<>(); private final MutableLiveData<NetworkInfo> defaultNetwork = new MutableLiveData<>();
private final MutableLiveData<Wallet> updateENSName = new MutableLiveData<>(); private final MutableLiveData<Wallet> updateENSName = new MutableLiveData<>();
@ -119,6 +120,7 @@ public class WalletsViewModel extends BaseViewModel
{ {
return createWalletError; return createWalletError;
} }
public LiveData<Boolean> noWalletsError() { return noWalletsError; }
public LiveData<Wallet> updateBalance() public LiveData<Wallet> updateBalance()
{ {
@ -155,8 +157,8 @@ public class WalletsViewModel extends BaseViewModel
disposable = genericWalletInteract disposable = genericWalletInteract
.find() .find()
.subscribe(this::onDefaultWalletChanged, t -> { .subscribe(this::onDefaultWalletChanged,
}); error -> noWalletsError.postValue(true));
} }
private void onWallets(Wallet[] items) private void onWallets(Wallet[] items)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

@ -0,0 +1,39 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="93dp"
android:height="66dp"
android:viewportWidth="93"
android:viewportHeight="66">
<path
android:pathData="M68,30.5a6.5,6.5 0,1 1,-13.001 -0.001A6.5,6.5 0,0 1,68 30.5"
android:fillColor="#F9D021"
android:fillType="evenOdd"/>
<path
android:pathData="M75,27c-0.334,0.337 -0.667,0.668 -0.993,1L74,27.995c0.333,-0.332 0.659,-0.663 1,-0.995"
android:fillColor="#75B943"
android:fillType="evenOdd"/>
<path
android:pathData="M75,27c-0.334,0.337 -0.667,0.668 -0.993,1L74,27.995c0.333,-0.332 0.659,-0.663 1,-0.995"
android:fillColor="#FFFFFE"
android:fillType="evenOdd"/>
<group>
<clip-path android:pathData="M0.013,0.113h92.933V66H0.013z M 0,0"/>
<path
android:pathData="M89.889,2.781A16292.8896,16292.8896 0,0 1,75.54 25.475l-0.802,1.261c-0.172,0.272 -0.34,0.539 -0.509,0.802 -1.28,-4.974 -5.409,-8.798 -10.534,-9.603 0.231,-0.368 7.423,-11.798 9.238,-14.703 0.208,-0.333 0.39,-0.58 0.851,-0.578 5.288,0.018 10.573,0.016 15.86,0.021 0.048,0 0.097,0.04 0.244,0.106"
android:fillColor="#75B943"
android:fillType="evenOdd"/>
</group>
<group>
<clip-path android:pathData="M0.013,0.113h92.933V66H0.013z M 0,0"/>
<path
android:pathData="M92.946,58.934c-2.647,3.155 -5.627,5.384 -9.415,6.28 -5.205,1.229 -10.163,0.672 -14.608,-2.56 -3.23,-2.346 -5.199,-5.633 -6.63,-9.287a48.607,48.607 0,0 1,-0.149 -0.387c-0.01,-0.031 -0.023,-0.062 -0.034,-0.092 -0.37,-0.98 -1.013,-2.752 -1.64,-4.668 -0.512,-1.564 -1.012,-3.224 -1.346,-4.63 0.823,0.167 1.677,0.253 2.549,0.253 3.852,0 7.313,-1.688 9.686,-4.368l0.027,-0.029c0.871,2.172 1.78,5.581 2.642,8.232a33.349,33.349 0,0 0,0.703 1.982c0.956,2.4 1.972,4.749 3.893,6.529 0.13,0.117 0.262,0.234 0.398,0.348 2.5,2.081 5.492,2.625 8.614,2.728 1.697,0.054 3.379,-0.178 5.31,-0.331"
android:fillColor="#DB393A"
android:fillType="evenOdd"/>
</group>
<group>
<clip-path android:pathData="M0.013,0.113h92.933V66H0.013z M 0,0"/>
<path
android:pathData="M50.699,37.763c-3.074,4.318 -6.406,8.43 -10.327,12.072 -3.305,3.07 -6.825,5.817 -11.072,7.475 -1.62,0.632 -3.299,0.98 -5.043,0.966 -4.93,0.01 -8.474,-3.094 -9.522,-8.283 -0.93,-4.611 -0.46,-9.152 0.827,-13.596 2.385,-8.232 6.575,-15.509 12.13,-21.978 2.515,-2.926 5.402,-5.442 9.174,-6.646 2.667,-0.85 5.35,-1.094 7.956,0.252 2.008,1.038 3.407,2.71 4.525,4.625 1.59,2.72 2.575,5.676 3.427,8.678a12.891,12.891 0,0 1,8.899 -3.552c0.688,0 1.365,0.054 2.023,0.159l0.78,-1.24c-0.59,-1.366 -1.093,-2.61 -1.657,-3.822 -1.765,-3.772 -4.174,-7.032 -7.647,-9.387C51.05,0.691 46.475,-0.204 41.565,0.208c-6.263,0.526 -12.104,2.356 -17.44,5.668C15.647,11.14 8.99,18.193 4.316,27.048 1.323,32.715 -0.4,38.754 0.08,45.248 0.7,53.63 4.9,59.625 12.375,63.29c5.814,2.851 12.005,3.109 18.275,2.336 5.212,-0.644 10.126,-2.365 14.656,-5 5.497,-3.194 10.26,-7.359 14.697,-11.902 0.152,-0.157 0.253,-0.39 0.466,-0.503 -0.51,-1.564 -1.011,-3.224 -1.345,-4.63a12.983,12.983 0,0 1,-8.425 -5.827"
android:fillColor="#54C1E3"
android:fillType="evenOdd"/>
</group>
</vector>

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="100dp"
android:width="150dp"
android:viewportHeight="100"
android:viewportWidth="100" >
<group
android:name="triableGroup">
<path
android:name="triangle"
android:fillColor="@color/white"
android:pathData="m 50,0 l 50,100 -100,0 z" />
</group>
</vector>

@ -2,9 +2,7 @@
<layer-list <layer-list
xmlns:android="http://schemas.android.com/apk/res/android" > xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@color/white" /> <item android:drawable="@color/white" />
<item> <item
<bitmap android:drawable="@drawable/ic_logo"
android:gravity="center" android:gravity="center"/>
android:src="@drawable/ic_splash_welcome" /> </layer-list>
</item>
</layer-list>

@ -1,11 +1,16 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/colorPrimaryDark" android:background="@color/colorPrimaryDark"
android:orientation="vertical"> android:orientation="vertical">
<include layout="@layout/layout_simple_toolbar" /> <LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/layout_white_toolbar" />
<RelativeLayout <RelativeLayout
android:id="@+id/relativeLayout3" android:id="@+id/relativeLayout3"
@ -76,6 +81,7 @@
android:layout_marginStart="25dp" android:layout_marginStart="25dp"
android:layout_marginTop="25dp" android:layout_marginTop="25dp"
android:layout_marginEnd="25dp" android:layout_marginEnd="25dp"
android:lineSpacingExtra="4sp"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:text="@string/backup_seed_phrase_detail" /> android:text="@string/backup_seed_phrase_detail" />
@ -91,4 +97,24 @@
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/layout_success_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:visibility="gone"
android:background="@color/blur">
<ImageView
android:id="@+id/success_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|center_horizontal|center_vertical"
android:src="@drawable/big_green_tick"
android:foregroundGravity="center" />
</LinearLayout>
</RelativeLayout>

@ -7,7 +7,7 @@
android:background="@color/colorPrimaryDark" android:background="@color/colorPrimaryDark"
android:orientation="vertical"> android:orientation="vertical">
<include layout="@layout/layout_simple_toolbar" /> <include layout="@layout/layout_white_toolbar" />
<RelativeLayout <RelativeLayout
android:id="@+id/relativeLayout3" android:id="@+id/relativeLayout3"

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimaryDark"
android:orientation="vertical">
<include layout="@layout/layout_simple_toolbar" />
<RelativeLayout
android:id="@+id/relativeLayout3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/background_card"
android:focusable="true"
android:focusableInTouchMode="true">
<TextView
android:id="@+id/text_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_gravity="center_horizontal"
android:layout_marginStart="20dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="20dp"
android:fontFamily="@font/font_light"
android:gravity="center_horizontal"
android:text="@string/what_is_keystore_json"
android:textColor="@color/black"
android:textSize="28sp" />
<LinearLayout
android:id="@+id/layout_word_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="10dp"
android:orientation="vertical"
android:visibility="visible" />
<LinearLayout
android:id="@+id/view_holder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/text_title"
android:layout_centerHorizontal="true"
android:orientation="vertical">
<ImageView
android:id="@+id/seed_image_small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@drawable/ic_keystore"
android:scaleType="fitCenter"
android:visibility="gone" />
<ImageView
android:id="@+id/seed_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:visibility="visible"
android:background="@drawable/ic_keystore"
android:scaleType="fitCenter" />
</LinearLayout>
<TextView
android:id="@+id/text_detail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/view_holder"
android:layout_marginStart="25dp"
android:layout_marginTop="25dp"
android:layout_marginEnd="25dp"
android:lineSpacingExtra="4sp"
android:gravity="center_horizontal"
android:text="@string/backup_seed_phrase_detail" />
<LinearLayout
android:id="@+id/button_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical">
<include layout="@layout/item_bottom_buttons" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>

@ -50,6 +50,7 @@
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:layout_marginEnd="42dp" android:layout_marginEnd="42dp"
android:text="@string/keystore_loss_warning" android:text="@string/keystore_loss_warning"
android:lineSpacingExtra="2sp"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:textColor="@color/text_dark_gray" android:textColor="@color/text_dark_gray"
android:textSize="14sp"/> android:textSize="14sp"/>

@ -5,7 +5,7 @@
android:background="@color/colorPrimaryDark" android:background="@color/colorPrimaryDark"
android:orientation="vertical"> android:orientation="vertical">
<include layout="@layout/layout_simple_toolbar" /> <include layout="@layout/layout_white_toolbar" />
<RelativeLayout <RelativeLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -25,6 +25,7 @@
android:layout_marginEnd="35dp" android:layout_marginEnd="35dp"
android:fontFamily="@font/font_regular" android:fontFamily="@font/font_regular"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:lineSpacingExtra="4sp"
android:text="@string/make_a_backup" android:text="@string/make_a_backup"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="17sp" /> android:textSize="17sp" />

@ -1,16 +1,35 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto" xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/white"> android:background="@color/white">
<ImageView <LinearLayout
android:id="@+id/splash_image" android:layout_width="match_parent"
android:layout_width="wrap_content" android:layout_height="match_parent"
android:layout_height="wrap_content" android:layout_above="@id/layout_new_wallet"
android:background="@drawable/splash_background" android:layout_alignParentTop="true"
android:layout_centerInParent="true"/> android:orientation="vertical"
android:gravity="center">
<ImageView
android:id="@+id/splash_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/splash_background"
android:gravity="center_horizontal"/>
<TextView
android:layout_marginTop="9dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="26sp"
android:textColor="@color/text_black"
android:gravity="center_horizontal"
android:text="@string/welcome_to_alphawallet"/>
</LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/layout_new_wallet" android:id="@+id/layout_new_wallet"

@ -7,7 +7,7 @@
android:background="@color/colorPrimaryDark" android:background="@color/colorPrimaryDark"
android:orientation="vertical"> android:orientation="vertical">
<include layout="@layout/layout_simple_toolbar" /> <include layout="@layout/layout_white_toolbar" />
<RelativeLayout <RelativeLayout
android:id="@+id/relativeLayout3" android:id="@+id/relativeLayout3"

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/white"
android:contentInsetEnd="0dp"
android:contentInsetLeft="0dp"
android:contentInsetRight="0dp"
android:contentInsetStart="0dp"
android:theme="@style/AppTheme.WhiteToolbar"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:titleTextAppearance="@style/AppTheme.Toolbar.WhiteTitle">
<TextView
android:id="@+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:ellipsize="end"
android:fontFamily="@font/font_light"
android:gravity="center"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:singleLine="true"
android:textColor="@color/black"
android:textSize="25sp" />
</android.support.v7.widget.Toolbar>

@ -4,6 +4,7 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout <LinearLayout
android:id="@+id/layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
@ -24,6 +25,7 @@
android:fontFamily="@font/font_regular" android:fontFamily="@font/font_regular"
android:text="@string/title_back_up_your_wallet" android:text="@string/title_back_up_your_wallet"
android:textColor="@color/text_black" android:textColor="@color/text_black"
android:gravity="center_horizontal"
android:textSize="25sp" /> android:textSize="25sp" />
<TextView <TextView
@ -47,7 +49,18 @@
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="16sp" android:textSize="16sp"
android:textStyle="normal" /> android:textStyle="normal" />
</LinearLayout> </LinearLayout>
<ImageView
android:layout_width="40dp"
android:layout_height="16dp"
android:layout_below="@id/layout"
android:layout_alignEnd="@id/layout"
android:layout_marginTop="0dp"
android:layout_marginEnd="10dp"
android:rotation="180"
android:src="@drawable/item_white_triangle" />
</RelativeLayout> </RelativeLayout>

@ -4,6 +4,7 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout <LinearLayout
android:id="@+id/layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
@ -21,6 +22,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="21dp" android:layout_marginBottom="21dp"
android:gravity="center_horizontal"
android:fontFamily="@font/font_regular" android:fontFamily="@font/font_regular"
android:text="@string/title_find_your_wallet_address" android:text="@string/title_find_your_wallet_address"
android:textColor="@color/text_black" android:textColor="@color/text_black"
@ -49,5 +51,15 @@
android:textStyle="normal" /> android:textStyle="normal" />
</LinearLayout> </LinearLayout>
<ImageView
android:layout_width="40dp"
android:layout_height="16dp"
android:layout_below="@id/layout"
android:layout_alignEnd="@id/layout"
android:layout_marginTop="0dp"
android:layout_marginEnd="10dp"
android:rotation="180"
android:src="@drawable/item_white_triangle" />
</RelativeLayout> </RelativeLayout>

@ -178,4 +178,6 @@
<string name="reimport_wallet_title">Re-Import Wallet?</string> <string name="reimport_wallet_title">Re-Import Wallet?</string>
<string name="provide_authentication">Provide authentication to create key</string> <string name="provide_authentication">Provide authentication to create key</string>
<string name="import_error">Import Error, Try re-import again.</string> <string name="import_error">Import Error, Try re-import again.</string>
<string name="welcome_to_alphawallet">Welcome to AlphaWallet</string>
<string name="logo">AlphaWallet Logo</string>
</resources> </resources>

@ -444,4 +444,6 @@
<string name="reimport_wallet_title">Re-Import Wallet?</string> <string name="reimport_wallet_title">Re-Import Wallet?</string>
<string name="provide_authentication">Provide authentication to create key</string> <string name="provide_authentication">Provide authentication to create key</string>
<string name="import_error">Import Error, Try re-import again.</string> <string name="import_error">Import Error, Try re-import again.</string>
<string name="welcome_to_alphawallet">Welcome to AlphaWallet</string>
<string name="logo">AlphaWallet Logo</string>
</resources> </resources>

@ -580,4 +580,6 @@
<string name="reimport_wallet_title">Re-Import Wallet?</string> <string name="reimport_wallet_title">Re-Import Wallet?</string>
<string name="provide_authentication">Provide authentication to create key</string> <string name="provide_authentication">Provide authentication to create key</string>
<string name="import_error">Import Error, Try re-import again.</string> <string name="import_error">Import Error, Try re-import again.</string>
<string name="welcome_to_alphawallet">Welcome to AlphaWallet</string>
<string name="logo">AlphaWallet Logo</string>
</resources> </resources>

@ -34,4 +34,13 @@
<item name="android:textSize">20sp</item> <item name="android:textSize">20sp</item>
</style> </style>
<style name="AppTheme.Toolbar.WhiteTitle" parent="TextAppearance.Widget.AppCompat.Toolbar.Title">
<item name="android:textColor">@color/text_black</item>
<item name="android:textSize">20sp</item>
</style>
<style name="AppTheme.WhiteToolbar" parent="ThemeOverlay.AppCompat.ActionBar">
<item name="colorControlNormal">@color/text_black</item>
</style>
</resources> </resources>

@ -28,7 +28,8 @@ public class CryptoFunctions implements CryptoFunctionsInterface
public BigInteger signedMessageToKey(byte[] data, byte[] signature) throws SignatureException public BigInteger signedMessageToKey(byte[] data, byte[] signature) throws SignatureException
{ {
Sign.SignatureData sigData = sigFromByteArray(signature); Sign.SignatureData sigData = sigFromByteArray(signature);
return Sign.signedMessageToKey(data, sigData); if (sigData == null) return BigInteger.ZERO;
else return Sign.signedMessageToKey(data, sigData);
} }
@Override @Override
@ -39,6 +40,8 @@ public class CryptoFunctions implements CryptoFunctionsInterface
public static Sign.SignatureData sigFromByteArray(byte[] sig) public static Sign.SignatureData sigFromByteArray(byte[] sig)
{ {
if (sig.length < 64 || sig.length > 65) return null;
byte subv = sig[64]; byte subv = sig[64];
if (subv < 27) subv += 27; if (subv < 27) subv += 27;

Loading…
Cancel
Save