Created info dialog in SendTransactionFragment using the MaterialDialog library, which shows an explanation of the fields on that screen.

This commit is contained in:
Severiano Jaramillo 2019-01-03 12:45:28 -06:00
parent bee79976b5
commit f32bfc567b
3 changed files with 107 additions and 1 deletions

View file

@ -17,6 +17,8 @@ import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProviders
import com.afollestad.materialdialogs.MaterialDialog
import com.afollestad.materialdialogs.customview.customView
import com.google.common.primitives.UnsignedLong
import com.google.zxing.BarcodeFormat
import com.google.zxing.Result
@ -453,7 +455,10 @@ class SendTransactionFragment : Fragment(), ZXingScannerView.ResultHandler, Serv
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
if (item?.itemId == R.id.menu_info) {
context?.toast("Info")
MaterialDialog(context!!).show {
customView(R.layout.dialog_send_transaction_info, scrollable = true)
positiveButton(android.R.string.ok) { dismiss() }
}
return true
}
return super.onOptionsItemSelected(item)

View file

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:layout_marginEnd="@dimen/activity_horizontal_margin">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/text__to"
android:textAppearance="@style/TextAppearance.Bitsy.Body1"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="@string/msg__to_explanation"
android:textAppearance="@style/TextAppearance.Bitsy.Body2"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_same_topic"
android:text="@string/text__asset_balance"
android:textAppearance="@style/TextAppearance.Bitsy.Body1"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="@string/msg__asset_balance_explanation"
android:textAppearance="@style/TextAppearance.Bitsy.Body2"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_same_topic"
android:text="@string/text__memo"
android:textAppearance="@style/TextAppearance.Bitsy.Body1"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="@string/msg__memo_explanation"
android:textAppearance="@style/TextAppearance.Bitsy.Body2"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_same_topic"
android:text="@string/text__network_fee"
android:textAppearance="@style/TextAppearance.Bitsy.Body1"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="@string/msg__network_fee_explanation"
android:textAppearance="@style/TextAppearance.Bitsy.Body2"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_same_topic"
android:text="@string/text__qr_code"
android:textAppearance="@style/TextAppearance.Bitsy.Body1"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="@string/msg__qr_code_explanation"
android:textAppearance="@style/TextAppearance.Bitsy.Body2"/>
</LinearLayout>

View file

@ -51,6 +51,28 @@
<string name="text__transaction_sent">Transaction sent!</string>
<string name="msg__transaction_not_sent">Unable to send transaction</string>
<!-- Send Transaction info dialog -->
<string name="msg__to_explanation">Type in the Bitshares account name of the person you want to send funds
to.\nFor example: agorise-faucet
</string>
<string name="text__asset_balance">Asset Balance</string>
<string name="msg__asset_balance_explanation">You can tap on the balance displayed to send all of that asset. Doing
so will fill in the Amount field for you.
</string>
<string name="msg__memo_explanation">Entering a Memo is not required, but taking notes on why you sent the funds is
nice for future reference. Memos are only visible to you and the person whom you sent funds to.
</string>
<string name="text__network_fee">Network Fee</string>
<string name="msg__network_fee_explanation">The Network fee is included in the amount that you want to send. For
example, if you want to send 50 BTS, BiTSy will actually send ~50.21 BTS. The added 0.21 in this example is the
Bitshares transaction fee plus 0.01% to the BiTSy Developer Team (typically ~1 cent).
</string>
<string name="text__qr_code">QR Code</string>
<string name="msg__qr_code_explanation">You do not need to scan someones QR to send funds, but it does help you to
avoid mistakes. Once you send funds from your account, they are gone forever, so always make sure the account
name in the “To” field is correct.
</string>
<!-- Receive Transaction -->
<string name="text__asset">Asset</string>
<string name="text__other">Other…</string>