mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-07 01:28:52 -06:00
Refactor ShowHabit screen; remove fragment
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
style="@style/ListHabits.HabitCard"
|
||||
android:layout_width="match_parent">
|
||||
|
||||
<org.isoron.uhabits.ui.habits.show.views.RingView
|
||||
<org.isoron.uhabits.ui.common.views.RingView
|
||||
android:id="@+id/scoreRing"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
|
||||
@@ -17,50 +17,23 @@
|
||||
~ with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<ScrollView
|
||||
<LinearLayout
|
||||
android:id="@+id/container"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?windowBackgroundColor"
|
||||
android:clipToPadding="false"
|
||||
android:fillViewport="true">
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Toolbar"
|
||||
app:popupTheme="?toolbarPopupTheme"/>
|
||||
|
||||
<LinearLayout
|
||||
style="@style/CardList"
|
||||
android:clipToPadding="false">
|
||||
<View
|
||||
android:id="@+id/toolbarShadow"
|
||||
style="@style/ToolbarShadow"/>
|
||||
|
||||
<org.isoron.uhabits.ui.habits.show.views.cards.SubtitleCard
|
||||
style="@style/ShowHabit.Subtitle"
|
||||
android:id="@+id/subtitleCard"/>
|
||||
|
||||
<!--<View-->
|
||||
<!--android:id="@+id/headerShadow"-->
|
||||
<!--style="@style/ToolbarShadow"/>-->
|
||||
|
||||
<org.isoron.uhabits.ui.habits.show.views.cards.OverviewCard
|
||||
android:id="@+id/overviewCard"
|
||||
android:paddingTop="12dp"
|
||||
style="@style/Card" />
|
||||
|
||||
<org.isoron.uhabits.ui.habits.show.views.cards.ScoreCard
|
||||
android:id="@+id/strengthCard"
|
||||
style="@style/Card"
|
||||
android:gravity="center" />
|
||||
|
||||
<org.isoron.uhabits.ui.habits.show.views.cards.HistoryCard
|
||||
android:id="@+id/historyCard"
|
||||
style="@style/Card"
|
||||
android:paddingBottom="0dp"
|
||||
android:gravity="center" />
|
||||
|
||||
<org.isoron.uhabits.ui.habits.show.views.cards.StreakCard
|
||||
android:id="@+id/streakCard"
|
||||
style="@style/Card"/>
|
||||
|
||||
<org.isoron.uhabits.ui.habits.show.views.cards.FrequencyCard
|
||||
android:id="@+id/frequencyCard"
|
||||
style="@style/Card"/>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
<!-- Separate file so that we can use the layout editor to preview it -->
|
||||
<include layout="@layout/show_habit_inner"/>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
<!--
|
||||
~ 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/>.
|
||||
-->
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/container"
|
||||
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="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.habits.show.ShowHabitActivity"
|
||||
tools:ignore="MergeRootFrame"
|
||||
tools:menu="show_habit_activity_menu,show_habit_fragment_menu">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Toolbar"
|
||||
app:popupTheme="?toolbarPopupTheme"/>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/fragment2"
|
||||
android:name="org.isoron.uhabits.ui.habits.show.ShowHabitFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/toolbar"
|
||||
android:layout_gravity="center"
|
||||
tools:layout="@layout/show_habit"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/toolbarShadow"
|
||||
style="@style/ToolbarShadow"/>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -24,7 +24,7 @@
|
||||
style="@style/CardHeader"
|
||||
android:text="@string/frequency"/>
|
||||
|
||||
<org.isoron.uhabits.ui.habits.show.views.charts.FrequencyChart
|
||||
<org.isoron.uhabits.ui.common.views.FrequencyChart
|
||||
android:id="@+id/frequencyChart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"/>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
style="@style/CardHeader"
|
||||
android:text="@string/history"/>
|
||||
|
||||
<org.isoron.uhabits.ui.habits.show.views.charts.HistoryChart
|
||||
<org.isoron.uhabits.ui.common.views.HistoryChart
|
||||
android:id="@+id/historyChart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="160dp"/>
|
||||
|
||||
68
app/src/main/res/layout/show_habit_inner.xml
Normal file
68
app/src/main/res/layout/show_habit_inner.xml
Normal file
@@ -0,0 +1,68 @@
|
||||
<?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/>.
|
||||
-->
|
||||
|
||||
<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:background="?windowBackgroundColor"
|
||||
android:clipToPadding="false"
|
||||
android:fillViewport="true"
|
||||
tools:showIn="@layout/show_habit">
|
||||
|
||||
<LinearLayout
|
||||
style="@style/CardList"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<org.isoron.uhabits.ui.habits.show.views.SubtitleCard
|
||||
android:id="@+id/subtitleCard"
|
||||
style="@style/ShowHabit.Subtitle"/>
|
||||
|
||||
<!--<View-->
|
||||
<!--android:id="@+id/headerShadow"-->
|
||||
<!--style="@style/ToolbarShadow"/>-->
|
||||
|
||||
<org.isoron.uhabits.ui.habits.show.views.OverviewCard
|
||||
android:id="@+id/overviewCard"
|
||||
style="@style/Card"
|
||||
android:paddingTop="12dp"/>
|
||||
|
||||
<org.isoron.uhabits.ui.habits.show.views.ScoreCard
|
||||
android:id="@+id/strengthCard"
|
||||
style="@style/Card"
|
||||
android:gravity="center"/>
|
||||
|
||||
<org.isoron.uhabits.ui.habits.show.views.HistoryCard
|
||||
android:id="@+id/historyCard"
|
||||
style="@style/Card"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="0dp"/>
|
||||
|
||||
<org.isoron.uhabits.ui.habits.show.views.StreakCard
|
||||
android:id="@+id/streakCard"
|
||||
style="@style/Card"/>
|
||||
|
||||
<org.isoron.uhabits.ui.habits.show.views.FrequencyCard
|
||||
android:id="@+id/frequencyCard"
|
||||
style="@style/Card"/>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
@@ -38,7 +38,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="5">
|
||||
|
||||
<org.isoron.uhabits.ui.habits.show.views.RingView
|
||||
<org.isoron.uhabits.ui.common.views.RingView
|
||||
android:id="@+id/scoreRing"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
android:layout_alignParentTop="true"
|
||||
android:text="@string/habit_strength"/>
|
||||
|
||||
<org.isoron.uhabits.ui.habits.show.views.charts.ScoreChart
|
||||
<org.isoron.uhabits.ui.common.views.ScoreChart
|
||||
android:id="@+id/scoreView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="220dp"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
style="@style/CardHeader"
|
||||
android:text="@string/best_streaks"/>
|
||||
|
||||
<org.isoron.uhabits.ui.habits.show.views.charts.StreakChart
|
||||
<org.isoron.uhabits.ui.common.views.StreakChart
|
||||
android:id="@+id/streakChart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"/>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<org.isoron.uhabits.ui.habits.show.views.RingView
|
||||
<org.isoron.uhabits.ui.common.views.RingView
|
||||
android:id="@+id/scoreRing"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
|
||||
Reference in New Issue
Block a user