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

Issue/9349 update notifications tabs (Part 2) #9421

Merged
merged 5 commits into from
Mar 19, 2019

Conversation

theck13
Copy link
Contributor

@theck13 theck13 commented Mar 15, 2019

Fix

Add swiping between tabs to the Notifications list view as described in #9349. This is the second part of the issue, which extracts the single list with multiple filters into multiple lists and adds the ability to swipe between the tabs added in a previous pull request. See the animation below for illustration.

Test

WordPress.com

  1. Log in with WordPress.com account.
  2. Go to Notifications tab.
  3. Notice All, Unread, Comments, Follows, and Likes tabs.
  4. Swipe between All, Unread, Comments, Follows, and Likes tabs.
  5. Notice notification list updates based on tab selected.
  6. Scroll down/up.
  7. Notice toolbar hides/shows based on scroll.

WordPress.org

  1. Log in with self-hosted site only.
  2. Go to Notifications tab.
  3. Notice Jetpack connect view is shown.
  4. Notice tab view is not shown.

Review

Only one developer and one designer are required to review these changes, but anyone can perform the review.

Release

The RELEASE-NOTES.txt document was updated in 96a8f2a with the following:

Added swiping between tabs in Notifications

@theck13 theck13 added this to the 12.1 milestone Mar 15, 2019
@theck13 theck13 changed the title Issue/9349 update notifications tabs Issue/9349 update notifications tabs (Part 2) Mar 17, 2019
@theck13 theck13 marked this pull request as ready for review March 17, 2019 14:41
@SylvesterWilmott
Copy link

Looks good @theck13 !

I'm wondering, while swiping between the tabs there is a space between each fragment. Is this space added by the system or are we adding it?

@theck13
Copy link
Contributor Author

theck13 commented Mar 18, 2019

We are adding that. I set it as 16dp to match the standard margin for a screen. We can change it to a different value if we want. Without any margin between the pages, swiping looked a little odd since each notification item in the list does not have a uniform height.

@khaykov khaykov self-assigned this Mar 18, 2019
Copy link
Member

@khaykov khaykov left a comment

Choose a reason for hiding this comment

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

Everything works as expected 👍 I have only one minor comment.

mTabLayout.addTab(mTabLayout.newTab().setText(getString(R.string.notifications_tab_title_follows)),
TAB_POSITION_FOLLOW);
mTabLayout.addTab(mTabLayout.newTab().setText(getString(R.string.notifications_tab_title_likes)),
TAB_POSITION_LIKE);
mTabLayout.addOnTabSelectedListener(new OnTabSelectedListener() {
Copy link
Member

Choose a reason for hiding this comment

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

We might want to move the setting of OnTabSelectedListener after setupWithViewPager call, otherwise, the TAB_POSITION_ALL will be triggered every time configuration changes (eg. if you are on UNREAD tab, and rotate device the TAB_POSITION_ALL case will be called, and after that TAB_POSITION_UNREAD) .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch! That might be a better way to track usage of the tabs. Interestingly, the original segmented control implementation tracks exactly the way you described. We may want to keep the tracking as is in order to compare usage differences between the old segmented controls and new tabs layout directly. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, If we want to be able to compare existing implementation with a new one we should probably keep the tracking as is. Maybe we can submit a fix in a month or so (however long it takes to get a reliable set of data for comparison).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That sounds good to me.

@SylvesterWilmott
Copy link

We are adding that. I set it as 16dp to match the standard margin for a screen. We can change it to a different value if we want.

I think it looks good!

Copy link
Member

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

@khaykov khaykov merged commit f944c1d into develop Mar 19, 2019
@khaykov khaykov deleted the issue/9349-update-notifications-tabs branch March 19, 2019 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants