Improved SendTransactionLayout to adjust to different screen sizes and fixed text color

This commit is contained in:
Severiano Jaramillo 2018-01-25 15:49:43 -06:00
parent ff971ee492
commit bf45cae2a1
3 changed files with 218 additions and 213 deletions

View file

@ -69,8 +69,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="24dp" android:layout_marginTop="24dp"
android:layout_marginStart="24dp" android:layout_marginStart="24dp"
android:inputType="textMultiLine" android:inputType="numberDecimal"
android:textColor="@color/white"
android:textSize="20sp" android:textSize="20sp"
android:hint="@string/amount" android:hint="@string/amount"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"

View file

@ -1,239 +1,243 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout <ScrollView
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"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<View <android.support.constraint.ConstraintLayout
android:id="@+id/topView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:background="@drawable/send_transaction_top_view"
android:layout_height="120dp"
android:layout_marginEnd="0dp"
android:layout_marginStart="0dp"
android:layout_marginTop="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="24dp" android:paddingBottom="24dp">
android:layout_marginTop="24dp"
android:text="@string/title_capital"
android:textColor="@color/white"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<cy.agorise.crystalwallet.util.CircularImageView <View
android:id="@+id/gravatar" android:id="@+id/topView"
android:layout_width="60dp" android:layout_width="match_parent"
android:layout_height="60dp" android:background="@drawable/send_transaction_top_view"
android:src="@drawable/ken_code_gravatar" android:layout_height="120dp"
android:layout_marginStart="32dp" android:layout_marginEnd="0dp"
android:layout_marginTop="90dp" android:layout_marginStart="0dp"
app:layout_constraintStart_toStartOf="parent" android:layout_marginTop="0dp"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Spinner <TextView
android:id="@+id/spFrom" android:layout_width="wrap_content"
android:layout_width="0dp" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:layout_marginStart="24dp"
android:layout_marginEnd="24dp" android:layout_marginTop="24dp"
android:layout_marginStart="16dp" android:text="@string/title_capital"
app:layout_constraintEnd_toEndOf="parent" android:textColor="@color/white"
app:layout_constraintStart_toEndOf="@id/gravatar" android:textSize="20sp"
app:layout_constraintTop_toTopOf="@id/gravatar" /> android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView <cy.agorise.crystalwallet.util.CircularImageView
android:id="@+id/tvFromError" android:id="@+id/gravatar"
android:layout_width="0dp" android:layout_width="60dp"
android:layout_height="wrap_content" android:layout_height="60dp"
android:textColor="@color/red" android:src="@drawable/ken_code_gravatar"
app:layout_constraintEnd_toEndOf="@+id/spFrom" android:layout_marginStart="32dp"
app:layout_constraintStart_toStartOf="@+id/spFrom" android:layout_marginTop="90dp"
app:layout_constraintTop_toBottomOf="@+id/topView" /> app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText <Spinner
android:id="@+id/etTo" android:id="@+id/spFrom"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="24dp" android:layout_marginEnd="24dp"
android:layout_marginStart="24dp" android:layout_marginStart="16dp"
android:layout_marginTop="24dp" app:layout_constraintEnd_toEndOf="parent"
android:gravity="top" app:layout_constraintStart_toEndOf="@id/gravatar"
android:inputType="textMultiLine" app:layout_constraintTop_toTopOf="@id/gravatar" />
android:textColor="@color/white"
android:textSize="20sp"
android:hint="@string/to_capital"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/gravatar" />
<ImageView <TextView
android:id="@+id/ivPeople" android:id="@+id/tvFromError"
android:layout_width="30dp" android:layout_width="0dp"
android:layout_height="30dp" android:layout_height="wrap_content"
android:layout_marginEnd="5dp" android:textColor="@color/red"
app:srcCompat="@drawable/ic_people" app:layout_constraintEnd_toEndOf="@+id/spFrom"
android:layout_marginBottom="15dp" app:layout_constraintStart_toStartOf="@+id/spFrom"
app:layout_constraintEnd_toEndOf="@id/etTo" app:layout_constraintTop_toBottomOf="@+id/topView" />
app:layout_constraintBottom_toBottomOf="@id/etTo"/>
<TextView <EditText
android:id="@+id/tvToError" android:id="@+id/etTo"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/red" android:layout_marginEnd="24dp"
app:layout_constraintEnd_toEndOf="@+id/etTo" android:layout_marginStart="24dp"
app:layout_constraintStart_toStartOf="@+id/etTo" android:layout_marginTop="24dp"
app:layout_constraintTop_toBottomOf="@+id/etTo" /> android:gravity="top"
android:inputType="text"
android:textSize="20sp"
android:hint="@string/to_capital"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/gravatar" />
<EditText <ImageView
android:id="@+id/etAmount" android:id="@+id/ivPeople"
android:layout_width="150dp" android:layout_width="30dp"
android:layout_height="wrap_content" android:layout_height="30dp"
android:layout_marginTop="8dp" android:layout_marginEnd="5dp"
android:layout_marginStart="24dp" app:srcCompat="@drawable/ic_people"
android:inputType="textMultiLine" android:layout_marginBottom="15dp"
android:textColor="@color/white" app:layout_constraintEnd_toEndOf="@id/etTo"
android:textSize="20sp" app:layout_constraintBottom_toBottomOf="@id/etTo"
android:hint="@string/amount" android:contentDescription="@string/people_icon" />
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvToError" />
<TextView <TextView
android:id="@+id/tvAmountError" android:id="@+id/tvToError"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/red" android:textColor="@color/red"
app:layout_constraintEnd_toEndOf="@+id/etAmount" app:layout_constraintEnd_toEndOf="@+id/etTo"
app:layout_constraintStart_toStartOf="@+id/etAmount" app:layout_constraintStart_toStartOf="@+id/etTo"
app:layout_constraintTop_toBottomOf="@+id/etAmount" /> app:layout_constraintTop_toBottomOf="@+id/etTo" />
<Spinner <EditText
android:id="@+id/spAsset" android:id="@+id/etAmount"
android:layout_width="150dp" android:layout_width="150dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="24dp" android:layout_marginTop="8dp"
android:layout_marginTop="8dp" android:layout_marginStart="24dp"
android:gravity="top" android:inputType="numberDecimal"
android:inputType="textMultiLine" android:textSize="20sp"
android:textColor="@color/white" android:hint="@string/amount"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/etAmount" /> app:layout_constraintTop_toBottomOf="@+id/tvToError" />
<View <TextView
android:id="@+id/viewSpinner" android:id="@+id/tvAmountError"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="3dp" android:layout_height="wrap_content"
android:layout_marginTop="5dp" android:textColor="@color/red"
android:background="@color/gray" app:layout_constraintEnd_toEndOf="@+id/etAmount"
app:layout_constraintEnd_toEndOf="@+id/spAsset" app:layout_constraintStart_toStartOf="@+id/etAmount"
app:layout_constraintStart_toStartOf="@+id/spAsset" app:layout_constraintTop_toBottomOf="@+id/etAmount" />
app:layout_constraintTop_toBottomOf="@id/spAsset" />
<TextView <Spinner
android:id="@+id/tvAssetError" android:id="@+id/spAsset"
android:layout_width="0dp" android:layout_width="150dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/red" android:layout_marginEnd="24dp"
app:layout_constraintBottom_toBottomOf="@+id/tvAmountError" android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="@+id/spAsset" android:gravity="top"
app:layout_constraintStart_toStartOf="@+id/spAsset" /> android:inputType="textMultiLine"
android:textColor="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/etAmount" />
<EditText <View
android:id="@+id/etMemo" android:id="@+id/viewSpinner"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="1dp"
android:layout_marginEnd="24dp" android:layout_marginBottom="7dp"
android:layout_marginStart="24dp" android:background="@color/darkGray"
android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="@+id/spAsset"
android:inputType="textMultiLine" app:layout_constraintStart_toStartOf="@+id/spAsset"
android:textColor="@color/white" app:layout_constraintBottom_toBottomOf="@id/etAmount" />
android:hint="@string/memo_capital"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvAmountError" />
<TextView <TextView
android:id="@+id/tvMemoError" android:id="@+id/tvAssetError"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/red" android:textColor="@color/red"
app:layout_constraintEnd_toEndOf="@+id/etMemo" app:layout_constraintBottom_toBottomOf="@+id/tvAmountError"
app:layout_constraintStart_toStartOf="@+id/etMemo" app:layout_constraintEnd_toEndOf="@+id/spAsset"
app:layout_constraintTop_toBottomOf="@+id/etMemo" /> app:layout_constraintStart_toStartOf="@+id/spAsset" />
<TextView <EditText
android:id="@+id/tvScan" android:id="@+id/etMemo"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="4dp" android:layout_marginEnd="24dp"
android:layout_marginStart="24dp" android:layout_marginStart="24dp"
android:text="@string/scan_capital" android:layout_marginTop="8dp"
android:textSize="14sp" android:inputType="textMultiLine"
app:layout_constraintStart_toStartOf="parent" android:hint="@string/memo_capital"
app:layout_constraintTop_toBottomOf="@id/tvMemoError" /> android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvAmountError" />
<ImageView <TextView
android:id="@+id/ivCamera" android:id="@+id/tvMemoError"
android:layout_width="180dp" android:layout_width="0dp"
android:layout_height="180dp" android:layout_height="wrap_content"
android:layout_marginBottom="24dp" android:textColor="@color/red"
android:layout_marginStart="24dp" app:layout_constraintEnd_toEndOf="@+id/etMemo"
android:layout_marginTop="8dp" app:layout_constraintStart_toStartOf="@+id/etMemo"
android:src="#666" app:layout_constraintTop_toBottomOf="@+id/etMemo" />
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvScan" />
<android.support.design.widget.FloatingActionButton <TextView
android:id="@+id/fabCloseCamera" android:id="@+id/tvScan"
android:layout_width="30dp" android:layout_width="wrap_content"
android:layout_height="30dp" android:layout_height="wrap_content"
app:fabSize="mini" android:layout_marginTop="4dp"
android:layout_marginBottom="165dp" android:layout_marginStart="24dp"
android:layout_marginStart="165dp" android:text="@string/scan_capital"
app:backgroundTint="@color/send_strong_orange" android:textSize="14sp"
app:srcCompat="@drawable/ic_close" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="@+id/ivCamera" app:layout_constraintTop_toBottomOf="@id/tvMemoError" />
app:layout_constraintStart_toStartOf="@+id/ivCamera" />
<View <ImageView
android:id="@+id/viewSend" android:id="@+id/ivCamera"
android:layout_width="120dp" android:layout_width="180dp"
android:layout_height="140dp" android:layout_height="180dp"
android:layout_marginEnd="0dp" android:layout_marginBottom="24dp"
android:background="@drawable/send_transaction_send_view" android:layout_marginStart="24dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginTop="8dp"
app:layout_constraintTop_toTopOf="@id/ivCamera" /> android:src="#666"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvScan"
android:contentDescription="@string/camera_feed_to_scan_qr" />
<android.support.design.widget.FloatingActionButton <android.support.design.widget.FloatingActionButton
android:id="@+id/btnSend" android:id="@+id/fabCloseCamera"
android:layout_width="90dp" android:layout_width="30dp"
android:layout_height="90dp" android:layout_height="30dp"
android:layout_marginTop="24dp" app:fabSize="mini"
app:backgroundTint="@color/send_strong_orange" android:layout_marginBottom="165dp"
app:srcCompat="@drawable/ic_arrow_forward" android:layout_marginStart="165dp"
app:layout_constraintEnd_toEndOf="parent" app:backgroundTint="@color/send_strong_orange"
app:layout_constraintTop_toTopOf="@+id/viewSend" /> app:srcCompat="@drawable/ic_close"
app:layout_constraintBottom_toBottomOf="@+id/ivCamera"
app:layout_constraintStart_toStartOf="@+id/ivCamera" />
<TextView <View
android:id="@+id/btnCancel" android:id="@+id/viewSend"
android:layout_width="wrap_content" android:layout_width="120dp"
android:layout_height="wrap_content" android:layout_height="140dp"
android:layout_marginBottom="24dp" android:layout_marginEnd="0dp"
android:layout_marginEnd="24dp" android:background="@drawable/send_transaction_send_view"
android:text="@string/cancel_capital" app:layout_constraintEnd_toEndOf="parent"
android:textStyle="bold" app:layout_constraintTop_toTopOf="@id/ivCamera" />
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</android.support.constraint.ConstraintLayout> <android.support.design.widget.FloatingActionButton
android:id="@+id/btnSend"
android:layout_width="90dp"
android:layout_height="90dp"
android:layout_marginTop="24dp"
app:backgroundTint="@color/send_strong_orange"
app:srcCompat="@drawable/ic_arrow_forward"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/viewSend" />
<TextView
android:id="@+id/btnCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:text="@string/cancel_capital"
android:textStyle="bold"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</android.support.constraint.ConstraintLayout>
</ScrollView>

View file

@ -499,4 +499,6 @@
<string name="new_user">New user?</string> <string name="new_user">New user?</string>
<string name="existing_user">Existing user?</string> <string name="existing_user">Existing user?</string>
<string name="connection_status">Connection status</string> <string name="connection_status">Connection status</string>
<string name="people_icon">People icon</string>
<string name="camera_feed_to_scan_qr">Camera feed to scan QR</string>
</resources> </resources>