Skip to content

Conversation

@roundhill
Copy link
Contributor

Notifications Redesign

An all-new Notifications area that has a refined and rich experience across Android, iOS and WP.com.

The UX went through many iterations, which is why there's so many commits. Sorry ;)

What's New?

  • Complete redesign of comment list and detail views.
  • Simplifies the note detail view, no longer need separate fragment for follows, likes, badges, etc.
  • You can now like a comment from CommentDetailFragment.
  • You can tap on a user's avatar to view their prmary blog, if they have one.
  • A user displayed in a follow/like type notification will now show their site title and description, if it is available.
  • Links in notifications will load native app views whenever possible.
  • Adding new notifications should only require a server-side change.
  • Added Simperium db indices for data displayed in the list view, which is a huge performance boost for list view scrolling.

How's it work?

Notifications are still backed by Simperium, but now use the 'Notes 2.0' model which enable us to do many new and nifty things:

  • A notification will contain an array of 'Blocks' in them. A block is a UI element that describes content in an area of a notification. See the NoteBlock class to see how the most basic block works. All other blocks are a subclass of NoteBlock that perform different rendering based on their block type.
  • Each block gets its own row in a ListView in NotificationsDetailListFragment. For comment notifications, this Fragment is added to CommentDetailView.
  • Text data in blocks can have Ranges. A range describes a substring in a text that can have an action. Most of the time, these are displayed as links but can also apply different formatting (such as BlockQuote). Ranges that have an action are made clickable by using a NoteBlockClickableSpan.
  • If a Range's type matches up we will load the appropriate view in the app. For example, a post type will load the ReaderPostDetailFragment using the Ids that are provided in the Range.

Notes

  • There's a new NoticonTextView subclass that uses the noticon font to render the notification icons. This will future-proof icons for new notes added in the future and saves space as we don't need PNGs for the note icons any longer.
  • This PR includes a small change to JSONUtils, so that submodule will need to be pushed with that change.
  • The look and feel is quite different from the rest of the app. I'm going to work with @drw158 to get another PR going that will update the rest of the app to the new 'Calypso' coloring.
  • There's an issue with comment likes not coming back around in Simperium that is currently being investigated. You may see comment likes not 'sticking' (even though they will have gone through fine on the site).
  • Not proud of: In order to get the TextViews in the notifications list view to line up perfectly on HDPI devices, I had to add some half-dp values to /values-hdpi/dimens.xml. Wish there was a way around that but I couldn't get them pixel-perfect otherwise.

roundhill added 30 commits June 11, 2014 12:50
Since there's no guarantee that an image or video will be in the note, it would be a waste of memory. Instead they are created if the note block contains an image or video.
…t still.

Protip: Never have your fragments in layout XML.
Added check to show Url in a web view if we don't know what the type of the block is.
Changed ListView background to white to match design.
…etailFragment` that houses the header and detail fragment.
Conflicts:
	src/org/wordpress/android/ui/notifications/BigBadgeFragment.java
	src/org/wordpress/android/ui/notifications/NewNotificationsActivity.java
Cleaned up getters in the note model. Still need to reimplement the caching in this model.
* Now uses `note20` bucket.
* Removed testing code from `SimperiumUtils`
Applied tablet styling to comments list.
WP.com now supports approving a comment once it is liked.

Cleaned up some code.
@roundhill
Copy link
Contributor Author

@roundhill can we try using the same bold weight of the commenter's name for the bold text in the list view? (I think they are using 2 different font weights)

Unfortunately it doesn't look like I can easily change the weight in the list view. It's doing an HTML formatting trick that I don't have much control of.

Conflicts:
	WordPress/src/main/java/org/wordpress/android/ui/WPActionBarActivity.java
	WordPress/src/main/java/org/wordpress/android/ui/reader/ReaderPostPagerActivity.java
Fixes issue where image cache would store multiple copies of the same image.
Previously, you couldn't edit a comment that wasn't from a blog stored in the app. Now `EditCommentActivity` will request the comment and edit it via the REST API.
@nbradbury
Copy link
Contributor

Feedback round four:

  • If I close the comments on a post then go to the app and tap an existing comment notification for that post, the reply box still appears on the detail. Submitting a reply results in a "Reply failed" toast.
  • Tapping "See all of your followers" still isn't friendly. It's jarring to be taken from the app to a web page with a much different experience. If there isn't a way to show all followers natively, perhaps just rename this "Recent followers" and get rid of that link to see all followers.
  • Love the undo box! But the label "Comment spammed" seems odd - maybe "Comment marked as spam" instead?
  • The note list gives no indication of comments awaiting approval. Can that be added?
  • In the detail view of a comment like notification, tapping the comment snippet in the header takes you to the post. Should that show the comment detail instead?
  • Select the "notifications" folder in the project view, then select Analyze > Inspect Code and make sure "Current Directory" is selected. There are some things that can be cleaned up there.

Updated comment spammed string to `Comment marked as spam`
@davewhitley
Copy link
Contributor

Tapping "See all of your followers" still isn't friendly. It's jarring to be taken from the app to a web page with a much different experience. If there isn't a way to show all followers natively, perhaps just rename this "Recent followers" and get rid of that link to see all followers.

I think we should cut out the link to see all of your followers. I don't see the link on my most recent follow notification though. Maybe the view can be called "7 New Followers" or "Recent Followers" like you suggested.

The note list gives no indication of comments awaiting approval. Can that be added?

The best way to do this is probably an icon change in the list view, and maybe instead of blue for unread the circle could be yellow.

In the detail view of a comment like notification, tapping the comment snippet in the header takes you to the post. Should that show the comment detail instead?

If possible I think it should "link" to the comment in the reader.

… detail view.

I created a wrapper activity for CommentDetailFragment, so the experience feels the same when you go to a third-level detail view in notifications.
…erNoteBlock`.

Added note to developer in colors.xml if they are changing the colors.
@roundhill
Copy link
Contributor Author

The best way to do this is probably an icon change in the list view, and maybe instead of blue for unread the circle could be yellow.

I can do this in the next release: #1854

Copy link
Contributor

Choose a reason for hiding this comment

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

It's kind of weird for a setter not to have a parameter.

…note's Ids.

Fixed a weird setter, it should pass the boolean value.
…previously.

Only difference is that `CommentActions.sumbitReplyToCommentRestApi` is used if we've loaded a remote comment from the Note.
@nbradbury
Copy link
Contributor

@roundhill Everything looks good - I'm okay to merge this with 3.2 if you're ready.

@roundhill
Copy link
Contributor Author

Woo! Squirrel it.

@roundhill
Copy link
Contributor Author

Closing this to create the PR against the release/3.2 branch

@roundhill roundhill closed this Sep 12, 2014
@nbradbury nbradbury deleted the feature/notifications-redesign branch September 12, 2014 15:37
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.

5 participants