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

Adds Space List Bottom Sheet #6749

Merged
merged 24 commits into from
Aug 17, 2022
Merged

Conversation

ericdecanini
Copy link
Contributor

@ericdecanini ericdecanini commented Aug 5, 2022

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Adds Space List Bottom Sheet

Motivation and context

Closes #6499

Not included in this PR:

Known bugs to be addressed separately:

Screenshots / GIFs

Before After
Light
Dark
Black

Video:

spaceswitching2.mp4

Tests

  • Enable the New App Layout feature flag
  • Click on the open spaces FAB
  • See the bottom sheet and try navigating between spaces
    There is a known bug where the bottom sheet doesn't always measure properly. This will be addressed in TBA

Tested devices

  • Physical
  • Emulator
  • OS version(s): Android 12

Checklist

@ericdecanini ericdecanini changed the base branch from develop to feature/eric/new_fab August 5, 2022 15:09
…-list-modal

# Conflicts:
#	vector/src/main/java/im/vector/app/features/home/NewHomeDetailFragment.kt
…re/eric/space-list-modal

# Conflicts:
#	vector/src/main/java/im/vector/app/features/home/room/list/home/HomeRoomListFragment.kt
@ericdecanini ericdecanini marked this pull request as ready for review August 5, 2022 15:13
Copy link
Contributor

@fedrunov fedrunov left a comment

Choose a reason for hiding this comment

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

Looks good, but with some comments

@@ -0,0 +1 @@
Adds space list bottom sheet for new app layout
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to provide changelog for features which are not accessible yet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we should them but they should be .wip

holder.name.text = holder.view.context.getString(R.string.all_chats)
holder.root.isChecked = selected
holder.root.context.resources
holder.avatar.background = ContextCompat.getDrawable(holder.view.context, R.drawable.new_space_home_background)
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't it better to set it in xml?

Copy link
Contributor Author

@ericdecanini ericdecanini Aug 10, 2022

Choose a reason for hiding this comment

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

No because we use the same XML for NewSpaceSummaryItem where we don't want to have this background

holder.root.context.resources
holder.avatar.background = ContextCompat.getDrawable(holder.view.context, R.drawable.new_space_home_background)
holder.avatar.backgroundTintList = ColorStateList.valueOf(
ColorUtils.setAlphaComponent(ThemeUtils.getColor(holder.view.context, R.attr.vctr_content_tertiary), (255 * 0.3).toInt()))
Copy link
Contributor

Choose a reason for hiding this comment

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

better to move to xml resource, both declaration of color state and setting it as backgroundTintList

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above

@@ -337,7 +338,8 @@ class NewHomeDetailFragment @Inject constructor(
if (fragmentToShow == null) {
when (tab) {
is HomeTab.RoomList -> {
add(R.id.roomListContainer, HomeRoomListFragment::class.java, null, fragmentTag)
val params = RoomListParams(tab.displayMode)
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't need any param for HomeRoomListFragment

@@ -0,0 +1 @@
Adds space list bottom sheet for new app layout
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need to provide changelogs for features, which are not accessible for users 🤔

# Conflicts:
#	vector/src/main/res/layout/fragment_room_list.xml
Base automatically changed from feature/eric/new_fab to develop August 10, 2022 06:13
@ericdecanini ericdecanini requested review from fedrunov and a team August 10, 2022 09:28
@element-hq element-hq deleted a comment from ElementBot Aug 11, 2022
@element-hq element-hq deleted a comment from ElementBot Aug 11, 2022
@element-hq element-hq deleted a comment from ElementBot Aug 11, 2022
@element-hq element-hq deleted a comment from ElementBot Aug 11, 2022
…-list-modal

# Conflicts:
#	vector/src/main/java/im/vector/app/features/home/room/list/home/HomeRoomListFragment.kt
Copy link
Contributor

@fedrunov fedrunov left a comment

Choose a reason for hiding this comment

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

LGTM

android:layout_gravity="bottom|end"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:accessibilityTraversalBefore="@id/roomListView"

Choose a reason for hiding this comment

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

  • ⚠️ Attribute accessibilityTraversalBefore is only used in API level 22 and higher (current min is 21)
  • ⚠️ Attribute accessibilityTraversalBefore is only used in API level 22 and higher (current min is 21)

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:accessibilityTraversalBefore="@id/roomListView"

Choose a reason for hiding this comment

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

  • ⚠️ Attribute accessibilityTraversalBefore is only used in API level 22 and higher (current min is 21)
  • ⚠️ Attribute accessibilityTraversalBefore is only used in API level 22 and higher (current min is 21)

android:background="@drawable/bg_space_item"
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground"

Choose a reason for hiding this comment

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

  • ⚠️ Attribute android:foreground has no effect on API levels lower than 23 (current min is 21)
  • ⚠️ Attribute android:foreground has no effect on API levels lower than 23 (current min is 21)

android:background="@drawable/bg_space_item"
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground"

Choose a reason for hiding this comment

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

  • ⚠️ Attribute android:foreground has no effect on API levels lower than 23 (current min is 21)
  • ⚠️ Attribute android:foreground has no effect on API levels lower than 23 (current min is 21)

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

8.4% 8.4% Coverage
0.8% 0.8% Duplication

@ericdecanini ericdecanini merged commit 4fedafc into develop Aug 17, 2022
@ericdecanini ericdecanini deleted the feature/eric/space-list-modal branch August 17, 2022 08:51
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.

Space Switching: Add Space List Bottom Sheet
4 participants