Add Body1 and Body2 text styles and use them on the transactions items

This commit is contained in:
Severiano Jaramillo 2018-06-21 16:15:36 -05:00
parent 7084be4696
commit a0075117d1
3 changed files with 21 additions and 162 deletions

View file

@ -1,116 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <!--
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="5dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="5dp">
<RelativeLayout
android:id="@+id/rlTransactionItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="@drawable/transaction_list_item_background">
<TextView
android:id="@+id/tvFrom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_marginLeft="5dp"
android:layout_toStartOf="@+id/ivArrowFromTo"
android:ems="10"
android:inputType="text"
android:text="from" />
<ImageView
android:id="@+id/ivArrowFromTo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:tint="@color/black"
app:srcCompat="@drawable/ic_arrow_forward" />
<TextView
android:id="@+id/tvTo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_toEndOf="@+id/ivArrowFromTo"
android:ems="10"
android:inputType="text"
android:text="to"
android:textAlignment="textEnd" />
<Space
android:id="@+id/sAfterFromTo"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tvFrom"/>
<TextView
android:id="@+id/tvDate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/sAfterFromTo"
android:layout_marginLeft="5dp"
android:layout_toStartOf="@+id/ivArrowFromTo"
android:ems="10"
android:text="02 Oct"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tvTime"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tvDate"
android:layout_marginLeft="5dp"
android:layout_toStartOf="@+id/ivArrowFromTo"
android:ems="10"
android:text="15:01:18 CET" />
<TextView
android:id="@+id/tvCryptoAmount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignWithParentIfMissing="false"
android:layout_below="@id/sAfterFromTo"
android:layout_toEndOf="@+id/ivArrowFromTo"
android:ems="10"
android:inputType="text"
android:text="+ 1 BTS"
android:textAlignment="textEnd"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tvFiatEquivalent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignWithParentIfMissing="false"
android:layout_below="@id/tvCryptoAmount"
android:layout_toEndOf="@+id/ivArrowFromTo"
android:ems="10"
android:inputType="text"
android:text="0.005€"
android:textAlignment="textEnd" />
</RelativeLayout>
</LinearLayout>
-->
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
@ -182,7 +70,7 @@
android:layout_marginTop="16dp"
android:maxLines="1"
tools:text="denzel-washington"
android:textAppearance="@android:style/TextAppearance.Material.Body1"
android:textAppearance="@style/TextAppearance.Body2"
android:textColor="@color/gray"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toEndOf="@id/firstVerticalGuideline"
@ -205,7 +93,7 @@
android:layout_height="wrap_content"
android:maxLines="1"
tools:text="joes-grocery-13"
android:textAppearance="@android:style/TextAppearance.Material.Body1"
android:textAppearance="@style/TextAppearance.Body2"
android:textColor="@color/gray"
android:textAlignment="textEnd"
app:layout_constraintTop_toTopOf="@id/tvFrom"
@ -238,7 +126,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:maxLines="2"
android:textAppearance="@android:style/TextAppearance.Material.Body1"
android:textAppearance="@android:style/TextAppearance.Material.Caption"
tools:text="Here is a memo if exists and can span up to 2 lines, if it get lager we will have problems with the rendering"/>
<View
@ -256,8 +144,8 @@
android:layout_marginTop="12dp"
android:maxLines="1"
tools:text="02 Oct"
android:textColor="@color/black"
android:textAppearance="@android:style/TextAppearance.Material.Body1"
android:textStyle="bold"
android:textAppearance="@style/TextAppearance.Body1"
app:layout_constraintTop_toBottomOf="@id/llMemo"
app:layout_constraintStart_toEndOf="@id/firstVerticalGuideline"
app:layout_constraintEnd_toStartOf="@id/centeredVerticalGuideline"/>
@ -268,7 +156,7 @@
android:layout_height="wrap_content"
android:maxLines="1"
tools:text="15:01:18 CET"
android:textAppearance="@android:style/TextAppearance.Material.Body1"
android:textAppearance="@style/TextAppearance.Body2"
android:textColor="@color/gray"
app:layout_constraintTop_toBottomOf="@+id/tvDate"
app:layout_constraintStart_toEndOf="@id/firstVerticalGuideline"
@ -280,8 +168,8 @@
android:layout_height="wrap_content"
android:maxLines="1"
tools:text="1234567.1234 BTS"
android:textColor="@color/black"
android:textAppearance="@android:style/TextAppearance.Material.Body1"
android:textAppearance="@style/TextAppearance.Body1"
android:textStyle="bold"
android:textAlignment="textEnd"
app:layout_constraintTop_toTopOf="@id/tvDate"
app:layout_constraintStart_toEndOf="@id/centeredVerticalGuideline"
@ -294,7 +182,7 @@
android:layout_marginBottom="16dp"
android:maxLines="1"
tools:text="4119.75 $"
android:textAppearance="@android:style/TextAppearance.Material.Body1"
android:textAppearance="@style/TextAppearance.Body2"
android:textColor="@color/gray"
android:textAlignment="textEnd"
app:layout_constraintTop_toBottomOf="@+id/tvCryptoAmount"

View file

@ -3,9 +3,9 @@
<color name="colorPrimary">#0099d6</color>
<color name="colorPrimaryDark">#006fd6</color>
<color name="colorAccent">#0099d6</color>
<color name="gray">#d3d3d3</color>
<color name="gray">#808080</color>
<color name="darkGray">#686767</color>
<color name="lightGray">#E3E3E3</color>
<color name="lightGray">#e0e0e0</color>
<color name="white">#ffffff</color>
<color name="pink">#f0006b</color>
<color name="transparent">#00ffffff</color>

View file

@ -1,27 +1,4 @@
<resources>
<style name="stylishDialog" parent="android:Theme.Dialog">
<item name="android:windowBackground">@color/whiteColor</item>
<item name="android:textColor">@color/black</item>
<item name="android:textSize">24sp</item>
<item name="android:textStyle">normal</item>
<item name="android:gravity">center</item>
</style>
<style name="MyMaterialTheme" parent="MyMaterialTheme.Base">
</style>
<style name="MyMaterialTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:dialogTheme">@style/CustomDialog</item>
</style>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
@ -30,7 +7,6 @@
<item name="android:dialogTheme">@style/CustomDialog</item>
<item name="android:colorButtonNormal">@color/white</item>
<item name="android:fontFamily">@font/opensans</item>
<item name="fontFamily">@font/opensans</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
<!-- enable window content transitions -->
<item name="android:windowContentTransitions">true</item>
</style>
@ -48,28 +24,17 @@
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark" >
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="splashTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:windowNoTitle">true</item>
<item name="android:background">@color/white</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="CustomDialog" parent="@style/Theme.AppCompat.Light.Dialog">
<item name="android:windowNoTitle">true</item>
</style>
<!-- TODO use pendingTransition instead -->
<style name="SendTransactionTheme" parent="Theme.AppCompat.Light.Dialog">
<item name="android:windowAnimationStyle">@style/SendTransactionAnimation.Window</item>
</style>
<style name="SendTransactionAnimation.Window" parent="@android:style/Animation.Activity">
<item name="android:windowEnterAnimation">@anim/send_transaction_in</item>
<item name="android:windowExitAnimation">@anim/send_transaction_out</item>
@ -78,7 +43,6 @@
<style name="ReceiveTransactionTheme" parent="Theme.AppCompat.Light.Dialog">
<item name="android:windowAnimationStyle">@style/ReceiveTransactionAnimation.Window</item>
</style>
<style name="ReceiveTransactionAnimation.Window" parent="@android:style/Animation.Activity">
<item name="android:windowEnterAnimation">@anim/receive_transaction_in</item>
<item name="android:windowExitAnimation">@anim/receive_transaction_out</item>
@ -89,6 +53,7 @@
<item name="android:windowExitAnimation">@anim/accounts_out</item>
</style>
<!-- TODO Remove this style and use the other button styles -->
<style name="Widget.Button" parent="android:Widget.Button">
<item name="android:paddingTop">8dp</item>
<item name="android:paddingBottom">8dp</item>
@ -111,4 +76,10 @@
<item name="colorButtonNormal">@color/gray</item>
<item name="android:buttonStyle">@style/Widget.AppCompat.Button.Colored</item>
</style>
<!-- Text styles -->
<style name="TextAppearance.Body1" parent="Base.TextAppearance.AppCompat.Body1" >
<item name="android:textSize">16sp</item>
</style>
<style name="TextAppearance.Body2" parent="Base.TextAppearance.AppCompat.Body2" />
</resources>