Browse Source

Messaging for seedphrase backup

pull/15/head
fekt 1 year ago
parent
commit
30d2017bd3
  1. 9
      app/src/main/java/cash/z/ecc/android/ui/setup/BackupFragment.kt
  2. 17
      app/src/main/res/layout/fragment_backup.xml
  3. 2
      app/src/main/res/layout/fragment_profile.xml
  4. 4
      app/src/main/res/navigation/mobile_navigation.xml
  5. 3
      app/src/main/res/values/custom_translations.xml
  6. 4
      app/src/main/res/values/missing_translation.xml
  7. 1
      app/src/main/res/values/strings.xml
  8. 1
      app/src/zcashmainnet/res/values/strings.xml

9
app/src/main/java/cash/z/ecc/android/ui/setup/BackupFragment.kt

@ -63,6 +63,9 @@ class BackupFragment : BaseFragment<FragmentBackupBinding>() {
binding.buttonPositive.setOnClickListener {
onEnterWallet().also { if (hasBackUp) tapped(BACKUP_DONE) else tapped(BACKUP_VERIFY) }
}
binding.buttonSeedphraseMoreInfo.setOnClickListener {
openSeedPhraseMoreInfoLink()
}
if (hasBackUp) {
binding.buttonPositive.text = getString(R.string.backup_button_done)
}
@ -155,4 +158,10 @@ class BackupFragment : BaseFragment<FragmentBackupBinding>() {
result
}
}
private fun openSeedPhraseMoreInfoLink() {
getString(R.string.seedphrase_more_info_url).takeUnless { it.isBlank() }?.let { url ->
mainActivity?.onLaunchUrl(url)
}
}
}

17
app/src/main/res/layout/fragment_backup.xml

@ -12,7 +12,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.667" />
app:layout_constraintGuide_percent="0.75" />
<!-- Address parts -->
@ -363,14 +363,15 @@ text_address_part_3, text_address_part_6, text_address_part_9, text_address_part
<!-- Choose release names from here https://en.wikipedia.org/wiki/List_of_woods -->
<TextView
android:id="@+id/text_message"
style="@style/TextAppearance.MaterialComponents.Headline6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/TextAppearance.MaterialComponents.Headline6"
android:gravity="center"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="@string/backup_instruction_store_words"
android:textColor="@color/zcashWhite"
android:textSize="16sp"
app:layout_constraintBottom_toTopOf="@id/guideline_buttons"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@ -380,7 +381,19 @@ text_address_part_3, text_address_part_6, text_address_part_9, text_address_part
android:id="@+id/button_positive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="320dp"
android:text="@string/backup_button_primary"
android:textColor="@color/text_light"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_seedphrase_more_info" />
<com.google.android.material.button.MaterialButton
android:id="@+id/button_seedphrase_more_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="320dp"
android:text="@string/backup_button_more_info"
android:textColor="@color/text_dark"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

2
app/src/main/res/layout/fragment_profile.xml

@ -210,7 +210,7 @@
android:id="@+id/text_banner_message"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="64dp"
android:layout_marginBottom="102dp"
android:background="@drawable/background_banner"
android:elevation="6dp"
android:paddingStart="16dp"

4
app/src/main/res/navigation/mobile_navigation.xml

@ -282,6 +282,10 @@
android:id="@+id/nav_backup"
android:name="cash.z.ecc.android.ui.setup.BackupFragment"
tools:layout="@layout/fragment_backup" >
<activity
android:id="@+id/button_seedphrase_more_info"
app:action="android.intent.action.VIEW"
app:data="@string/seedphrase_more_info_url" />
</fragment>
<fragment

3
app/src/main/res/values/custom_translations.xml

@ -5,7 +5,8 @@
<!-- Manual -->
<string name="custom_translation_verify">Verify</string>
<string name="custom_translation_verify">I have written down my seed phrase and stored securely</string>
<string name="custom_translation_seedphrase_more_info">More information</string>
<string name="custom_translation_birthday">Birthday Height: %1$,d</string>
<string name="custom_translation_expecting">Expecting</string>
<string name="custom_translation_syncing">Downloading…%1$d%%</string>

4
app/src/main/res/values/missing_translation.xml

@ -6,9 +6,9 @@
<!-- ======================================================================================= -->
<string name="missing_cancel">Cancel</string>
<string name="missing_backup_instruction_store_words">Store these backup words securely.</string>
<string name="missing_backup_instruction_store_words">Write down these 24 words on paper. Make sure you write them in the correct order and don\'t misspell any words. Make a copy of that paper and store them securely in at least 2 physical locations</string>
<string name="missing_backup_slogan">empowering\neveryone\nwith\neconomic\nfreedom</string>
<string name="missing_backup_verification_not_implemented">Backup verification coming soon!</string>
<string name="missing_backup_verification_not_implemented">You may lose all your funds if you didn\'t actually backup! Be smart and responsible!</string>
<!-- -->
<!-- SCREENS -->

1
app/src/main/res/values/strings.xml

@ -13,6 +13,7 @@
<!-- Screen: Backup -->
<string name="backup_button_done">@string/translated_button_done</string>
<string name="backup_button_primary">@string/custom_translation_verify</string>
<string name="backup_button_more_info">@string/custom_translation_seedphrase_more_info</string>
<string name="backup_format_birthday_height">@string/custom_translation_birthday</string>
<string name="backup_instruction_store_words">@string/missing_backup_instruction_store_words</string>
<string name="backup_slogan">@string/missing_backup_slogan</string>

1
app/src/zcashmainnet/res/values/strings.xml

@ -2,4 +2,5 @@
<string name="api_block_explorer">https://explorer.hush.is/tx/%1$s</string>
<string name="symbol" translatable="false">HUSH</string>
<string name="play_store_url" translatable="false">https://hush.is</string>
<string name="seedphrase_more_info_url">https://hush.is/seedphrase</string>
</resources>

Loading…
Cancel
Save