mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-14 02:01:56 +00:00
redesign habit and todo list
This commit is contained in:
parent
257bbaef4f
commit
efadeeecb6
4 changed files with 124 additions and 93 deletions
|
|
@ -20,7 +20,7 @@
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/checkBox"
|
android:id="@+id/checkBox"
|
||||||
android:layout_width="50dp"
|
android:layout_width="@dimen/button_width"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:checked="@{daily.completed}"
|
android:checked="@{daily.completed}"
|
||||||
app:backgroundColor="@{daily.getLightTaskColor}"
|
app:backgroundColor="@{daily.getLightTaskColor}"
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<RelativeLayout android:orientation="vertical"
|
<RelativeLayout android:orientation="vertical"
|
||||||
android:id="@+id/checklistIndicatorWrapper"
|
android:id="@+id/checklistIndicatorWrapper"
|
||||||
android:layout_width="30dp"
|
android:layout_width="@dimen/checklist_wrapper_width"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
app:backgroundColor="@{daily.getLightTaskColor}"
|
app:backgroundColor="@{daily.getLightTaskColor}"
|
||||||
android:visibility="@{daily.checklist.size > 0 ? View.VISIBLE : View.GONE}"
|
android:visibility="@{daily.checklist.size > 0 ? View.VISIBLE : View.GONE}"
|
||||||
|
|
@ -74,8 +74,8 @@
|
||||||
android:layout_above="@+id/checklistDivider"/>
|
android:layout_above="@+id/checklistDivider"/>
|
||||||
<View
|
<View
|
||||||
android:id="@+id/checklistDivider"
|
android:id="@+id/checklistDivider"
|
||||||
android:layout_width="10dp"
|
android:layout_width="@dimen/checklist_divider_width"
|
||||||
android:layout_height="0.5dp"
|
android:layout_height="@dimen/hairline_height"
|
||||||
android:background="@color/white"
|
android:background="@color/white"
|
||||||
android:layout_centerInParent="true"/>
|
android:layout_centerInParent="true"/>
|
||||||
<TextView
|
<TextView
|
||||||
|
|
@ -101,7 +101,7 @@
|
||||||
<View
|
<View
|
||||||
android:id="@+id/bottomBorderView"
|
android:id="@+id/bottomBorderView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0.5dp"
|
android:layout_height="@dimen/hairline_height"
|
||||||
android:background="@color/cell_separator"/>
|
android:background="@color/cell_separator"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
@ -11,59 +11,42 @@
|
||||||
type="Task" />
|
type="Task" />
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<FrameLayout xmlns:app="http://schemas.android.com/apk/res-auto"
|
<LinearLayout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
<android.support.v7.widget.CardView
|
android:background="@color/white">
|
||||||
android:id="@+id/card_view"
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="100dp"
|
android:layout_height="match_parent">
|
||||||
android:layout_marginBottom="@dimen/cardMarginVertical"
|
<LinearLayout
|
||||||
android:layout_marginLeft="@dimen/cardMarginHorizontal"
|
android:layout_width="wrap_content"
|
||||||
android:layout_marginRight="@dimen/cardMarginHorizontal"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="@dimen/cardMarginVertical"
|
android:orientation="vertical"
|
||||||
app:cardCornerRadius="2dp"
|
android:id="@+id/btnLayout">
|
||||||
app:cardElevation="2dp"
|
<Button
|
||||||
app:cardPreventCornerOverlap="false"
|
android:id="@+id/btnPlus"
|
||||||
app:contentPadding="0dp"
|
android:layout_width="@dimen/button_width"
|
||||||
app:cardColor="@{habit.getLightTaskColor}">
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:visibility="@{habit.up ? View.VISIBLE : View.GONE}"
|
||||||
|
android:text="+"
|
||||||
|
android:textSize="15sp"
|
||||||
|
app:backgroundColor="@{habit.getLightTaskColor}" />
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnMinus"
|
||||||
|
android:layout_width="@dimen/button_width"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:visibility="@{habit.down ? View.VISIBLE : View.GONE}"
|
||||||
|
app:backgroundColor="@{habit.getLightTaskColor}"
|
||||||
|
android:text="-"
|
||||||
|
android:textSize="15sp"/>
|
||||||
|
</LinearLayout>
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:gravity="fill_horizontal|center_vertical|center_horizontal|fill|clip_vertical|fill_vertical|center|start|clip_horizontal|bottom|left|right|end|top"
|
<TextView
|
||||||
android:minHeight="250dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:id="@+id/btnLayout">
|
|
||||||
<Button
|
|
||||||
android:id="@+id/btnPlus"
|
|
||||||
style="?android:attr/buttonStyleSmall"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:visibility="@{habit.up ? View.VISIBLE : View.GONE}"
|
|
||||||
android:text="+"
|
|
||||||
android:textSize="15sp"
|
|
||||||
app:backgroundColor="@{habit.getDarkTaskColor}" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/btnMinus"
|
|
||||||
style="?android:attr/buttonStyleSmall"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:visibility="@{habit.down ? View.VISIBLE : View.GONE}"
|
|
||||||
app:backgroundColor="@{habit.getDarkTaskColor}"
|
|
||||||
android:text="-"
|
|
||||||
android:textSize="15sp"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<CheckedTextView
|
|
||||||
android:id="@+id/checkedTextView"
|
android:id="@+id/checkedTextView"
|
||||||
style="@style/CardTitle"
|
style="@style/CardTitle"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
@ -71,8 +54,6 @@
|
||||||
android:layout_alignParentBottom="false"
|
android:layout_alignParentBottom="false"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_toRightOf="@id/btnLayout"
|
|
||||||
android:layout_toEndOf="@id/btnLayout"
|
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:paddingBottom="5dp"
|
android:paddingBottom="5dp"
|
||||||
android:paddingLeft="5dp"
|
android:paddingLeft="5dp"
|
||||||
|
|
@ -91,8 +72,21 @@
|
||||||
android:layout_below="@+id/checkedTextView"
|
android:layout_below="@+id/checkedTextView"
|
||||||
android:text="@{habit.notes}" />
|
android:text="@{habit.notes}" />
|
||||||
|
|
||||||
|
<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>
|
</RelativeLayout>
|
||||||
</android.support.v7.widget.CardView>
|
</LinearLayout>
|
||||||
</FrameLayout>
|
<View
|
||||||
|
android:id="@+id/bottomBorderView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0.5dp"
|
||||||
|
android:background="@color/cell_separator"/>
|
||||||
|
</LinearLayout>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
@ -3,46 +3,33 @@
|
||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<data>
|
<data>
|
||||||
<import type="com.magicmicky.habitrpgwrapper.lib.models.tasks.Task" />
|
<import type="com.magicmicky.habitrpgwrapper.lib.models.tasks.Task" />
|
||||||
|
<import type="android.view.View"/>
|
||||||
|
|
||||||
<variable
|
<variable
|
||||||
name="todo"
|
name="todo"
|
||||||
type="Task" />
|
type="Task" />
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<FrameLayout xmlns:app="http://schemas.android.com/apk/res-auto"
|
<LinearLayout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
<android.support.v7.widget.CardView
|
android:background="@color/white">
|
||||||
|
<LinearLayout
|
||||||
android:id="@+id/card_view"
|
android:id="@+id/card_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="80dp"
|
android:layout_height="match_parent">
|
||||||
android:layout_marginBottom="@dimen/cardMarginVertical"
|
<CheckBox
|
||||||
android:layout_marginLeft="@dimen/cardMarginHorizontal"
|
android:id="@+id/checkBox"
|
||||||
android:layout_marginRight="@dimen/cardMarginHorizontal"
|
android:layout_width="@dimen/button_width"
|
||||||
android:layout_marginTop="@dimen/cardMarginVertical"
|
android:layout_height="fill_parent"
|
||||||
app:cardCornerRadius="2dp"
|
android:checked="@{todo.completed}"
|
||||||
app:cardElevation="2dp"
|
app:backgroundColor="@{todo.getLightTaskColor}"
|
||||||
app:cardPreventCornerOverlap="false"
|
android:gravity="center"/>
|
||||||
app:contentPadding="0dp"
|
<RelativeLayout
|
||||||
app:cardColor="@{todo.getLightTaskColor}">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:layout_above="@+id/textView6"
|
|
||||||
android:layout_alignLeft="@+id/checkedTextView"
|
|
||||||
android:layout_alignStart="@+id/checkedTextView">
|
|
||||||
|
|
||||||
<CheckBox
|
|
||||||
android:id="@+id/checkBox"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:checked="@{todo.completed}"
|
|
||||||
app:backgroundColor="@{todo.getDarkTaskColor}"
|
|
||||||
android:gravity="center"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
@ -62,10 +49,54 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:text="@{todo.notes}" />
|
android:text="@{todo.notes}" />
|
||||||
</LinearLayout>
|
</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>
|
</LinearLayout>
|
||||||
|
<View
|
||||||
</android.support.v7.widget.CardView>
|
android:id="@+id/bottomBorderView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
</FrameLayout>
|
android:layout_height="@dimen/hairline_height"
|
||||||
|
android:background="@color/cell_separator"/>
|
||||||
|
</LinearLayout>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
@ -32,4 +32,10 @@
|
||||||
|
|
||||||
<!-- Widget -->
|
<!-- Widget -->
|
||||||
<dimen name="widget_bar_horizontal_margin">20dp</dimen>
|
<dimen name="widget_bar_horizontal_margin">20dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="button_width">60dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="hairline_height">0.5dp</dimen>
|
||||||
|
<dimen name="checklist_divider_width">14dp</dimen>
|
||||||
|
<dimen name="checklist_wrapper_width">35dp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
Loading…
Reference in a new issue