mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 19:56:32 +00:00
137 lines
No EOL
6.7 KiB
XML
137 lines
No EOL
6.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"
|
|
android:orientation="horizontal">
|
|
<RelativeLayout
|
|
android:id="@+id/checkBoxHolder"
|
|
android:layout_width="@dimen/button_width"
|
|
android:layout_height="match_parent"
|
|
app:backgroundColor="@{todo.completed ? @color/task_gray : todo.getLightTaskColor}">
|
|
<CheckBox
|
|
android:id="@+id/checkBox"
|
|
android:layout_width="@dimen/checkbox_size"
|
|
android:layout_height="@dimen/checkbox_size"
|
|
android:layout_centerInParent="true"
|
|
android:checked="@{todo.completed}"
|
|
android:gravity="center"
|
|
android:button="@drawable/todo_checkbox"
|
|
android:layout_gravity="center_horizontal" />
|
|
</RelativeLayout>
|
|
<RelativeLayout
|
|
android:orientation="horizontal"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent">
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="vertical"
|
|
android:layout_centerVertical="true"
|
|
android:paddingLeft="16dp"
|
|
android:paddingRight="16dp"
|
|
android:paddingEnd="16dp"
|
|
android:paddingBottom="@dimen/task_top_bottom_padding"
|
|
android:paddingTop="@dimen/task_top_bottom_padding">
|
|
<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/notesTextView"
|
|
style="@style/CardText"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:text="@{todo.notes}"
|
|
android:visibility="@{todo.notes != null ? View.VISIBLE : View.GONE}" />
|
|
</LinearLayout>
|
|
<RelativeLayout android:orientation="vertical"
|
|
android:id="@+id/checklistIndicatorWrapper"
|
|
android:layout_width="@dimen/checklist_wrapper_width"
|
|
android:layout_height="match_parent"
|
|
app:backgroundColor="@{todo.checklist.size != todo.getCompletedChecklistCount ? todo.getLightTaskColor : @color/task_gray}"
|
|
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.completed ? @color/task_gray : todo.getLightTaskColor}"
|
|
android:visibility="@{todo.checklist.size == 0 ? View.VISIBLE : View.GONE}"
|
|
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 && displayChecklist ? View.VISIBLE : View.GONE}" />
|
|
<View
|
|
android:layout_width="match_parent"
|
|
android:layout_height="10dp"
|
|
android:background="@color/checklist_separator"
|
|
android:visibility="@{displayChecklist != null && 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 && displayChecklist ? View.VISIBLE : View.GONE}" />
|
|
</LinearLayout>
|
|
</layout> |