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
d9968957
Commit
d9968957
authored
Jul 11, 2018
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Open training blog on clicking training notification
parent
30f30333
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
app/src/main/java/app/insti/fragment/NotificationsFragment.java
...c/main/java/app/insti/fragment/NotificationsFragment.java
+15
-6
No files found.
app/src/main/java/app/insti/fragment/NotificationsFragment.java
View file @
d9968957
...
@@ -88,12 +88,12 @@ public class NotificationsFragment extends BaseFragment {
...
@@ -88,12 +88,12 @@ public class NotificationsFragment extends BaseFragment {
/* Mark notification read */
/* Mark notification read */
RetrofitInterface
retrofitInterface
=
ServiceGenerator
.
createService
(
RetrofitInterface
.
class
);
RetrofitInterface
retrofitInterface
=
ServiceGenerator
.
createService
(
RetrofitInterface
.
class
);
String
sessId
=
((
MainActivity
)
getActivity
()).
getSessionIDHeader
();
String
sessId
=
((
MainActivity
)
getActivity
()).
getSessionIDHeader
();
/*
retrofitInterface.markNotificationRead(sessId, notification.getNotificationId()).enqueue(new Callback<Void>() {
retrofitInterface
.
markNotificationRead
(
sessId
,
notification
.
getNotificationId
()).
enqueue
(
new
Callback
<
Void
>()
{
@Override
@Override
public
void
onResponse
(
Call
<
Void
>
call
,
Response
<
Void
>
response
)
{
}
public
void
onResponse
(
Call
<
Void
>
call
,
Response
<
Void
>
response
)
{
}
@Override
@Override
public
void
onFailure
(
Call
<
Void
>
call
,
Throwable
t
)
{
}
public
void
onFailure
(
Call
<
Void
>
call
,
Throwable
t
)
{
}
});
*/
});
FragmentManager
manager
=
getActivity
().
getSupportFragmentManager
();
FragmentManager
manager
=
getActivity
().
getSupportFragmentManager
();
FragmentTransaction
transaction
=
manager
.
beginTransaction
();
FragmentTransaction
transaction
=
manager
.
beginTransaction
();
...
@@ -117,11 +117,20 @@ public class NotificationsFragment extends BaseFragment {
...
@@ -117,11 +117,20 @@ public class NotificationsFragment extends BaseFragment {
transaction
.
replace
(
R
.
id
.
framelayout_for_fragment
,
newsFragment
,
tag
);
transaction
.
replace
(
R
.
id
.
framelayout_for_fragment
,
newsFragment
,
tag
);
newsFragment
.
setArguments
(
bundle
);
newsFragment
.
setArguments
(
bundle
);
}
else
if
(
notification
.
getNotificationActorType
().
contains
(
"blogentry"
))
{
}
else
if
(
notification
.
getNotificationActorType
().
contains
(
"blogentry"
))
{
Gson
gson
=
new
Gson
();
PlacementBlogPost
post
=
gson
.
fromJson
(
gson
.
toJson
(
notification
.
getNotificationActor
()),
PlacementBlogPost
.
class
);
if
(
post
.
getLink
().
contains
(
"training"
))
{
TrainingBlogFragment
trainingBlogFragment
=
new
TrainingBlogFragment
();
trainingBlogFragment
.
setArguments
(
bundle
);
tag
=
trainingBlogFragment
.
getTag
();
transaction
.
replace
(
R
.
id
.
framelayout_for_fragment
,
trainingBlogFragment
,
tag
);
}
else
{
PlacementBlogFragment
placementBlogFragment
=
new
PlacementBlogFragment
();
PlacementBlogFragment
placementBlogFragment
=
new
PlacementBlogFragment
();
placementBlogFragment
.
setArguments
(
bundle
);
placementBlogFragment
.
setArguments
(
bundle
);
tag
=
placementBlogFragment
.
getTag
();
tag
=
placementBlogFragment
.
getTag
();
transaction
.
replace
(
R
.
id
.
framelayout_for_fragment
,
placementBlogFragment
,
tag
);
transaction
.
replace
(
R
.
id
.
framelayout_for_fragment
,
placementBlogFragment
,
tag
);
}
}
}
transaction
.
setCustomAnimations
(
R
.
anim
.
slide_in_left
,
R
.
anim
.
slide_out_left
,
R
.
anim
.
slide_in_right
,
R
.
anim
.
slide_out_right
);
transaction
.
setCustomAnimations
(
R
.
anim
.
slide_in_left
,
R
.
anim
.
slide_out_left
,
R
.
anim
.
slide_in_right
,
R
.
anim
.
slide_out_right
);
transaction
.
addToBackStack
(
tag
).
commit
();
transaction
.
addToBackStack
(
tag
).
commit
();
...
...
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