Add Reader subscription settings bottom sheet#22535
Conversation
Add iOS-like subscription options when viewing a blog's posts in the Reader. Users see a settings icon in the blog preview header that opens a bottom sheet with three subscription options: - Notify me of new posts (push notifications) - Email me new posts - Email me new comments The settings icon only appears for followed WordPress.com blogs (not external RSS feeds) when the user is logged in. New files: - ReaderSubscriptionSettingsUiState.kt - ReaderBlogSubscriptionUseCase.kt - ReaderSubscriptionSettingsViewModel.kt - ReaderSubscriptionSettingsBottomSheetFragment.kt - reader_subscription_settings_bottom_sheet.xml Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Generated by 🚫 Danger |
Remove animateLayoutChanges="true" which caused the bottom sheet to scroll up when toggling options due to layout animations triggered by loading state and switch enabled state changes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Check network availability before updating subscription settings and show a snackbar message when offline. Also fix toggle revert logic to properly restore the previous value on failure. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
| App Name | Jetpack | |
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr22535-8a4582f | |
| Commit | 8a4582f | |
| Direct Download | jetpack-prototype-build-pr22535-8a4582f.apk |
|
| App Name | WordPress | |
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr22535-8a4582f | |
| Commit | 8a4582f | |
| Direct Download | wordpress-prototype-build-pr22535-8a4582f.apk |
WordPress/src/main/java/org/wordpress/android/ui/reader/adapters/ReaderPostAdapter.java
Fixed
Show fixed
Hide fixed
Tests cover: - start() initialization with and without existing subscription - onNotifyPostsToggled() success, failure, and no network cases - onEmailPostsToggled() success, failure, and no network cases - onEmailCommentsToggled() success, failure, and no network cases - Snackbar events for errors and no network - Cleanup calling useCase.cleanup() Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This comment was marked as outdated.
This comment was marked as outdated.
...rg/wordpress/android/ui/reader/subscription/ReaderSubscriptionSettingsBottomSheetFragment.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/reader/views/ReaderSiteHeaderView.java
Show resolved
Hide resolved
.../src/main/java/org/wordpress/android/ui/reader/subscription/ReaderBlogSubscriptionUseCase.kt
Show resolved
Hide resolved
...rg/wordpress/android/ui/reader/subscription/ReaderSubscriptionSettingsBottomSheetFragment.kt
Show resolved
Hide resolved
...rg/wordpress/android/ui/reader/subscription/ReaderSubscriptionSettingsBottomSheetFragment.kt
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/reader/views/ReaderSiteHeaderView.java
Show resolved
Hide resolved
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Prevent race conditions by checking isLoading state before processing toggle actions in ReaderSubscriptionSettingsViewModel. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…inuation - Replace Continuation with Channel for async result handling - Remove unused updateEmailPostsFrequency method and its imports - Change switch listeners from setOnClickListener to setOnCheckedChangeListener Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This comment was marked as outdated.
This comment was marked as outdated.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #22535 +/- ##
==========================================
+ Coverage 38.87% 38.88% +0.01%
==========================================
Files 2202 2206 +4
Lines 107051 107293 +242
Branches 15103 15131 +28
==========================================
+ Hits 41617 41722 +105
- Misses 61972 62098 +126
- Partials 3462 3473 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Replace individual switch disabling with a semi-transparent scrim overlay that blocks interaction while loading. This provides clearer visual feedback and prevents toggle jitter during loading states. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The _dismiss LiveData was declared but never used in the ViewModel. Removed it along with its observer in the Fragment. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Removed strings for email frequency options and success message that were added for future features but are currently unused. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The errorMessage parameter was never shown to users, so changed Failure from a data class to an object for simplicity. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Track READER_MANAGE_NOTIFICATION_SETTINGS_SHOWN when bottom sheet opens - Track FOLLOWED_BLOG_NOTIFICATIONS_SETTINGS_ON/OFF for push toggle - Track FOLLOWED_BLOG_NOTIFICATIONS_SETTINGS_EMAIL_ON/OFF for email toggle - Track FOLLOWED_BLOG_NOTIFICATIONS_SETTINGS_COMMENTS_ON/OFF for comments toggle Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This comment was marked as outdated.
This comment was marked as outdated.
|
|
|
|
|
adalpari
left a comment
There was a problem hiding this comment.
Looks good and works as expected!





Closes CMM-176
On iOS, users have several Reader subscription options for a site:
This PR adds the same options to Android. Users now see a settings icon in the blog preview header that opens a bottom sheet with three subscription options:
The settings icon only appears for followed WordPress.com blogs (not external RSS feeds) when the user is logged in.
New files:
subsmovie.mp4