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
96414acb
Commit
96414acb
authored
Feb 01, 2019
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Follow notifications to news/blog locally
parent
55ae8355
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
app/src/main/java/app/insti/adapter/NotificationsAdapter.java
...src/main/java/app/insti/adapter/NotificationsAdapter.java
+9
-4
No files found.
app/src/main/java/app/insti/adapter/NotificationsAdapter.java
View file @
96414acb
...
@@ -12,6 +12,7 @@ import app.insti.Utils;
...
@@ -12,6 +12,7 @@ import app.insti.Utils;
import
app.insti.api.EmptyCallback
;
import
app.insti.api.EmptyCallback
;
import
app.insti.api.RetrofitInterface
;
import
app.insti.api.RetrofitInterface
;
import
app.insti.api.model.Event
;
import
app.insti.api.model.Event
;
import
app.insti.api.model.NewsArticle
;
import
app.insti.api.model.Notification
;
import
app.insti.api.model.Notification
;
import
app.insti.api.model.PlacementBlogPost
;
import
app.insti.api.model.PlacementBlogPost
;
import
app.insti.fragment.NewsFragment
;
import
app.insti.fragment.NewsFragment
;
...
@@ -37,22 +38,26 @@ public class NotificationsAdapter extends CardAdapter<Notification> {
...
@@ -37,22 +38,26 @@ public class NotificationsAdapter extends CardAdapter<Notification> {
/* Close the bottom sheet */
/* Close the bottom sheet */
notificationsFragment
.
dismiss
();
notificationsFragment
.
dismiss
();
Gson
gson
=
Utils
.
gson
;
/* Open event */
/* Open event */
if
(
notification
.
isEvent
())
{
if
(
notification
.
isEvent
())
{
Gson
gson
=
new
Gson
();
Event
event
=
gson
.
fromJson
(
gson
.
toJson
(
notification
.
getNotificationActor
()),
Event
.
class
)
;
Event
event
=
gson
.
fromJson
(
gson
.
toJson
(
notification
.
getNotificationActor
()),
Event
.
class
)
;
Utils
.
openEventFragment
(
event
,
fragmentActivity
);
Utils
.
openEventFragment
(
event
,
fragmentActivity
);
}
else
if
(
notification
.
isNews
())
{
}
else
if
(
notification
.
isNews
())
{
NewsFragment
newsFragment
=
new
NewsFragment
();
NewsFragment
newsFragment
=
new
NewsFragment
();
NewsArticle
newsArticle
=
gson
.
fromJson
(
gson
.
toJson
(
notification
.
getNotificationActor
()),
NewsArticle
.
class
)
;
newsFragment
.
withId
(
newsArticle
.
getId
());
Utils
.
updateFragment
(
newsFragment
,
fragmentActivity
);
Utils
.
updateFragment
(
newsFragment
,
fragmentActivity
);
}
else
if
(
notification
.
isBlogPost
())
{
}
else
if
(
notification
.
isBlogPost
())
{
Gson
gson
=
new
Gson
();
PlacementBlogPost
post
=
gson
.
fromJson
(
gson
.
toJson
(
notification
.
getNotificationActor
()),
PlacementBlogPost
.
class
);
PlacementBlogPost
post
=
gson
.
fromJson
(
gson
.
toJson
(
notification
.
getNotificationActor
()),
PlacementBlogPost
.
class
);
Fragment
fragment
;
if
(
post
.
getLink
().
contains
(
"training"
))
{
if
(
post
.
getLink
().
contains
(
"training"
))
{
Utils
.
updateFragment
(
new
TrainingBlogFragment
(),
fragmentActivity
);
fragment
=
(
new
TrainingBlogFragment
()).
withId
(
post
.
getId
()
);
}
else
{
}
else
{
Utils
.
updateFragment
(
new
PlacementBlogFragment
(),
fragmentActivity
);
fragment
=
(
new
PlacementBlogFragment
()).
withId
(
post
.
getId
()
);
}
}
Utils
.
updateFragment
(
fragment
,
fragmentActivity
);
}
}
}
}
...
...
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