Skip to content

Commit d7ff9e5

Browse files
nbradburyclaude
andauthored
CMM-1037 NotificationsListFragmentPage empty view (#22509)
* Added test code with TODO * Remove illustration from notifications empty view Hide the image in the empty view regardless of device orientation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Remove illustration from notifications empty view XML layout Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Remove redundant image visibility code from NotificationsListFragmentPage The image visibility line is no longer needed since the image was removed from the XML layout. Also removes the unused DisplayUtils import. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Updated notifs empty view strings * Add bottom padding to center empty view vertically Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Removed TODO --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 735e91c commit d7ff9e5

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsListFragmentPage.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ import org.wordpress.android.ui.reader.comments.ThreadedCommentsActionSource
6767
import org.wordpress.android.util.AniUtils
6868
import org.wordpress.android.util.AppLog
6969
import org.wordpress.android.util.AppLog.T
70-
import org.wordpress.android.util.DisplayUtils
7170
import org.wordpress.android.util.NetworkUtils
7271
import org.wordpress.android.util.WPSwipeToRefreshHelper
7372
import org.wordpress.android.util.analytics.AnalyticsTrackerWrapper
@@ -126,8 +125,8 @@ class NotificationsListFragmentPage : ViewPagerFragment(R.layout.notifications_l
126125
}
127126
notesAdapter = NotesAdapter(requireActivity(), inlineActionEvents = viewModel.inlineActionEvents).apply {
128127
onNoteClicked = { noteId -> handleNoteClick(noteId) }
129-
onNotesLoaded = {
130-
itemCount -> updateEmptyLayouts(itemCount)
128+
onNotesLoaded = { _ ->
129+
updateEmptyLayouts(itemCount)
131130
swipeToRefreshHelper?.isRefreshing = false
132131
}
133132
viewModel.inlineActionEvents.flowWithLifecycle(viewLifecycleOwner.lifecycle, Lifecycle.State.STARTED)
@@ -394,7 +393,6 @@ class NotificationsListFragmentPage : ViewPagerFragment(R.layout.notifications_l
394393
} else {
395394
showEmptyView(titleResId)
396395
}
397-
actionableEmptyView.image.visibility = if (DisplayUtils.isLandscape(context)) View.GONE else View.VISIBLE
398396
}
399397

400398
private fun NotificationsListFragmentPageBinding.showNewNotificationsBar() {

WordPress/src/main/res/layout/notifications_list_fragment_page.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
android:id="@+id/actionable_empty_view"
3232
android:layout_height="match_parent"
3333
android:layout_width="match_parent"
34+
android:paddingBottom="?attr/actionBarSize"
3435
android:visibility="gone"
3536
app:aevButton="@string/posts_empty_list_button"
36-
app:aevImage="@drawable/img_illustration_notifications_152dp"
3737
app:aevSubtitle="@string/notifications_empty_action_unread"
3838
app:aevTitle="@string/notifications_empty_unread"
3939
tools:visibility="visible">

WordPress/src/main/res/values/strings.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,15 +1583,15 @@
15831583
<string name="new_notifications">%d new notifications</string>
15841584
<string name="more_notifications">and %d more.</string>
15851585
<string name="notifications_empty_list">No notifications</string>
1586-
<string name="notifications_empty_all">No notifications…yet.</string>
1586+
<string name="notifications_empty_all">No notifications…yet!</string>
15871587
<string name="notifications_empty_unread">You\'re all up to date!</string>
15881588
<string name="notifications_empty_comments">No comments yet</string>
15891589
<string name="notifications_empty_subscribers">No subscribers yet</string>
15901590
<string name="notifications_empty_likes">No likes yet</string>
1591-
<string name="notifications_empty_action_all">Get active! Comment on posts from blogs you follow.</string>
1592-
<string name="notifications_empty_action_unread">Reignite the conversation: write a new post</string>
1593-
<string name="notifications_empty_action_comments">Join a conversation: comment on posts from blogs you follow</string>
1594-
<string name="notifications_empty_action_followers_likes">Get noticed: comment on posts you\'ve read</string>
1591+
<string name="notifications_empty_action_all">Get active! Comment on posts in the Reader.</string>
1592+
<string name="notifications_empty_action_unread">Reignite the conversation! Write a new post.</string>
1593+
<string name="notifications_empty_action_comments">Join a conversation! Comment on posts in the Reader.</string>
1594+
<string name="notifications_empty_action_followers_likes">Get noticed! Comment on posts you\'ve read.</string>
15951595
<string name="notifications_jetpack_connection_setup_info">To get helpful notifications on your device from your WordPress site, you\'ll need to install the Jetpack plugin. Would you like to set up Jetpack?</string>
15961596
<string name="notifications_empty_view_reader">Go to Reader</string>
15971597
<string name="content_description_person_reading_device_notification">Person reading device with notifications</string>

0 commit comments

Comments
 (0)