habitica-android/Habitica/res/layout/item_image_row.xml

43 lines
2 KiB
XML
Raw Normal View History

2016-01-12 16:08:02 +00:00
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:bind="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable name="title" type="String"/>
<variable name="value" type="String"/>
<variable name="valueInt" type="int"/>
<variable name="imageNamed" type="String"/>
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
2016-03-28 16:43:15 +00:00
style="@style/RowWrapper"
android:clickable="true">
2016-11-19 11:29:45 +00:00
<com.facebook.drawee.view.SimpleDraweeView
android:layout_width="@dimen/gear_image_size"
android:layout_height="@dimen/gear_image_size"
2016-01-12 16:08:02 +00:00
bind:imageName='@{imageNamed == null ? "head_0" : imageNamed}'
android:contentDescription="@{imageNamed}"
android:alpha="@{imageNamed == null ? 0.4f : 1.0f}"
2017-09-27 12:54:50 +00:00
bind:actualImageScaleType="fitCenter"
android:layout_marginRight="@dimen/row_padding"/>
2016-01-12 16:08:02 +00:00
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center_vertical">
<TextView
2016-01-12 16:08:02 +00:00
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{title}"
tools:text="Title"
style="@style/RowTitle"/>
<TextView
2016-01-12 16:08:02 +00:00
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="Value"
android:text="@{value != null ? value : (valueInt != 0 ? String.valueOf(valueInt) : @string/avatar_nothing)}"
style="@style/RowText"/>
2016-01-12 16:08:02 +00:00
</LinearLayout>
</LinearLayout>
</layout>