mirror of
https://github.com/gsantner/dandelion
synced 2025-12-15 00:31:11 +01:00
Merge branch 'notification_toolbar_item_rework'
This commit is contained in:
commit
54ba7b389c
3 changed files with 124 additions and 5 deletions
|
|
@ -620,7 +620,7 @@ public class MainActivity extends ThemedActivity
|
|||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
AppLog.i(this, "onOptionsItemSelected()");
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_notifications: {
|
||||
case R.id.action_notifications_all: {
|
||||
if (WebHelper.isOnline(MainActivity.this)) {
|
||||
openDiasporaUrl(urls.getNotificationsUrl());
|
||||
return true;
|
||||
|
|
@ -630,6 +630,67 @@ public class MainActivity extends ThemedActivity
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
case R.id.action_notifications_also_commented: {
|
||||
if (WebHelper.isOnline(MainActivity.this)) {
|
||||
openDiasporaUrl(urls.getSuburlNotificationsAlsoCommentedUrl());
|
||||
return true;
|
||||
} else {
|
||||
snackbarNoInternet.show();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
case R.id.action_notifications_comment_on_post: {
|
||||
if (WebHelper.isOnline(MainActivity.this)) {
|
||||
openDiasporaUrl(urls.getSuburlNotificationsCommentOnPostUrl());
|
||||
return true;
|
||||
} else {
|
||||
snackbarNoInternet.show();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
case R.id.action_notifications_liked: {
|
||||
if (WebHelper.isOnline(MainActivity.this)) {
|
||||
openDiasporaUrl(urls.getSuburlNotificationsLikedUrl());
|
||||
return true;
|
||||
} else {
|
||||
snackbarNoInternet.show();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
case R.id.action_notifications_mentioned: {
|
||||
if (WebHelper.isOnline(MainActivity.this)) {
|
||||
openDiasporaUrl(urls.getSuburlNotificationsMentionedUrl());
|
||||
return true;
|
||||
} else {
|
||||
snackbarNoInternet.show();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
case R.id.action_notifications_reshared: {
|
||||
if (WebHelper.isOnline(MainActivity.this)) {
|
||||
openDiasporaUrl(urls.getSuburlNotificationsResharedUrl());
|
||||
return true;
|
||||
} else {
|
||||
snackbarNoInternet.show();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
case R.id.action_notifications_started_sharing: {
|
||||
if (WebHelper.isOnline(MainActivity.this)) {
|
||||
openDiasporaUrl(urls.getSuburlNotificationsStartedSharingUrl());
|
||||
return true;
|
||||
} else {
|
||||
snackbarNoInternet.show();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
case R.id.action_conversations: {
|
||||
if (WebHelper.isOnline(MainActivity.this)) {
|
||||
openDiasporaUrl(urls.getConversationsUrl());
|
||||
|
|
|
|||
|
|
@ -54,6 +54,12 @@ public class DiasporaUrlHelper {
|
|||
public static final String SUBURL_SIGN_IN = "/users/sign_in";
|
||||
public static final String SUBURL_MANAGE_CONTACTS = "/contacts";
|
||||
public static final String URL_BLANK = "about:blank";
|
||||
public static final String SUBURL_NOTIFICATIONS_ALSO_COMMENTED = "/notifications?type=also_commented";
|
||||
public static final String SUBURL_NOTIFICATIONS_COMMENT_ON_POST = "/notifications?type=comment_on_post";
|
||||
public static final String SUBURL_NOTIFICATIONS_LIKED = "/notifications?type=liked";
|
||||
public static final String SUBURL_NOTIFICATIONS_MENTIONED = "/notifications?type=mentioned";
|
||||
public static final String SUBURL_NOTIFICATIONS_RESHARED = "/notifications?type=reshared";
|
||||
public static final String SUBURL_NOTIFICATIONS_STARTED_SHARING = "/notifications?type=started_sharing";
|
||||
|
||||
public DiasporaUrlHelper(AppSettings settings) {
|
||||
this.settings = settings;
|
||||
|
|
@ -257,6 +263,31 @@ public class DiasporaUrlHelper {
|
|||
return getPodUrl() + SUBURL_MANAGE_CONTACTS;
|
||||
}
|
||||
|
||||
|
||||
public String getSuburlNotificationsAlsoCommentedUrl() {
|
||||
return getPodUrl() + SUBURL_NOTIFICATIONS_ALSO_COMMENTED;
|
||||
}
|
||||
|
||||
public String getSuburlNotificationsCommentOnPostUrl() {
|
||||
return getPodUrl() + SUBURL_NOTIFICATIONS_COMMENT_ON_POST;
|
||||
}
|
||||
|
||||
public String getSuburlNotificationsLikedUrl() {
|
||||
return getPodUrl() + SUBURL_NOTIFICATIONS_LIKED;
|
||||
}
|
||||
|
||||
public String getSuburlNotificationsMentionedUrl() {
|
||||
return getPodUrl() + SUBURL_NOTIFICATIONS_MENTIONED;
|
||||
}
|
||||
|
||||
public String getSuburlNotificationsResharedUrl() {
|
||||
return getPodUrl() + SUBURL_NOTIFICATIONS_RESHARED;
|
||||
}
|
||||
|
||||
public String getSuburlNotificationsStartedSharingUrl() {
|
||||
return getPodUrl() + SUBURL_NOTIFICATIONS_STARTED_SHARING;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the url of the blank WebView
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue