improve gold display. Fixes #843

This commit is contained in:
Phillip Thelen 2017-11-02 13:41:23 +01:00
parent c4cc1200e3
commit 760c3c2340
5 changed files with 18 additions and 9 deletions

View file

@ -90,6 +90,7 @@
tools:text="10"
tools:textColor="@color/green_10"
style="@style/Body1"
app:hasLightBackground="true"
android:layout_marginLeft="12dp"/>
</LinearLayout>
<Button

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:fresco="http://schemas.android.com/apk/res-auto"
android:clickable="true"
android:background="@color/white">
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:clickable="true"
android:background="@color/white">
<LinearLayout
android:id="@+id/container"
android:layout_marginTop="6dp"
@ -34,6 +34,7 @@
android:textColor="@color/gray_300"
tools:text="150"
style="@style/Body1"
app:hasLightBackground="true"
android:textSize="15sp" />
</LinearLayout>
</LinearLayout>

View file

@ -1,6 +1,7 @@
<resources>
<attr name="statsColor" format="color" />
<attr name="statsTitle" format="string" />
<attr name="hasLightBackground" format="boolean" />
<declare-styleable name="AvatarView">
<attr name="showBackground" format="boolean" />
<attr name="showMount" format="boolean" />
@ -40,9 +41,10 @@
</declare-styleable>
<declare-styleable name="CurrencyView">
<attr name="currency" format="string" />
<attr name="hasLightBackground" />
</declare-styleable>
<declare-styleable name="CurrencyViews">
<attr name="hasLightBackground" format="boolean" />
<attr name="hasLightBackground" />
</declare-styleable>
<declare-styleable name="FixValuesEditText">
<attr name="fixIconName" format="string" />

View file

@ -24,7 +24,13 @@ class CurrencyView : android.support.v7.widget.AppCompatTextView {
updateVisibility()
}
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {}
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
val attributes = context.theme?.obtainStyledAttributes(
attrs,
R.styleable.CurrencyViews,
0, 0)
lightBackground = attributes?.getBoolean(R.styleable.CurrencyView_hasLightBackground, true) ?: true
}
constructor(context: Context, currency: String, lightbackground: Boolean) : super(context) {
this.lightBackground = lightbackground

View file

@ -30,7 +30,6 @@ class CurrencyViews : LinearLayout {
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) {
val attributes = context?.theme?.obtainStyledAttributes(
attrs,
R.styleable.CurrencyViews,