Skip to content

Commit

Permalink
finalize 4.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipthelen committed Sep 2, 2022
1 parent ee9081b commit 751e873
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 13 deletions.
13 changes: 13 additions & 0 deletions Habitica/res/layout/preference_group_footer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@android:id/title"
android:layout_marginBottom="16dip"
style="@style/Body1"
android:textSize="12sp"
android:textColor="@color/text_ternary"
android:paddingStart="32dip"
android:paddingEnd="32dip"
android:paddingBottom="16dp"
android:text="@string/copy_tasks_description"
xmlns:android="http://schemas.android.com/apk/res/android" />
1 change: 1 addition & 0 deletions Habitica/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1254,4 +1254,5 @@
<string name="time_management">Time Management + Accountability</string>
<string name="copy_tasks_description">Show assigned and open tasks on your personal task lists</string>
<string name="copy_shared_tasks">Copy shared tasks</string>
<string name="group_plan_settings">Group Plan Settings</string>
</resources>
10 changes: 7 additions & 3 deletions Habitica/res/xml/preferences_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,13 @@

<PreferenceCategory
android:key="groups_category"
android:title="@string/groups"
android:layout="@layout/preference_category_groups"
app:isPreferenceVisible="false"/>
android:title="@string/group_plan_settings"
android:layout="@layout/preference_category"
app:isPreferenceVisible="false">
<Preference android:title="@string/copy_tasks_description"
android:key="groups_footer"
android:layout="@layout/preference_group_footer"/>
</PreferenceCategory>

<PreferenceCategory
android:title="@string/pref_reminder_header"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,18 @@ class PreferencesFragment : BasePreferencesFragment(), SharedPreferences.OnShare
val teams = userRepository.getTeamPlans().firstOrNull() ?: return@launch
val context = context ?: return@launch
val groupCategory = findPreference<PreferenceCategory>("groups_category")
val footer = groupCategory?.findPreference<Preference>("groups_footer")
footer?.order = 9999
groupCategory?.removeAll()
if (teams.isEmpty()) {
groupCategory?.isVisible = false
} else {
groupCategory?.isVisible = true
for (team in teams) {
val newPreference = CheckBoxPreference(context)
newPreference.title = team.summary
newPreference.layoutResource = R.layout.preference_child_summary
newPreference.title = getString(R.string.copy_shared_tasks)
newPreference.summary = team.summary
newPreference.key = "copy_tasks-${team.id}"
newPreference.onPreferenceChangeListener = Preference.OnPreferenceChangeListener { preference, newValue ->
val currentIds = user?.preferences?.tasks?.mirrorGroupTasks?.toMutableList() ?: mutableListOf()
Expand All @@ -388,6 +392,9 @@ class PreferencesFragment : BasePreferencesFragment(), SharedPreferences.OnShare
newPreference.isChecked = user?.preferences?.tasks?.mirrorGroupTasks?.contains(team.id) == true
}
}
if (footer != null) {
groupCategory.addPreference(footer)
}
}

if (configManager.testingLevel() == AppTestingLevel.STAFF || BuildConfig.DEBUG) {
Expand Down
11 changes: 5 additions & 6 deletions fastlane/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
New in 4.0.1:
New in 4.0.2:
-Habitica has a brand new WearOS app for smart watches!
-Some pesky bug fixes
-Group Plan subscribers can switch on displaying shared tasks from Settings
-Past To Do reminders will not constantly show anymore
-Pet category labels show again
-Newly designed Backgrounds section
-Ability to filter, preview, and pin Backgrounds
-New bottom sheet designs in Items, Pets & Mounts, and Filters
-New Day Start Adjustment interface
-Improvements to task reminder reliability
-Improvements to payment and subscription handling
-Fixes account deletion confirmation prompt
-Fixes task reorder bug for new accounts
-Fixes sprite size in Quest Details preview

4 changes: 2 additions & 2 deletions version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
NAME=4.0.1
CODE=4470
NAME=4.0.2
CODE=4510
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class TaskRepository @Inject constructor(
val result = apiClient.scoreTask(id, direction.text).responseData
if (result != null) {
task.completed = direction == TaskDirection.UP
task.value += result.delta
task.value = (task.value ?: 0.0) + result.delta
if (task.type == TaskType.HABIT) {
if (direction == TaskDirection.UP) {
task.counterUp = task.counterUp?.plus(1) ?: 1
Expand Down

0 comments on commit 751e873

Please sign in to comment.