finalize 4.0.2

This commit is contained in:
Phillip Thelen 2022-09-02 17:09:21 +02:00
parent ee9081b679
commit 751e87338a
7 changed files with 37 additions and 13 deletions

View file

@ -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" />

View file

@ -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>

View file

@ -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"

View file

@ -365,6 +365,8 @@ 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
@ -372,7 +374,9 @@ class PreferencesFragment : BasePreferencesFragment(), SharedPreferences.OnShare
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()
@ -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) {

View file

@ -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

View file

@ -1,2 +1,2 @@
NAME=4.0.1
CODE=4470
NAME=4.0.2
CODE=4510

View file

@ -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