mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 13:23:58 +01:00
Added option in the action bar menu to view archived notifications (#2422)
* changed layout and implemented archived notificaitons feature * set different texts for toolbar,menu option and no notification text in archived * modified the startup intent for NotificationsActivity * disabled swipe on archived * commit * fixed navigation drawer on notification activity * handled on back pressed * updated strings.xml * removed TODO * some minor changes * set progress bar visibility * some code quality changes * commit * some code quality changes * removing unused import statements
This commit is contained in:
parent
cb3a570090
commit
a9629c6f99
10 changed files with 186 additions and 80 deletions
|
|
@ -273,6 +273,7 @@ public class ApacheHttpClientMediaWikiApi implements MediaWikiApi {
|
|||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String appendEdit(String editToken, String processedPageContent, String filename, String summary) throws IOException {
|
||||
|
|
@ -557,16 +558,22 @@ public class ApacheHttpClientMediaWikiApi implements MediaWikiApi {
|
|||
|
||||
@Override
|
||||
@NonNull
|
||||
public List<Notification> getNotifications() {
|
||||
public List<Notification> getNotifications(boolean archived) {
|
||||
CustomApiResult notificationNode = null;
|
||||
String notfilter;
|
||||
try {
|
||||
if (archived) {
|
||||
notfilter = "read";
|
||||
}else {
|
||||
notfilter = "!read";
|
||||
}
|
||||
notificationNode = api.action("query")
|
||||
.param("notprop", "list")
|
||||
.param("format", "xml")
|
||||
.param("meta", "notifications")
|
||||
.param("notformat", "model")
|
||||
.param("notwikis", "wikidatawiki|commonswiki|enwiki")
|
||||
.param("notfilter","!read")
|
||||
.param("notfilter", notfilter)
|
||||
.get()
|
||||
.getNode("/api/query/notifications/list");
|
||||
} catch (IOException e) {
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ public interface MediaWikiApi {
|
|||
Observable<String> allCategories(String filter, int searchCatsLimit);
|
||||
|
||||
@NonNull
|
||||
List<Notification> getNotifications() throws IOException;
|
||||
List<Notification> getNotifications(boolean archived) throws IOException;
|
||||
|
||||
@NonNull
|
||||
boolean markNotificationAsRead(Notification notification) throws IOException;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue