More Street Mode

This commit is contained in:
fekt
2023-03-01 00:13:37 -05:00
parent 8f52977c73
commit 22d6721d03
2 changed files with 63 additions and 58 deletions

View File

@@ -114,15 +114,19 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
) )
hitAreaProfile.onClickNavTo(R.id.action_nav_home_to_nav_profile) { tapped(HOME_PROFILE) } hitAreaProfile.onClickNavTo(R.id.action_nav_home_to_nav_profile) { tapped(HOME_PROFILE) }
textHistory.onClickNavTo(R.id.action_nav_home_to_nav_history) { tapped(HOME_HISTORY) } textHistory.onClickNavTo(R.id.action_nav_home_to_nav_history) { tapped(HOME_HISTORY) }
textSendAmount.onClickNavTo(R.id.action_nav_home_to_nav_balance_detail) {
tapped( // Only allow viewing balance detail when not in Street Mode
HOME_BALANCE_DETAIL if(!lockBox.getBoolean(Const.Pref.STREET_MODE)) {
) textSendAmount.onClickNavTo(R.id.action_nav_home_to_nav_balance_detail) {
} tapped(
hitAreaBalance.onClickNavTo(R.id.action_nav_home_to_nav_balance_detail) { HOME_BALANCE_DETAIL
tapped( )
HOME_BALANCE_DETAIL }
) hitAreaBalance.onClickNavTo(R.id.action_nav_home_to_nav_balance_detail) {
tapped(
HOME_BALANCE_DETAIL
)
}
} }
hitAreaReceive.onClickNavTo(R.id.action_nav_home_to_nav_receive) { tapped(HOME_RECEIVE) } hitAreaReceive.onClickNavTo(R.id.action_nav_home_to_nav_receive) { tapped(HOME_RECEIVE) }
@@ -327,6 +331,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
if(lockBox.getBoolean(Const.Pref.STREET_MODE)) { if(lockBox.getBoolean(Const.Pref.STREET_MODE)) {
binding.textBalanceAvailable.visibility = View.INVISIBLE binding.textBalanceAvailable.visibility = View.INVISIBLE
binding.labelBalance.visibility = View.INVISIBLE binding.labelBalance.visibility = View.INVISIBLE
binding.textBalanceDescription.visibility = View.INVISIBLE
binding.textHistory.visibility = View.INVISIBLE binding.textHistory.visibility = View.INVISIBLE
binding.textSendAmount.isEnabled = false binding.textSendAmount.isEnabled = false
} }
@@ -486,19 +491,6 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
mainActivity?.safeNavigate(R.id.action_nav_home_to_nav_receive) mainActivity?.safeNavigate(R.id.action_nav_home_to_nav_receive)
} }
.show() .show()
// MaterialAlertDialogBuilder(activity)
// .setMessage("To make full use of this wallet, deposit funds to your address or tap the faucet to trigger a tiny automatic deposit.\n\nFaucet funds are made available for the community by the community for testing. So please be kind enough to return what you borrow!")
// .setTitle("No Balance")
// .setCancelable(true)
// .setPositiveButton("Tap Faucet") { dialog, _ ->
// dialog.dismiss()
// setBanner("Tapping faucet...", CANCEL)
// }
// .setNegativeButton("View Address") { dialog, _ ->
// dialog.dismiss()
// mainActivity?.safeNavigate(R.id.action_nav_home_to_nav_receive)
// }
// .show()
} }
CANCEL -> { CANCEL -> {
// TODO: trigger banner / balance update // TODO: trigger banner / balance update

View File

@@ -1,12 +1,27 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/background_home"> android:background="@drawable/background_home">
<View
android:id="@+id/loading_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/zcashWhite_24"
android:clickable="true"
android:elevation="8dp"
android:focusable="true"
android:focusableInTouchMode="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
<androidx.constraintlayout.widget.Guideline <androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_hit_area_top" android:id="@+id/guideline_hit_area_top"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@@ -32,7 +47,6 @@
android:layout_height="0dp" android:layout_height="0dp"
android:contentDescription="@string/content_description_settings_back" android:contentDescription="@string/content_description_settings_back"
android:elevation="6dp" android:elevation="6dp"
app:tint="@color/text_light_dimmed"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="H,1:1" app:layout_constraintDimensionRatio="H,1:1"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
@@ -41,14 +55,15 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.065" app:layout_constraintVertical_bias="0.065"
app:layout_constraintWidth_percent="0.08" app:layout_constraintWidth_percent="0.08"
app:srcCompat="@drawable/ic_cancel" /> app:srcCompat="@drawable/ic_cancel"
app:tint="@color/text_light_dimmed" />
<TextView <TextView
android:id="@+id/text_title" android:id="@+id/text_title"
style="@style/TextAppearance.MaterialComponents.Headline6"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="@style/TextAppearance.MaterialComponents.Headline6"
android:maxLines="1" android:maxLines="1"
android:text="@string/settings_change_lightwalletd_server" android:text="@string/settings_change_lightwalletd_server"
android:textColor="@color/text_light" android:textColor="@color/text_light"
@@ -109,33 +124,18 @@
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<CheckBox
android:id="@+id/streetMode"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="12dp"
android:checked="false"
android:text="Street Mode (Hides balance and tx list)"
app:layout_constraintBottom_toTopOf="@+id/button_reset"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text_input_layout_port" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/button_reset" android:id="@+id/button_reset"
style="@style/Zcash.Button.OutlinedButton" style="@style/Zcash.Button.OutlinedButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="12dp" android:layout_marginTop="16dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:text="@string/settings_reset" android:text="@string/settings_reset"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
android:textColor="@color/selector_secondary_button_activatable" android:textColor="@color/selector_secondary_button_activatable"
app:layout_constraintEnd_toStartOf="@id/button_update" app:layout_constraintEnd_toStartOf="@id/button_update"
app:layout_constraintTop_toBottomOf="@+id/streetMode" app:layout_constraintTop_toBottomOf="@+id/text_input_layout_port"
app:strokeColor="@color/selector_secondary_button_activatable" /> app:strokeColor="@color/selector_secondary_button_activatable" />
<ProgressBar <ProgressBar
@@ -152,25 +152,26 @@
style="@style/Zcash.Button" style="@style/Zcash.Button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="12dp" android:layout_marginTop="16dp"
android:layout_marginEnd="4dp" android:layout_marginEnd="4dp"
android:backgroundTint="@color/colorPrimary" android:backgroundTint="@color/colorPrimary"
android:text="@string/settings_update" android:text="@string/settings_update"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
app:layout_constraintEnd_toEndOf="@id/text_input_layout_host" app:layout_constraintEnd_toEndOf="@id/text_input_layout_host"
app:layout_constraintTop_toBottomOf="@+id/streetMode" /> app:layout_constraintTop_toBottomOf="@+id/text_input_layout_port" />
<View <CheckBox
android:id="@+id/loading_view" android:id="@+id/streetMode"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:background="@color/zcashWhite_24" android:layout_marginStart="48dp"
android:clickable="true" android:layout_marginTop="16dp"
android:elevation="8dp" android:layout_marginEnd="48dp"
android:focusable="true" android:layoutDirection="rtl"
android:focusableInTouchMode="true" android:text="@string/translated_street_mode"
tools:layout_editor_absoluteX="81dp" app:layout_constraintEnd_toEndOf="parent"
tools:layout_editor_absoluteY="16dp" /> app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textViewStreetMode" />
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
android:id="@+id/group_loading" android:id="@+id/group_loading"
@@ -185,10 +186,22 @@
android:layout_marginStart="48dp" android:layout_marginStart="48dp"
android:layout_marginTop="24dp" android:layout_marginTop="24dp"
android:layout_marginEnd="48dp" android:layout_marginEnd="48dp"
android:text="NOTE: You must fully close and restart the app for a server change to take effect. Entering and updating a server here will cause that server to be set in encrypted preferences and used all the time, otherwise a random server is chosen by default on startup." android:text="@string/translated_server_note"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_update" /> app:layout_constraintTop_toBottomOf="@id/button_update" />
<TextView
android:id="@+id/textViewStreetMode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:text="Other Settings"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/serverChangeNote" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>