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

109 lines
No EOL
5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:bind="http://schemas.android.com/tools">
<data>
<import type="com.magicmicky.habitrpgwrapper.lib.models.tasks.Task" />
<import type="android.view.View"/>
<variable
name="habit"
type="Task" />
</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">
android:minHeight="@dimen/task_min_height">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="80dp"
android:layout_height="match_parent"
android:orientation="horizontal"
android:id="@+id/btnLayout">
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:visibility="@{habit.up ? View.VISIBLE : View.GONE}"
android:layout_weight="1">
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
app:backgroundColor="@{habit.getLightTaskColor}"/>
<Button
android:id="@+id/btnPlus"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="+"
android:background="@drawable/btn_habit_background"
style="@style/HabitButton" />
</FrameLayout>
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:visibility="@{habit.down ? View.VISIBLE : View.GONE}"
android:layout_weight="1">
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
app:backgroundColor="@{habit.up ? habit.getMediumTaskColor : habit.getLightTaskColor}"/>
<Button
android:id="@+id/btnMinus"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="-"
android:background="@drawable/btn_habit_background"
style="@style/HabitButton"/>
</FrameLayout>
</LinearLayout>
<RelativeLayout
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">
<com.rockerhieu.emojicon.EmojiconTextView
android:id="@+id/checkedTextView"
style="@style/CardTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
bind:parsemarkdown="@{habit.text}" />
<com.rockerhieu.emojicon.EmojiconTextView
android:id="@+id/notesTextView"
style="@style/CardText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
bind:parsemarkdown="@{habit.notes}"
android:visibility="@{habit.notes != null ? View.VISIBLE : View.GONE}"/>
</LinearLayout>
<View
android:id="@+id/rightBorderView"
android:layout_width="5dp"
android:layout_height="match_parent"
app:backgroundColor="@{habit.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="0.5dp"
android:background="@color/cell_separator"/>
</LinearLayout>
</layout>