ShowHabit: Refactor score chart

This commit is contained in:
2016-06-22 19:47:16 -04:00
parent a060cbe578
commit a11ad6e909
25 changed files with 379 additions and 292 deletions

View File

@@ -31,49 +31,23 @@
style="@style/CardList"
android:clipToPadding="false">
<org.isoron.uhabits.ui.habits.show.views.SubtitleCardView
<org.isoron.uhabits.ui.habits.show.views.SubtitleCard
style="@style/ShowHabit.Subtitle"
android:id="@+id/subtitle"/>
android:id="@+id/subtitleCard"/>
<!--<View-->
<!--android:id="@+id/headerShadow"-->
<!--style="@style/ToolbarShadow"/>-->
<org.isoron.uhabits.ui.habits.show.views.OverviewCardView
android:id="@+id/overview"
<org.isoron.uhabits.ui.habits.show.views.OverviewCard
android:id="@+id/overviewCard"
android:paddingTop="12dp"
style="@style/Card" />
<RelativeLayout
<org.isoron.uhabits.ui.habits.show.views.ScoreCard
android:id="@+id/strengthCard"
style="@style/Card"
android:gravity="center">
<android.support.v7.widget.AppCompatSpinner
android:id="@+id/sStrengthInterval"
android:layout_width="wrap_content"
android:layout_height="22dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:entries="@array/strengthIntervalNames"
android:theme="@style/SmallSpinner"
/>
<TextView
android:id="@+id/tvStrength"
style="@style/CardHeader"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:text="@string/habit_strength"/>
<org.isoron.uhabits.ui.habits.show.views.HabitScoreView
android:id="@+id/scoreView"
android:layout_width="match_parent"
android:layout_height="220dp"
android:layout_below="@id/tvStrength"/>
</RelativeLayout>
android:gravity="center" />
<LinearLayout
style="@style/Card"
@@ -86,7 +60,7 @@
style="@style/CardHeader"
android:text="@string/history"/>
<org.isoron.uhabits.ui.habits.show.views.HabitHistoryView
<org.isoron.uhabits.ui.habits.show.views.HistoryView
android:id="@+id/historyView"
android:layout_width="match_parent"
android:layout_height="160dp"/>
@@ -113,8 +87,8 @@
style="@style/CardHeader"
android:text="@string/best_streaks"/>
<org.isoron.uhabits.ui.habits.show.views.HabitStreakView
android:id="@+id/streakView"
<org.isoron.uhabits.ui.habits.show.views.StreakChart
android:id="@+id/streakChart"
android:layout_width="match_parent"
android:layout_height="200dp"/>
</LinearLayout>
@@ -128,7 +102,7 @@
style="@style/CardHeader"
android:text="@string/frequency"/>
<org.isoron.uhabits.ui.habits.show.views.HabitFrequencyView
<org.isoron.uhabits.ui.habits.show.views.FrequencyChart
android:id="@+id/punchcardView"
android:layout_width="match_parent"
android:layout_height="200dp"/>

View File

@@ -20,7 +20,6 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?windowBackgroundColor"
@@ -31,24 +30,28 @@
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar"
app:title="Meditation"
android:background="@color/deep_orange_700"
android:elevation="1dp"
app:popupTheme="?toolbarPopupTheme"
android:elevation="1dp"/>
app:title="Meditation"/>
<LinearLayout
style="@style/CardList"
android:clipToPadding="false">
<org.isoron.uhabits.ui.habits.show.views.SubtitleCardView
<org.isoron.uhabits.ui.habits.show.views.SubtitleCard
android:id="@+id/subtitleView"
style="@style/ShowHabit.Subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<org.isoron.uhabits.ui.habits.show.views.OverviewCardView
android:paddingTop="12dp"
style="@style/Card" />
<org.isoron.uhabits.ui.habits.show.views.OverviewCard
style="@style/Card"
android:paddingTop="12dp"/>
<org.isoron.uhabits.ui.habits.show.views.ScoreCard
style="@style/Card"
android:paddingTop="12dp"/>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2016 Álinson Santos Xavier <isoron@gmail.com>
~
~ This file is part of Loop Habit Tracker.
~
~ Loop Habit Tracker is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by the
~ Free Software Foundation, either version 3 of the License, or (at your
~ option) any later version.
~
~ Loop Habit Tracker is distributed in the hope that it will be useful, but
~ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along
~ with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<android.support.v7.widget.AppCompatSpinner
android:id="@+id/spinner"
android:layout_width="wrap_content"
android:layout_height="22dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:entries="@array/strengthIntervalNames"
android:theme="@style/SmallSpinner"
/>
<TextView
android:id="@+id/title"
style="@style/CardHeader"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:text="@string/habit_strength"/>
<org.isoron.uhabits.ui.habits.show.views.ScoreChart
android:id="@+id/scoreView"
android:layout_width="match_parent"
android:layout_height="220dp"
android:layout_below="@id/title"/>
</merge>