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:
Shubham Pinjwani 2019-02-10 16:10:08 +05:30 committed by Vivek Maskara
parent cb3a570090
commit a9629c6f99
10 changed files with 186 additions and 80 deletions

View file

@ -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) {

View file

@ -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;