Skip to content

Commit

Permalink
Extract style for error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
frececroka committed Apr 10, 2022
1 parent 0ef5ba0 commit 93575f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
11 changes: 2 additions & 9 deletions app/src/main/res/layout/fragment_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,27 +62,20 @@
android:id="@+id/txtNoNetwork"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="3pt"
android:gravity="center_vertical"
android:text="@string/no_network"
android:textColor="@color/colorOnPrimary"
android:theme="@style/ErrorMessage"
android:visibility="gone"
app:drawableStartCompat="@drawable/ic_offline_bolt"
app:drawableTint="@color/colorOnPrimary"
tools:visibility="visible" />

<TextView
android:id="@+id/txtLoginFailed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="3pt"
android:gravity="center_vertical"
android:text="@string/error_login_failed"
android:textColor="@color/colorOnPrimary"
android:textColorLink="@color/colorOnPrimary"
android:theme="@style/ErrorMessage"
android:visibility="gone"
app:drawableStartCompat="@drawable/ic_report"
app:drawableTint="@color/colorOnPrimary"
tools:visibility="visible" />
</LinearLayout>

Expand Down
8 changes: 8 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,12 @@
<item name="android:textStyle">bold</item>
</style>

<style name="ErrorMessage">
<item name="android:gravity">center_vertical</item>
<item name="android:drawablePadding">3pt</item>
<item name="android:textColor">@color/colorOnPrimary</item>
<item name="android:textColorLink">@color/colorOnPrimary</item>
<item name="drawableTint">@color/colorOnPrimary</item>
</style>

</resources>

0 comments on commit 93575f7

Please sign in to comment.