Create SendTransactionFragment layout similar to Crystal's

This commit is contained in:
Severiano Jaramillo 2018-12-03 17:22:21 -06:00
parent 75bd1b2e03
commit 95404708a9
4 changed files with 186 additions and 7 deletions

View file

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M12,4l-1.41,1.41L16.17,11H4v2h12.17l-5.58,5.59L12,20l8,-8z"/>
</vector>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<corners
android:bottomLeftRadius="100dp"
android:topLeftRadius="100dp" />
<solid android:color="#5fcaff" />
</shape>

View file

@ -1,15 +1,181 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragments.SendTransactionFragment">
android:layout_height="match_parent">
<TextView
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/title_send"/>
android:layout_height="wrap_content"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".fragments.SendTransactionFragment">
</androidx.constraintlayout.widget.ConstraintLayout>
<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"/>
<androidx.constraintlayout.widget.Guideline
android:id="@+id/cameraVerticalGuideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.65"/>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tilTo"
style="@style/Widget.Bitsy.TextInputLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:layout_marginEnd="@dimen/activity_horizontal_margin"
android:hint="To"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/tietTo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"/>
</com.google.android.material.textfield.TextInputLayout>
<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="Amount"
android:layout_marginTop="@dimen/spacing_same_topic"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:layout_marginEnd="12dp"
app:layout_constraintTop_toBottomOf="@id/tilTo"
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"
android:layout_marginEnd="@dimen/activity_horizontal_margin"
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" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tilMemo"
style="@style/Widget.Bitsy.TextInputLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_same_topic"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:layout_marginEnd="@dimen/activity_horizontal_margin"
android:hint="Memo"
app:layout_constraintTop_toBottomOf="@id/tilAmount">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/tietMemo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:maxLines="3"/>
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:id="@+id/tvScan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_same_topic"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:text="Scan QR"
android:textAppearance="@style/TextAppearance.Bitsy.Body1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tilMemo" />
<View
android:id="@+id/viewCamera"
android:background="@color/black"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="@dimen/spacing_same_topic"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:visibility="visible"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintTop_toBottomOf="@+id/tvScan"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/cameraVerticalGuideline"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fabCloseCamera"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:fabCustomSize="32dp"
app:maxImageSize="20dp"
app:layout_constraintStart_toEndOf="@id/cameraVerticalGuideline"
app:layout_constraintTop_toBottomOf="@+id/tvScan"
app:srcCompat="@drawable/ic_camera" />
<me.dm7.barcodescanner.zxing.ZXingScannerView
android:id="@+id/ivCamera"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintDimensionRatio="w,3:4"
app:layout_constraintTop_toTopOf="@+id/viewCamera"
app:layout_constraintBottom_toBottomOf="@id/viewCamera"
app:layout_constraintStart_toStartOf="@id/viewCamera"
app:layout_constraintEnd_toEndOf="@id/viewCamera" />
<View
android:id="@+id/vSend"
android:layout_width="130dp"
android:layout_height="140dp"
android:layout_marginEnd="0dp"
android:background="@drawable/send_fab_background"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/viewCamera"
app:layout_constraintBottom_toBottomOf="@id/viewCamera"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/btnSend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_marginEnd="10dp"
app:fabCustomSize="90dp"
app:maxImageSize="70dp"
app:srcCompat="@drawable/ic_arrow_forward"
app:layout_constraintEnd_toEndOf="@id/vSend"
app:layout_constraintTop_toTopOf="@+id/vSend" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

View file

@ -7,6 +7,7 @@
<color name="black">#000</color>
<color name="gray">#888</color>
<color name="lightGray">#e0e0e0</color>
<color name="darkGray">#616161</color>
<color name="colorReceive">#669900</color>
<color name="colorSend">#DC473A</color>
</resources>