Create ReceiveTransactionFragment layout.

This commit is contained in:
Severiano Jaramillo 2018-12-06 19:09:36 -06:00
parent e50f4064df
commit dca3e6872d
5 changed files with 101 additions and 13 deletions

View file

@ -9,11 +9,13 @@ import cy.agorise.bitsybitshareswallet.R
class ReceiveTransactionFragment : Fragment() { class ReceiveTransactionFragment : Fragment() {
override fun onCreateView( override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
return inflater.inflate(R.layout.fragment_receive_transaction, container, false) return inflater.inflate(R.layout.fragment_receive_transaction, container, false)
} }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
}
} }

View file

@ -254,8 +254,9 @@ class SendTransactionFragment : Fragment(), ZXingScannerView.ResultHandler, Serv
} }
private fun handleRequiredFees(result: Any?) { private fun handleRequiredFees(result: Any?) {
if (result is GetRequiredFees) { if (result is List<*> && result[0] is AssetAmount) {
Log.d(TAG, "GetRequiredFees: " + result.toString()) Log.d(TAG, "GetRequiredFees: " + transaction.toString())
transaction!!.setFees(result as List<AssetAmount>) // TODO find how to remove this warning
} else { } else {
// TODO unableToSendTransactionError() // TODO unableToSendTransactionError()
} }

View file

@ -5,11 +5,90 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingStart="@dimen/activity_horizontal_margin"
android:paddingEnd="@dimen/activity_horizontal_margin"
tools:context=".fragments.ReceiveTransactionFragment"> tools:context=".fragments.ReceiveTransactionFragment">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/centeredVerticalGuideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5"/>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tilAmount"
style="@style/Widget.Bitsy.TextInputLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/text__amount"
android:layout_marginEnd="12dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/centeredVerticalGuideline">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/tietAmount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:inputType="numberDecimal"/>
</com.google.android.material.textfield.TextInputLayout>
<Spinner
android:id="@+id/spAsset"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginStart="12dp"
app:layout_constraintTop_toTopOf="@+id/tilAmount"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/centeredVerticalGuideline"/>
<View
android:id="@+id/vSpinner"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="12dp"
android:background="@color/darkGray"
app:layout_constraintTop_toBottomOf="@+id/spAsset"
app:layout_constraintEnd_toEndOf="@+id/spAsset"
app:layout_constraintStart_toStartOf="@+id/spAsset" />
<ImageView
android:id="@+id/ivQR"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="@dimen/spacing_different_topic"
android:layout_marginBottom="@dimen/spacing_different_topic"
android:background="@drawable/camera_view_background"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintTop_toBottomOf="@id/tilAmount"
app:layout_constraintBottom_toTopOf="@id/tvPleasePay"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<TextView <TextView
android:id="@+id/tvPleasePay"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:text="@string/title_receive"/> android:maxLines="1"
android:text="Please Pay: 12.25316 BTS"
android:textAppearance="@style/TextAppearance.Bitsy.Body1"
android:textAlignment="center"
app:layout_constraintBottom_toTopOf="@id/tvTo"/>
<TextView
android:id="@+id/tvTo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:text="To: seventest-3"
android:textAppearance="@style/TextAppearance.Bitsy.Body1"
android:textAlignment="center"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -32,10 +32,9 @@
style="@style/Widget.Bitsy.TextInputLayout" style="@style/Widget.Bitsy.TextInputLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginStart="@dimen/activity_horizontal_margin" android:layout_marginStart="@dimen/activity_horizontal_margin"
android:layout_marginEnd="@dimen/activity_horizontal_margin" android:layout_marginEnd="@dimen/activity_horizontal_margin"
android:hint="To" android:hint="@string/text__to"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
@ -54,7 +53,7 @@
style="@style/Widget.Bitsy.TextInputLayout" style="@style/Widget.Bitsy.TextInputLayout"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="Amount" android:hint="@string/text__amount"
android:layout_marginTop="@dimen/spacing_same_topic" android:layout_marginTop="@dimen/spacing_same_topic"
android:layout_marginStart="@dimen/activity_horizontal_margin" android:layout_marginStart="@dimen/activity_horizontal_margin"
android:layout_marginEnd="12dp" android:layout_marginEnd="12dp"
@ -111,7 +110,7 @@
android:layout_marginTop="@dimen/spacing_same_topic" android:layout_marginTop="@dimen/spacing_same_topic"
android:layout_marginStart="@dimen/activity_horizontal_margin" android:layout_marginStart="@dimen/activity_horizontal_margin"
android:layout_marginEnd="@dimen/activity_horizontal_margin" android:layout_marginEnd="@dimen/activity_horizontal_margin"
android:hint="Memo" android:hint="@string/text__memo"
app:layout_constraintTop_toBottomOf="@id/tilAmount"> app:layout_constraintTop_toBottomOf="@id/tilAmount">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
@ -129,7 +128,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_same_topic" android:layout_marginTop="@dimen/spacing_same_topic"
android:layout_marginStart="@dimen/activity_horizontal_margin" android:layout_marginStart="@dimen/activity_horizontal_margin"
android:text="Scan QR" android:text="@string/text__scan_qr"
android:textAppearance="@style/TextAppearance.Bitsy.Body1" android:textAppearance="@style/TextAppearance.Bitsy.Body1"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tilMemo" /> app:layout_constraintTop_toBottomOf="@id/tilMemo" />

View file

@ -41,8 +41,15 @@
<!-- Balances --> <!-- Balances -->
<string name="title_transactions">Transactions</string> <string name="title_transactions">Transactions</string>
<!-- Send Transaction Fragment -->
<string name="text__to">To</string>
<!-- Settings --> <!-- Settings -->
<string name="title_settings">Settings</string> <string name="title_settings">Settings</string>
<string name="night_mode">Night mode</string> <string name="night_mode">Night mode</string>
<string name="text__amount">Amount</string>
<string name="text__memo">Memo</string>
<string name="text__scan_qr">Scan QR</string>
</resources> </resources>