Create view for habit history; other minor changes

This commit is contained in:
2015-03-15 04:26:20 -04:00
parent c41e71003b
commit 11d6bbd6f6
20 changed files with 686 additions and 113 deletions

View File

@@ -5,19 +5,11 @@
android:layout_height="match_parent"
android:background="#ffffff" >
<!-- <ListView -->
<!-- android:id="@+id/listView" -->
<!-- android:layout_width="match_parent" -->
<!-- android:layout_height="match_parent" -->
<!-- android:divider="#00000000" -->
<!-- android:dividerHeight="0dp"> -->
<!-- </ListView> -->
<com.mobeta.android.dslv.DragSortListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="#10000000"
android:divider="@color/windowBackground"
android:dividerHeight="1dp"
dslv:drag_enabled="true"
dslv:drag_handle_id="@drawable/habits_header_check"
@@ -25,21 +17,23 @@
dslv:float_alpha="0.5"
dslv:sort_enabled="true"
dslv:track_drag_sort="false"
dslv:use_default_controller="true" />
dslv:use_default_controller="true"
android:paddingTop="42dp"
android:background="@color/windowBackground"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#f0f0f0"
android:elevation="2dp"
android:background="#ffffff"
android:paddingRight="4dp"
>
android:paddingRight="4dp" >
<TextView
android:id="@+id/tvStarHeader"
android:layout_width="36dp"
android:layout_height="match_parent"
android:layout_height="42dp"
android:layout_marginTop="0dp"
android:gravity="center"
android:paddingTop="1dp" />
@@ -47,13 +41,14 @@
<TextView
android:id="@+id/tvNameHeader"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_height="42dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingBottom="6dp"
android:paddingLeft="0dp"
android:paddingRight="6dp"
android:paddingTop="6dp" />
android:paddingTop="6dp"
android:text="" />
<LinearLayout
android:id="@+id/llButtonsHeader"

View File

@@ -1,19 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/llOuter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#10000000"
android:background="@color/windowBackground"
android:baselineAligned="false"
android:clipToPadding="false"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingTop="0dp"
android:paddingBottom="4dp"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:paddingLeft="6dp"
android:paddingRight="6dp"
>
<LinearLayout
android:id="@+id/llInner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_background"

View File

@@ -8,7 +8,7 @@
<fragment
android:id="@+id/fragment1"
android:name="org.isoron.uhabits.dialogs.ShowHabitsFragment"
android:name="org.isoron.uhabits.dialogs.ListHabitsFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />

125
res/layout/show_habit.xml Normal file
View File

@@ -0,0 +1,125 @@
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fillViewport="true" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/windowBackground"
android:orientation="vertical"
android:paddingBottom="4dp"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:paddingTop="0dp"
android:transitionName="mainWindow"
tools:context="org.isoron.uhabits.ShowHabitActivity" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="@color/white"
android:elevation="2dp"
android:orientation="vertical"
android:padding="16dp" >
<TextView
android:id="@+id/tvOverview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:text="Overview"
android:textSize="16sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:layout_marginTop="4dp" >
<TextView
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Habit strength" >
</TextView>
<TextView
android:id="@+id/tvStrength"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" >
</TextView>
</LinearLayout>
<!--
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:layout_marginTop="4dp" >
<TextView
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Current streak" >
</TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="12 days\nJun 11, 2015 — Jun 23, 2015" >
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:layout_marginTop="4dp" >
<TextView
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Best streak" >
</TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="30 days\nMar 12, 2015 — Apr 12, 2015" >
</TextView>
</LinearLayout>
-->
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:elevation="2dp"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:paddingRight="4dp"
>
<TextView
android:id="@+id/tvHistory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:text="History"
android:textSize="16sp"
android:textStyle="bold" />
<LinearLayout
android:id="@+id/llHistory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" />
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@@ -0,0 +1,15 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="org.isoron.uhabits.ShowHabitActivity"
tools:ignore="MergeRootFrame" >
<fragment
android:id="@+id/fragment2"
android:name="org.isoron.uhabits.dialogs.ShowHabitFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>

11
res/menu/show_habit.xml Normal file
View File

@@ -0,0 +1,11 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context="org.isoron.uhabits.ShowHabitActivity" >
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_settings"/>
</menu>

View File

@@ -1,11 +1,14 @@
<resources>
<style name="AppBaseTheme" parent="android:Theme.Material">
<item name="android:textColor">#606060</item>
<item name="android:colorPrimary">@color/primary</item>
<item name="android:colorPrimaryDark">@color/primary_darker</item>
<item name="android:dialogTheme">@style/MyDialogStyle</item>
<item name="android:alertDialogTheme">@style/MyDialogStyle</item>
<item name="android:windowContentTransitions">true</item>
<item name="android:windowAllowEnterTransitionOverlap">true</item>
<item name="android:windowAllowReturnTransitionOverlap">true</item>
</style>
<style name="MyDialogStyle" parent="android:Theme.Material.Light.Dialog">

View File

@@ -19,17 +19,18 @@
<color name="primary">#00517b</color>
<color name="primary_darker">#003d5d</color>
<color name="accent">#9a4000</color>
<color name="windowBackground">#e6e6e6</color>
<color name="white">#ffffff</color>
<color name="grey">#cccccc</color>
<!-- Time and Date picker -->
<color name="circle_background">#f2f2f2</color>
<color name="line_background">#cccccc</color>
<color name="ampm_text_color">#8c8c8c</color>
<color name="done_text_color_normal">#000000</color>
<color name="done_text_color_disabled">#cccccc</color>
<color name="numbers_text_color">#8c8c8c</color>
<color name="transparent">#00000000</color>
<color name="transparent_black">#7f000000</color>
<color name="blue">#33b5e5</color>
@@ -37,11 +38,9 @@
<color name="neutral_pressed">#33999999</color>
<color name="darker_blue">#0099cc</color>
<color name="date_picker_text_normal">#ff999999</color>
<color name="calendar_header">#999999</color>
<color name="date_picker_view_animator">#f2f2f2</color>
<color name="calendar_selected_date_text">#ffd1d2d4</color>
<color name="done_text_color">#888888</color>
<color name="done_text_color_dark">#888888</color>

View File

@@ -1,17 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_name">μHabits</string>
<string name="action_settings">Settings</string>
<string name="edit">Edit</string>
<string name="delete">Delete</string>
<string name="add_habit">Add habit</string>
<string name="color_picker_default_title">Select a Color</string>
<string name="color_swatch_description">Color <xliff:g id="color_index" example="14">%1$d</xliff:g></string>
<string name="color_swatch_description_selected">Color <xliff:g id="color_index" example="14">%1$d</xliff:g> selected</string>
<string name="toast_habit_created">Habit created.</string>
<string name="toast_habit_deleted">Habit deleted.</string>
<string name="toast_nothing_to_undo">Nothing to undo.</string>
@@ -19,7 +16,7 @@
<string name="toast_habit_changed">Habit changed.</string>
<string name="toast_habit_changed_back">Habit changed back.</string>
<string name="toast_repetition_toggled">Repetition toggled.</string>
<!-- Date and time picker -->
<string name="done_label">Done</string>
<string name="clear_label">Clear</string>
@@ -38,10 +35,12 @@
<string name="radial_numbers_typeface">sans-serif</string>
<string name="sans_serif">sans-serif</string>
<string name="day_of_week_label_typeface">sans-serif</string>
<string name="habit_key"></string>
<string name="offset_key"></string>
<item type="id" name="KEY_TIMESTAMP"/>
<item name="KEY_TIMESTAMP" type="id"/>
<string name="title_activity_show_habit">ShowHabitActivity</string>
<string name="hello_world">Hello world!</string>
</resources>