Refactor ShowHabitRootView; convert ShowHabitActivity to Kotlin

This commit is contained in:
2020-12-22 09:17:39 -06:00
parent 4c1c6e76fc
commit 98d17d60a5
9 changed files with 250 additions and 284 deletions

View File

@@ -31,8 +31,63 @@
app:popupTheme="?toolbarPopupTheme"
android:layout_alignParentTop="true"/>
<!-- Separate file so that we can use the layout editor to preview it -->
<include layout="@layout/show_habit_inner"/>
<ScrollView
android:id="@+id/scrollView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/toolbar"
android:background="?windowBackgroundColor"
android:clipToPadding="false">
<LinearLayout
style="@style/CardList"
android:clipToPadding="false">
<org.isoron.uhabits.activities.habits.show.views.SubtitleCard
android:id="@+id/subtitleCard"
style="@style/ShowHabit.Subtitle"/>
<org.isoron.uhabits.activities.habits.show.views.NotesCard
android:id="@+id/notesCard"
style="@style/Card"
android:gravity="center" />
<org.isoron.uhabits.activities.habits.show.views.OverviewCard
android:id="@+id/overviewCard"
style="@style/Card"
android:paddingTop="12dp"/>
<org.isoron.uhabits.activities.habits.show.views.TargetCard
android:id="@+id/targetCard"
style="@style/Card"
android:paddingTop="12dp"/>
<org.isoron.uhabits.activities.habits.show.views.ScoreCard
android:id="@+id/scoreCard"
style="@style/Card"
android:gravity="center"/>
<org.isoron.uhabits.activities.habits.show.views.BarCard
android:id="@+id/barCard"
style="@style/Card"
android:gravity="center"/>
<org.isoron.uhabits.activities.habits.show.views.HistoryCard
android:id="@+id/historyCard"
style="@style/Card"
android:gravity="center"
android:paddingBottom="0dp"/>
<org.isoron.uhabits.activities.habits.show.views.StreakCard
android:id="@+id/streakCard"
style="@style/Card"/>
<org.isoron.uhabits.activities.habits.show.views.FrequencyCard
android:id="@+id/frequencyCard"
style="@style/Card"/>
</LinearLayout>
</ScrollView>
<View
android:id="@+id/toolbarShadow"

View File

@@ -1,81 +0,0 @@
<?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:id="@+id/scrollView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/toolbar"
android:background="?windowBackgroundColor"
android:clipToPadding="false"
android:fillViewport="true"
tools:showIn="@layout/show_habit">
<LinearLayout
style="@style/CardList"
android:clipToPadding="false">
<org.isoron.uhabits.activities.habits.show.views.SubtitleCard
android:id="@+id/subtitleCard"
style="@style/ShowHabit.Subtitle"/>
<org.isoron.uhabits.activities.habits.show.views.NotesCard
android:id="@+id/notesCard"
style="@style/Card"
android:gravity="center" />
<org.isoron.uhabits.activities.habits.show.views.OverviewCard
android:id="@+id/overviewCard"
style="@style/Card"
android:paddingTop="12dp"/>
<org.isoron.uhabits.activities.habits.show.views.TargetCard
android:id="@+id/targetCard"
style="@style/Card"
android:paddingTop="12dp"/>
<org.isoron.uhabits.activities.habits.show.views.ScoreCard
android:id="@+id/scoreCard"
style="@style/Card"
android:gravity="center"/>
<org.isoron.uhabits.activities.habits.show.views.BarCard
android:id="@+id/barCard"
style="@style/Card"
android:gravity="center"/>
<org.isoron.uhabits.activities.habits.show.views.HistoryCard
android:id="@+id/historyCard"
style="@style/Card"
android:gravity="center"
android:paddingBottom="0dp"/>
<org.isoron.uhabits.activities.habits.show.views.StreakCard
android:id="@+id/streakCard"
style="@style/Card"/>
<org.isoron.uhabits.activities.habits.show.views.FrequencyCard
android:id="@+id/frequencyCard"
style="@style/Card"/>
</LinearLayout>
</ScrollView>