Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiApp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
RAHUL SHARMA
InstiApp
Commits
692277e4
Commit
692277e4
authored
Jul 11, 2018
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mark notifications as read on click
parent
f05bad14
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
app/src/main/java/app/insti/api/RetrofitInterface.java
app/src/main/java/app/insti/api/RetrofitInterface.java
+3
-0
app/src/main/java/app/insti/fragment/NotificationsFragment.java
...c/main/java/app/insti/fragment/NotificationsFragment.java
+11
-3
No files found.
app/src/main/java/app/insti/api/RetrofitInterface.java
View file @
692277e4
...
...
@@ -68,6 +68,9 @@ public interface RetrofitInterface {
@GET
(
"notifications"
)
Call
<
List
<
Notification
>>
getNotifications
(
@Header
(
"Cookie"
)
String
sessionID
);
@GET
(
"notifications/read/{notificationID}"
)
Call
<
Void
>
markNotificationRead
(
@Header
(
"Cookie"
)
String
sessionID
,
@Path
(
"notificationID"
)
Integer
notificationID
);
@GET
(
"logout"
)
Call
<
Void
>
logout
(
@Header
(
"Cookie"
)
String
sessionID
);
...
...
app/src/main/java/app/insti/fragment/NotificationsFragment.java
View file @
692277e4
...
...
@@ -70,9 +70,7 @@ public class NotificationsFragment extends BaseFragment {
}
@Override
public
void
onFailure
(
Call
<
List
<
Notification
>>
call
,
Throwable
t
)
{
}
public
void
onFailure
(
Call
<
List
<
Notification
>>
call
,
Throwable
t
)
{
}
});
}
...
...
@@ -83,6 +81,16 @@ public class NotificationsFragment extends BaseFragment {
/* Get the notification */
Notification
notification
=
notifications
.
get
(
position
);
/* Mark notification read */
RetrofitInterface
retrofitInterface
=
ServiceGenerator
.
createService
(
RetrofitInterface
.
class
);
String
sessId
=
((
MainActivity
)
getActivity
()).
getSessionIDHeader
();
retrofitInterface
.
markNotificationRead
(
sessId
,
notification
.
getNotificationId
()).
enqueue
(
new
Callback
<
Void
>()
{
@Override
public
void
onResponse
(
Call
<
Void
>
call
,
Response
<
Void
>
response
)
{
}
@Override
public
void
onFailure
(
Call
<
Void
>
call
,
Throwable
t
)
{
}
});
/* Open event */
if
(
notification
.
getNotificationActorType
().
contains
(
"event"
))
{
String
eventJson
=
new
Gson
().
toJson
(
notification
.
getNotificationActor
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment