Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rooms section collapsing #5616

Merged
merged 4 commits into from
Mar 24, 2022
Merged

Conversation

Florian14
Copy link
Contributor

@Florian14 Florian14 commented Mar 23, 2022

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Fix inconsistencies between the arrow visibility and the collapse action by clicking on a room section header.

Motivation and context

The sections were always collapsible even if the arrow was not visible. Adding favourites in both DM and Rooms tab was causing issues on the arrow visibility for this section.

Screenshots / GIFs

Tests

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

@Florian14 Florian14 requested review from a team and fedrunov and removed request for a team March 23, 2022 14:29
@github-actions
Copy link

github-actions bot commented Mar 23, 2022

Unit Test Results

106 files  106 suites   1m 16s ⏱️
188 tests 188 ✔️ 0 💤 0
622 runs  622 ✔️ 0 💤 0

Results for commit 3c73ccc.

♻️ This comment has been updated with latest results.

@Florian14 Florian14 marked this pull request as draft March 23, 2022 15:49
@Florian14 Florian14 removed the request for review from fedrunov March 23, 2022 15:49
@ganfra ganfra changed the base branch from develop to hotfix/1.4.7 March 24, 2022 10:34
@Florian14 Florian14 force-pushed the hotfix/fre/collapse_rooms_section branch from 43136b9 to 3c73ccc Compare March 24, 2022 14:53
@Florian14 Florian14 marked this pull request as ready for review March 24, 2022 14:54
@Florian14 Florian14 requested review from a team and onurays and removed request for a team March 24, 2022 14:54
@github-actions
Copy link

Ktlint Results

👎Failed
matrix-sdk-android 🔸 api/session/room/RoomService.kt:21:1: Unused import (no-unused-imports)
matrix-sdk-android 🔸 internal/session/room/DefaultRoomService.kt:23:1: Unused import (no-unused-imports)

Copy link
Member

@ganfra ganfra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks

@ganfra ganfra merged commit 81aa42a into hotfix/1.4.7 Mar 24, 2022
@ganfra ganfra deleted the hotfix/fre/collapse_rooms_section branch March 24, 2022 15:04
@@ -44,11 +45,12 @@ class SectionHeaderAdapter constructor(
val shouldShowExpandedArrow: Boolean = false
)

lateinit var roomsSectionData: RoomsSectionData
var roomsSectionData: RoomsSectionData = roomsSectionData
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strange line of code 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah it's using the value from the constructor. A bit confusing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is to prevent the lateinit declaration of the attribute and the initialization check of the attribute which was previously done in the updateSection method. I force passing the value as a constructor param and I init the attribute with that value. Previously, the attribute was initialized directly after creating the class object. I could set a different name to the param for clarity.

@mnaturel
Copy link
Contributor

mnaturel commented Apr 6, 2022

Fixes #4533 (to prevent from non intended collapse of the section).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants