Merge pull request #610 from m2049r/feature_showheight

show restore height
This commit is contained in:
m2049r 2019-07-14 12:52:21 +02:00 committed by GitHub
commit 6ad423567f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 369 additions and 289 deletions

View File

@ -55,6 +55,8 @@ import com.m2049r.xmrwallet.util.KeyStoreHelper;
import com.m2049r.xmrwallet.util.MoneroThreadPoolExecutor;
import com.m2049r.xmrwallet.widget.Toolbar;
import java.text.NumberFormat;
import timber.log.Timber;
public class GenerateReviewFragment extends Fragment {
@ -72,6 +74,7 @@ public class GenerateReviewFragment extends Fragment {
private TextView tvWalletPassword;
private TextView tvWalletAddress;
private TextView tvWalletMnemonic;
private TextView tvWalletHeight;
private TextView tvWalletViewKey;
private TextView tvWalletSpendKey;
private ImageButton bCopyAddress;
@ -99,6 +102,7 @@ public class GenerateReviewFragment extends Fragment {
tvWalletViewKey = view.findViewById(R.id.tvWalletViewKey);
tvWalletSpendKey = view.findViewById(R.id.tvWalletSpendKey);
tvWalletMnemonic = view.findViewById(R.id.tvWalletMnemonic);
tvWalletHeight = view.findViewById(R.id.tvWalletHeight);
bCopyAddress = view.findViewById(R.id.bCopyAddress);
bAdvancedInfo = view.findViewById(R.id.bAdvancedInfo);
llAdvancedInfo = view.findViewById(R.id.llAdvancedInfo);
@ -188,6 +192,7 @@ public class GenerateReviewFragment extends Fragment {
private class AsyncShow extends AsyncTask<String, Void, Boolean> {
String name;
String address;
long height;
String seed;
String viewKey;
String spendKey;
@ -232,6 +237,7 @@ public class GenerateReviewFragment extends Fragment {
}
address = wallet.getAddress();
height = wallet.getRestoreHeight();
seed = wallet.getSeed();
switch (wallet.getDeviceType()) {
case Device_Ledger:
@ -264,6 +270,7 @@ public class GenerateReviewFragment extends Fragment {
llPassword.setVisibility(View.VISIBLE);
tvWalletPassword.setText(getPassword());
tvWalletAddress.setText(address);
tvWalletHeight.setText(NumberFormat.getInstance().format(height));
if (!seed.isEmpty()) {
llMnemonic.setVisibility(View.VISIBLE);
tvWalletMnemonic.setText(seed);
@ -288,6 +295,7 @@ public class GenerateReviewFragment extends Fragment {
} else {
// TODO show proper error message and/or end the fragment?
tvWalletAddress.setText(walletStatus.toString());
tvWalletHeight.setText(walletStatus.toString());
tvWalletMnemonic.setText(walletStatus.toString());
tvWalletViewKey.setText(walletStatus.toString());
tvWalletSpendKey.setText(walletStatus.toString());

View File

@ -77,6 +77,32 @@
tools:text="tucks slackens vehicle doctor oaks aloof balding knife rays wise haggled cuisine navy ladder suitcase dusted last thorn pixels karate ticket nibs violin zapped slackens" />
</LinearLayout>
<LinearLayout
android:id="@+id/llHeight"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/data_top"
android:orientation="vertical"
android:visibility="visible">
<TextView
style="@style/MoneroLabel.Heading"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:text="@string/label_restoreheight" />
<TextView
android:id="@+id/tvWalletHeight"
style="@style/MoneroText.Monospace.Mnemonic"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/data_top"
android:background="@drawable/backgound_seed"
android:textAlignment="center"
tools:text="1,878,151" />
</LinearLayout>
<LinearLayout
android:id="@+id/llPassword"
android:layout_width="match_parent"

View File

@ -380,5 +380,7 @@
<string name="bad_ledger_seed">Llavor de Ledger no vàlida!</string>
<string name="prompt_ledger_seed_warn">Introduir la vostra llavor del Ledger aquí té un elevat risc de seguretat!</string>
<string name="label_restoreheight">Restablir Alçada</string> <!-- Restore Height -->
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -383,5 +383,7 @@
<string name="bad_ledger_seed">Ungültiger Ledger-Seed!</string>
<string name="prompt_ledger_seed_warn">Deinen Ledger-Seed hier einzugeben, stellt ein erhebliches Sicherheitsrisiko dar!</string>
<string name="label_restoreheight">Wiederherstellungshöhe</string>
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -382,5 +382,7 @@
<string name="bad_ledger_seed">Invalid Ledger Seed!</string>
<string name="prompt_ledger_seed_warn">Entering your Ledger Seed here is a major security risk!</string>
<string name="label_restoreheight">Ύψος ανάκτησης</string> <!-- "Restore Height" -->
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -382,5 +382,7 @@
<string name="bad_ledger_seed">Invalid Ledger Seed!</string>
<string name="prompt_ledger_seed_warn">Entering your Ledger Seed here is a major security risk!</string>
<string name="label_restoreheight">Restaŭralteco</string> <!-- Restore Height -->
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -372,5 +372,7 @@
<string name="bad_ledger_seed">Invalid Ledger Seed!</string>
<string name="prompt_ledger_seed_warn">Entering your Ledger Seed here is a major security risk!</string>
<string name="label_restoreheight">Altura de Restauración</string> <!-- Restore Height -->
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -380,5 +380,7 @@
<string name="bad_ledger_seed">Invalid Ledger Seed!</string>
<string name="prompt_ledger_seed_warn">Entering your Ledger Seed here is a major security risk!</string>
<string name="label_restoreheight">Taastamise plokinumber</string> <!-- Restore Height -->
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -386,5 +386,7 @@
<string name="bad_ledger_seed">Phrase mnémonique Ledger invalide !</string>
<string name="prompt_ledger_seed_warn">Saisir votre phrase mnémonique Ledger ici est un risque majeur de sécurité !</string>
<string name="label_restoreheight">Hauteur de restauration</string> <!-- Restore Height -->
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -384,5 +384,7 @@
<string name="bad_ledger_seed">Invalid Ledger Seed!</string>
<string name="prompt_ledger_seed_warn">Entering your Ledger Seed here is a major security risk!</string>
<string name="label_restoreheight">Visszaállítási lánchossz</string> <!-- Restore Height -->
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -385,5 +385,7 @@
<string name="bad_ledger_seed">Seed di Ledger invalido!</string>
<string name="prompt_ledger_seed_warn">Inserire il tuo seed di Ledger qui è un grosso rischio!</string>
<string name="label_restoreheight">Altezza di ripristino</string> <!-- Restore Height -->
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -428,5 +428,7 @@
<string name="bad_ledger_seed">Ledgerのニーモニックシードは不正!</string>
<string name="prompt_ledger_seed_warn">ここにLedgerシードを入力するのは、大きなセキュリティリスクですよ</string>
<string name="label_restoreheight">Restore Height</string>
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -382,5 +382,7 @@
<string name="bad_ledger_seed">Invalid Ledger Seed!</string>
<string name="prompt_ledger_seed_warn">Entering your Ledger Seed here is a major security risk!</string>
<string name="label_restoreheight">Restore Height</string>
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -382,5 +382,7 @@
<string name="bad_ledger_seed">Invalid Ledger Seed!</string>
<string name="prompt_ledger_seed_warn">Entering your Ledger Seed here is a major security risk!</string>
<string name="label_restoreheight">Herstelpunt</string> <!-- Restore Height -->
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -374,5 +374,7 @@
<string name="bad_ledger_seed">Semente da Ledger inválida!</string>
<string name="prompt_ledger_seed_warn">Escrever a semente da sua Ledger aqui é um grande risco de segurança!</string>
<string name="label_restoreheight">Restaurar da altura</string> <!-- Restore Height -->
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -386,5 +386,7 @@
<string name="bad_ledger_seed">Semente do Ledger invalida!</string>
<string name="prompt_ledger_seed_warn">Introduzir a semente do Ledger aqui comporta um elevado risco de segurança!</string>
<string name="label_restoreheight">Restaurar de Altura</string> <!-- Restore Height -->
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -382,5 +382,7 @@
<string name="bad_ledger_seed">Invalid Ledger Seed!</string>
<string name="prompt_ledger_seed_warn">Entering your Ledger Seed here is a major security risk!</string>
<string name="label_restoreheight">Restaurează Monobloc</string> <!-- Restore Height -->
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -386,5 +386,7 @@
<string name="bad_ledger_seed">Ошибка фразы Ledger!</string>
<string name="prompt_ledger_seed_warn">Если вы пытаетесь ввести сюда фразу Ledger, это серьезная угроза для вашей безопасности!</string>
<string name="label_restoreheight">Восстановить высоту</string> <!-- Restore Height -->
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -383,5 +383,7 @@
<string name="bad_ledger_seed">Neplatný Ledger Seed!</string>
<string name="prompt_ledger_seed_warn">Vloženie Ledger Seedu sem je vážne bezpečnostné riziko!</string>
<string name="label_restoreheight">Výška</string> <!-- Restore Height -->
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -382,5 +382,7 @@
<string name="bad_ledger_seed">Nevalidno seme iz knjige računa!</string>
<string name="prompt_ledger_seed_warn">Unošenje tvog semena iz knjige računa na ovom mestu ima veliki sigurnosni rizik!</string>
<string name="label_restoreheight">Obnovi visinu</string> <!-- Restore Height -->
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -367,5 +367,7 @@
<string name="bad_ledger_seed">Invalid Ledger Seed!</string>
<string name="prompt_ledger_seed_warn">Entering your Ledger Seed here is a major security risk!</string>
<string name="label_restoreheight">Återställningshöjd</string> <!-- Restore Height -->
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -386,5 +386,7 @@
<string name="bad_ledger_seed">Invalid Ledger Seed!</string>
<string name="prompt_ledger_seed_warn">Entering your Ledger Seed here is a major security risk!</string>
<string name="label_restoreheight">Відновити висоту</string> <!-- Restore Height -->
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -304,5 +304,7 @@
<string name="bad_ledger_seed">无效的Ledger种子密语</string>
<string name="prompt_ledger_seed_warn">在此输入您的Ledger种子密语将会产生风险</string>
<string name="label_restoreheight">Restore Height</string>
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -381,5 +381,7 @@
<string name="bad_ledger_seed">無效的 Ledger 種子碼!</string>
<string name="prompt_ledger_seed_warn">在此輸入 Ledger 種子碼可能存在嚴重的安全風險!</string>
<string name="label_restoreheight">Restore Height</string>
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>

View File

@ -433,5 +433,7 @@
<string name="label_account" translatable="false">%1$s (%2$s)</string>
<string name="label_restoreheight">Restore Height</string>
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
</resources>