Ready to implement groups support in notification system.

This commit is contained in:
Pierre HUBERT 2018-08-01 08:37:48 +02:00
parent 78aadd55a1
commit 2f4621c0e5
4 changed files with 15 additions and 0 deletions

View File

@ -29,6 +29,11 @@ public enum NotifElemType {
*/ */
USER_PAGE, USER_PAGE,
/**
* On a group page
*/
GROUP_PAGE,
/** /**
* On a comment * On a comment
*/ */

View File

@ -195,6 +195,9 @@ public class NotificationsHelper {
case "user_page": case "user_page":
return NotifElemType.USER_PAGE; return NotifElemType.USER_PAGE;
case "group_page":
return NotifElemType.GROUP_PAGE;
case "conversation": case "conversation":
return NotifElemType.CONVERSATION; return NotifElemType.CONVERSATION;

View File

@ -61,6 +61,7 @@ public class NotifsUtils {
//Notification target //Notification target
//User page
if(notif.getFrom_container_type() == NotifElemType.USER_PAGE){ if(notif.getFrom_container_type() == NotifElemType.USER_PAGE){
if(notif.getFrom_user_id() == notif.getFrom_container_id()) if(notif.getFrom_user_id() == notif.getFrom_container_id())
@ -71,6 +72,11 @@ public class NotifsUtils {
} }
//Group page
else if(notif.getFrom_container_type() == NotifElemType.GROUP_PAGE){
message += UiUtils.getString(context, R.string.notif_on_group_page);
}
//Return the message //Return the message
return message; return message;

View File

@ -200,4 +200,5 @@
<string name="navigation_drawer_open">Open navigation drawer</string> <string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string> <string name="navigation_drawer_close">Close navigation drawer</string>
<string name="action_personal_page">My Page</string> <string name="action_personal_page">My Page</string>
<string name="notif_on_group_page">on the page of the group %1$s</string>
</resources> </resources>