Skip to content

Commit 751e873

Browse files
committed
finalize 4.0.2
1 parent ee9081b commit 751e873

File tree

7 files changed

+37
-13
lines changed

7 files changed

+37
-13
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<TextView android:layout_width="match_parent"
3+
android:layout_height="wrap_content"
4+
android:id="@android:id/title"
5+
android:layout_marginBottom="16dip"
6+
style="@style/Body1"
7+
android:textSize="12sp"
8+
android:textColor="@color/text_ternary"
9+
android:paddingStart="32dip"
10+
android:paddingEnd="32dip"
11+
android:paddingBottom="16dp"
12+
android:text="@string/copy_tasks_description"
13+
xmlns:android="http://schemas.android.com/apk/res/android" />

Habitica/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,4 +1254,5 @@
12541254
<string name="time_management">Time Management + Accountability</string>
12551255
<string name="copy_tasks_description">Show assigned and open tasks on your personal task lists</string>
12561256
<string name="copy_shared_tasks">Copy shared tasks</string>
1257+
<string name="group_plan_settings">Group Plan Settings</string>
12571258
</resources>

Habitica/res/xml/preferences_fragment.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,13 @@
193193

194194
<PreferenceCategory
195195
android:key="groups_category"
196-
android:title="@string/groups"
197-
android:layout="@layout/preference_category_groups"
198-
app:isPreferenceVisible="false"/>
196+
android:title="@string/group_plan_settings"
197+
android:layout="@layout/preference_category"
198+
app:isPreferenceVisible="false">
199+
<Preference android:title="@string/copy_tasks_description"
200+
android:key="groups_footer"
201+
android:layout="@layout/preference_group_footer"/>
202+
</PreferenceCategory>
199203

200204
<PreferenceCategory
201205
android:title="@string/pref_reminder_header"

Habitica/src/main/java/com/habitrpg/android/habitica/ui/fragments/preferences/PreferencesFragment.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,14 +365,18 @@ class PreferencesFragment : BasePreferencesFragment(), SharedPreferences.OnShare
365365
val teams = userRepository.getTeamPlans().firstOrNull() ?: return@launch
366366
val context = context ?: return@launch
367367
val groupCategory = findPreference<PreferenceCategory>("groups_category")
368+
val footer = groupCategory?.findPreference<Preference>("groups_footer")
369+
footer?.order = 9999
368370
groupCategory?.removeAll()
369371
if (teams.isEmpty()) {
370372
groupCategory?.isVisible = false
371373
} else {
372374
groupCategory?.isVisible = true
373375
for (team in teams) {
374376
val newPreference = CheckBoxPreference(context)
375-
newPreference.title = team.summary
377+
newPreference.layoutResource = R.layout.preference_child_summary
378+
newPreference.title = getString(R.string.copy_shared_tasks)
379+
newPreference.summary = team.summary
376380
newPreference.key = "copy_tasks-${team.id}"
377381
newPreference.onPreferenceChangeListener = Preference.OnPreferenceChangeListener { preference, newValue ->
378382
val currentIds = user?.preferences?.tasks?.mirrorGroupTasks?.toMutableList() ?: mutableListOf()
@@ -388,6 +392,9 @@ class PreferencesFragment : BasePreferencesFragment(), SharedPreferences.OnShare
388392
newPreference.isChecked = user?.preferences?.tasks?.mirrorGroupTasks?.contains(team.id) == true
389393
}
390394
}
395+
if (footer != null) {
396+
groupCategory.addPreference(footer)
397+
}
391398
}
392399

393400
if (configManager.testingLevel() == AppTestingLevel.STAFF || BuildConfig.DEBUG) {

fastlane/changelog.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
New in 4.0.1:
1+
New in 4.0.2:
22
-Habitica has a brand new WearOS app for smart watches!
3-
-Some pesky bug fixes
3+
-Group Plan subscribers can switch on displaying shared tasks from Settings
4+
-Past To Do reminders will not constantly show anymore
5+
-Pet category labels show again
46
-Newly designed Backgrounds section
57
-Ability to filter, preview, and pin Backgrounds
68
-New bottom sheet designs in Items, Pets & Mounts, and Filters
79
-New Day Start Adjustment interface
8-
-Improvements to task reminder reliability
910
-Improvements to payment and subscription handling
10-
-Fixes account deletion confirmation prompt
11-
-Fixes task reorder bug for new accounts
12-
-Fixes sprite size in Quest Details preview
11+

version.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
NAME=4.0.1
2-
CODE=4470
1+
NAME=4.0.2
2+
CODE=4510

wearos/src/main/java/com/habitrpg/wearos/habitica/data/repositories/TaskRepository.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class TaskRepository @Inject constructor(
3636
val result = apiClient.scoreTask(id, direction.text).responseData
3737
if (result != null) {
3838
task.completed = direction == TaskDirection.UP
39-
task.value += result.delta
39+
task.value = (task.value ?: 0.0) + result.delta
4040
if (task.type == TaskType.HABIT) {
4141
if (direction == TaskDirection.UP) {
4242
task.counterUp = task.counterUp?.plus(1) ?: 1

0 commit comments

Comments
 (0)