[#35] - Create databinding and logic for party members

This commit is contained in:
Franze Jr 2015-11-06 19:33:59 -03:00
parent 93ed6dbd94
commit 86edf6b4e4
3 changed files with 14 additions and 3 deletions

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/task_gray" />
<corners android:radius="@dimen/bar_radius"/>
<padding android:left="0dip" android:top="0dip" android:right="0dip" android:bottom="0dip" />
</shape>

View file

@ -28,6 +28,10 @@
<variable
name="icon"
type="int"/>
<variable
name="partyMembers"
type="boolean"/>
</data>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
@ -53,7 +57,7 @@
android:layout_width="wrap_content"
android:layout_height="@dimen/bar_size"
android:orientation="horizontal"
android:background="@drawable/layout_rounded_bg_gray"
android:background="@{partyMembers ? @drawable/layout_rounded_bg_light_gray : @drawable/layout_rounded_bg_brand}"
android:weightSum="1">
<View
@ -80,7 +84,7 @@
android:id="@+id/TV_value"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textColor="@color/md_black_1000"
android:textColor="@{partyMembers ? @color/md_black_1000 : @color/brand_500}"
android:text="@{text}"
android:layout_weight="1"
/>
@ -89,7 +93,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center|right"
android:textColor="@color/md_black_1000"
android:textColor="@{partyMembers ? @color/md_black_1000 : @color/brand_500}"
android:text="@{description}"
android:layout_weight="1" />
</LinearLayout>

View file

@ -83,6 +83,7 @@ public class PartyMemberRecyclerViewAdapter extends RecyclerView.Adapter<PartyMe
View hpBarView = itemView.findViewById(R.id.hpBar);
hpBar = DataBindingUtil.bind(hpBarView);
hpBar.setPartyMembers(true);
resources = itemView.getResources();
}