habitica-android/Habitica/res/layout/todo_item_card.xml
2015-08-31 17:48:56 +02:00

121 lines
No EOL
5.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<import type="com.magicmicky.habitrpgwrapper.lib.models.tasks.Task" />
<import type="android.view.View"/>
<variable
name="todo"
type="Task" />
<variable
name="displayChecklist"
type="Boolean" />
</data>
<LinearLayout xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@color/white">
<LinearLayout
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="match_parent">
<CheckBox
android:id="@+id/checkBox"
android:layout_width="@dimen/button_width"
android:layout_height="fill_parent"
android:checked="@{todo.getCompleted}"
app:backgroundColor="@{todo.getLightTaskColor}"
android:gravity="center"/>
<RelativeLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="5dp">
<CheckedTextView
android:id="@+id/checkedTextView"
style="@style/CardTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{todo.text}" />
<TextView
android:id="@+id/textView6"
style="@style/CardText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@{todo.notes}" />
</LinearLayout>
<RelativeLayout android:orientation="vertical"
android:id="@+id/checklistIndicatorWrapper"
android:layout_width="@dimen/checklist_wrapper_width"
android:layout_height="match_parent"
app:backgroundColor="@{todo.getLightTaskColor}"
android:visibility="@{todo.checklist.size > 0 ? View.VISIBLE : View.GONE}"
android:gravity="center"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{String.valueOf(todo.getCompletedChecklistCount)}"
android:textColor="@color/white"
android:gravity="center"
android:layout_above="@+id/checklistDivider"/>
<View
android:id="@+id/checklistDivider"
android:layout_width="@dimen/checklist_divider_width"
android:layout_height="@dimen/hairline_height"
android:background="@color/white"
android:layout_centerInParent="true"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{String.valueOf(todo.checklist.size)}"
android:textColor="@color/white"
android:gravity="center"
android:layout_below="@+id/checklistDivider"/>
</RelativeLayout>
<View
android:id="@+id/rightBorderView"
android:layout_width="5dp"
android:layout_height="match_parent"
app:backgroundColor="@{todo.getLightTaskColor}"
android:gravity="center"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
</LinearLayout>
<View
android:id="@+id/bottomBorderView"
android:layout_width="match_parent"
android:layout_height="@dimen/hairline_height"
android:background="@color/cell_separator"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/checklistView"
android:orientation="vertical"
android:visibility="@{displayChecklist != null &amp;&amp; displayChecklist ? View.VISIBLE : View.GONE}" />
<View
android:layout_width="match_parent"
android:layout_height="10dp"
android:background="@color/checklist_separator"
android:visibility="@{displayChecklist != null &amp;&amp; displayChecklist ? View.VISIBLE : View.GONE}" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/hairline_height"
android:background="@color/cell_separator"
android:visibility="@{displayChecklist != null &amp;&amp; displayChecklist ? View.VISIBLE : View.GONE}" />
</LinearLayout>
</layout>