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

Support offline notifications #2872

Merged
merged 103 commits into from
Nov 18, 2021
Merged

Support offline notifications #2872

merged 103 commits into from
Nov 18, 2021

Conversation

cooltey
Copy link
Collaborator

@cooltey cooltey commented Oct 5, 2021

No description provided.

cooltey and others added 28 commits September 16, 2021 11:00
* Update notification list view

* Adding additional parameter for customizing starting position

* Add additional logic of filtering notifications

* Add tablayout listener

* List item view update

* Tweak list item positions

* Some tweaks

* Fix lint

* Update onclick listener on source text

* Set up click listeners

* Tweak constraint view

* Fix view arrange

* tweak view

* Tweak a bit

* Fix constraint layout issue

* Tweak view a bit.

* Update icon setting

* Use flow

* Set layout direction everytime.

* Implement mark all as read

* Wrap up all read/unread behaviors

* Update settings

* Fix lint

* tweak

* Update tab background and text colors

* Hide tablayout when loading

* Update long press action on Notification list view (#2815)

* Update long press action on Notification list view

* Wrap up
* Direct replies from Notifications.

* Remove test code.

* Add qq strings.

* Dismiss notification after replying.

* Add flag to update current PendingIntent.

* Indent correctly.

* Add structured comment when direct-replying.

* Clean up a bit.

Co-authored-by: Cooltey Feng <cfeng@wikimedia.org>
* Tweak: notification list design updates

* More tweak

* Fix lint

* Fix all check and icon size
* Update notification list view

* Adding additional parameter for customizing starting position

* Add additional logic of filtering notifications

* Add tablayout listener

* List item view update

* Tweak list item positions

* Some tweaks

* Fix lint

* Update onclick listener on source text

* Set up click listeners

* Tweak constraint view

* Fix view arrange

* tweak view

* Tweak a bit

* Fix constraint layout issue

* Tweak view a bit.

* Update icon setting

* Use flow

* Set layout direction everytime.

* Implement mark all as read

* Wrap up all read/unread behaviors

* Update settings

* Fix lint

* tweak

* Update long press action on Notification list view

* Wrap up

* Update tab background and text colors

* Hide tablayout when loading

* initial commit

* Update unread/read text position

* Set up swipe text properly.

* Add qq strings

* Wrap up overflow menu action and some other stuff.

* Fix lint

* Update icon string

* Rename and remove unused classes

* Remove unused inner class

* Make variable private

* Make another variable private

* Remove unused drawable

* Fix checkstyle
* Update notification icons with wiki language.

* Remove test stuff.
* Update notification list view

* Adding additional parameter for customizing starting position

* Add additional logic of filtering notifications

* Add tablayout listener

* List item view update

* Tweak list item positions

* Some tweaks

* Fix lint

* Update onclick listener on source text

* Set up click listeners

* Tweak constraint view

* Fix view arrange

* tweak view

* Search notifications action mode added.

* Add Filter Activity

* Lint Fix

* Tweak a bit

* Fix constraint layout issue

* Tweak view a bit.

* Update qq string

* update qq string

* Update icon setting

* Renaming for consistency

* Add Filtering

* Use flow

* Set layout direction everytime.

* Implement mark all as read

* Minor fix

* Wrap up all read/unread behaviors

* Update settings

* Fix lint

* tweak

* Filtering updates

* Lint fix

* Update tab background and text colors

* Minor clean-up

* Minor clean-up

* search should include first word

* Hide tablayout when loading

* Code review comments addressed

* Code review comments addressed

* Build fix and made search caseInsensitive

* Curate language codes

* Wired it to the search bar

* Hide tabs and searchbar during search action callback

* Lint fix

* Code review comments

* Code review comments

* Update long press action on Notification list view (#2815)

* Update long press action on Notification list view

* Wrap up

* Build fix

* Lint fix

* New design changes for Filtering Notifications (#2837)

* New design changes

* Lint fix

* UI update for Filters

* Lint fix

* Update filtering and all types buttons

* Filter according to chosen filters

* Minor clean-up

* Minor clean-up

* Lint fix

* Code review comments addressed

* Wire-up analytics for notifications search and filter (#2854)

* Wire-up analytics for notifications search and filter

* Update revision Id

* Code review comments addressed

* Correct colors for language code text color

* Lint fix

* Code review comments addressed

* Follow up: Notification search and filter design change (#2859)

* Design tweak to toggle "all wikis" and "all types"

* Added content description and ripple effect to filter icon

* Minor serialization correction

Co-authored-by: cooltey <coolteygame@gmail.com>
Co-authored-by: Cooltey Feng <cfeng@wikimedia.org>
* Tweak: long press action on notification list view

* Use coordinate layout and some other tweaks

* Make the progress in center
@cooltey cooltey added the HOLD Will review as soon as other more pressing PRs are merged/released. label Oct 5, 2021
@cooltey cooltey requested a review from dbrant as a code owner October 5, 2021 23:50
cooltey and others added 8 commits November 3, 2021 10:20
…#2903)

* Update notification class and create type converters

* Remove unused variable

* Add migration into app database

* Move notification to db package and create a DAO

* Fix lint

* set up test cases

* Fix test cases and open raw file from androidTest asset

* Fix lint

* Init commit of handling offline notifications

* Use suspend function

* Use flow to get the list

* Use StateFlow

* Remove unused log

* Handle error state properly

* Fix lint

* Update list

* Return notificationItemContainer

* Handle search bar and tablayout visibility

* Update tab selection

* Fix jumping issue when reaching the bottom of the list

* Put unreadNotification API request back and add into coroutine process

* Showing filtered list correctly.

* Move mark read function to viewmodel

* Load data when device is online

* Remove duplicate method

* Reformat

* Use ActivityResultLauncher

* Handle mark read state

* Reduce unnecessary re-loading

* Show loading progress bar correctly

* Handle offline disabled fuctions and show message

* Use open class instead of seal class

* Update test case and put dbname map stuff back

* Refine test cases

* Fix lint

* Fix fetching issue

* Update based on new "all" wikis site
* Update notification class and create type converters

* Remove unused variable

* Add migration into app database

* Move notification to db package and create a DAO

* Fix lint

* set up test cases

* Fix test cases and open raw file from androidTest asset

* Fix lint

* Init commit of handling offline notifications

* Use suspend function

* Use flow to get the list

* Use StateFlow

* Remove unused log

* Handle error state properly

* Fix lint

* Update list

* Return notificationItemContainer

* Handle search bar and tablayout visibility

* Update tab selection

* Fix jumping issue when reaching the bottom of the list

* Put unreadNotification API request back and add into coroutine process

* Showing filtered list correctly.

* Move mark read function to viewmodel

* Load data when device is online

* Remove duplicate method

* Reformat

* Use ActivityResultLauncher

* Handle mark read state

* Reduce unnecessary re-loading

* Show loading progress bar correctly

* Handle offline disabled fuctions and show message

* Use open class instead of seal class

* Update test case and put dbname map stuff back

* Refine test cases

* Fix lint

* Initial commit of support saving notification to db

* Fix fetching issue

* Update based on new "all" wikis site

* Update test cases with coroutine

* Fix lint

Co-authored-by: Sharvani Haran <sharvaniharan@users.noreply.github.com>
@sharvaniharan
Copy link
Collaborator

Looks very good... so seamless.

  • When we click on a notification whilst offline, can we also make it unclickable along with showing the toast that the functionality is not available? No use showing an error page
  • Every once in a while i encounter this while offline. Haven't figured out reproducible steps yet. will try:
    offline

@cooltey
Copy link
Collaborator Author

cooltey commented Nov 10, 2021

* When we click on a notification whilst offline, can we also make it unclickable along with showing the toast that the functionality is not available? No use showing an error page

Nice catch. Somehow it is a bug and I have a PR for it. #2973

Ideally, it should not show the toast message on click actions since pages might have been visited before.

@cooltey
Copy link
Collaborator Author

cooltey commented Nov 17, 2021

Looks like after updating the Kotlin version to 1.6.0, something was wrong with coroutine and Room integration. In d90700b I have removed the suspend from insert, delete, and update types of action. The functionality has not been impacted, and hopefully, they can fix that issue soon.

@cooltey cooltey removed the HOLD Will review as soon as other more pressing PRs are merged/released. label Nov 18, 2021
@dbrant dbrant merged commit 2202d4c into main Nov 18, 2021
@dbrant dbrant deleted the notification_offline_design branch November 18, 2021 17:23
cooltey added a commit that referenced this pull request Nov 24, 2021
* main: (27 commits)
  Rip out Talk Page survey. (#3007)
  Fix deserialization of Announcements with version numbers. (#3006)
  Fix: search function does not work in NotificationActivity (#3003)
  Use ViewModel architecture in LanguagesListActivity. (#2813)
  Remove unnecessary slash in CORE_REST_API_PREFIX (#3002)
  Rename NotificationsFilterActivity to NotificationFilterActivity (#3001)
  Use SparseArray.valueIterator() extension. (#2997)
  Share talk topic discussion (#2993)
  Fix sequencing of Watchlist and Notification tooltips. (#3000)
  Use Menu.children extension. (#2998)
  Make WikiSite a data class. (#2995)
  Fix strings.
  Localisation updates from https://translatewiki.net.
  Use getOrElse() extension. (#2996)
  Improve handling of errors when submitting Talk messages. (#2992)
  Follow-up to Error message for nonexistent user: Simplify. (#2991)
  Support offline notifications (#2872)
  Update error message when User page doesn't exist (#2980)
  Localisation updates from https://translatewiki.net.
  Make FlatButton style overflowable to multiple lines. (#2989)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants