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

Add Weekly Roundup toggle to Notification settings #15325

Merged
merged 8 commits into from
Sep 15, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Show Weekly Roundup toggle setting
renanferrari committed Sep 14, 2021

Verified

This commit was signed with the committer’s verified signature.
gsmet Guillaume Smet
commit db7573e069de196c5b0d6b8ba7d124a20c67e3b3
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@
import org.wordpress.android.models.NotificationsSettings;
import org.wordpress.android.models.NotificationsSettings.Channel;
import org.wordpress.android.models.NotificationsSettings.Type;
import org.wordpress.android.ui.prefs.AppPrefs;
import org.wordpress.android.ui.prefs.notifications.PrefMainSwitchToolbarView.MainSwitchToolbarListener;
import org.wordpress.android.util.AppLog;
import org.wordpress.android.util.AppLog.T;
@@ -199,6 +200,15 @@ private View configureLayoutForView(LinearLayout view) {
}
}

// Add Weekly Roundup setting
if (mChannel == Channel.BLOGS && mType == Type.DEVICE) {
String settingName = getContext().getString(R.string.weekly_roundup);
boolean isSettingChecked = AppPrefs.shouldShowWeeklyRoundupNotification(mBlogId);
View settingView = setupSettingView(settingName, null, null, isSettingChecked, true,
(compoundButton, isChecked) -> AppPrefs.setShouldShowWeeklyRoundupNotification(mBlogId, isChecked));
view.addView(settingView);
}

return view;
}

1 change: 1 addition & 0 deletions WordPress/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -3786,6 +3786,7 @@ translators: Block name. %s: The localized block name -->
<string name="create_site_notification_create_site_action">Create site</string>

<!-- Weekly Roundup Notification -->
<string name="weekly_roundup">Weekly Roundup</string>
<string name="weekly_roundup_notification_title">Weekly Roundup: %s</string>
<string name="weekly_roundup_notification_text">Your site got %1$d views, %2$d likes, %3$d comments.</string>
</resources>