Commit d9968957 authored by Varun Patil's avatar Varun Patil

Open training blog on clicking training notification

parent 30f30333
...@@ -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,10 +117,19 @@ public class NotificationsFragment extends BaseFragment { ...@@ -117,10 +117,19 @@ 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")) {
PlacementBlogFragment placementBlogFragment = new PlacementBlogFragment(); Gson gson = new Gson();
placementBlogFragment.setArguments(bundle); PlacementBlogPost post = gson.fromJson(gson.toJson(notification.getNotificationActor()), PlacementBlogPost.class);
tag = placementBlogFragment.getTag(); if (post.getLink().contains("training")) {
transaction.replace(R.id.framelayout_for_fragment, placementBlogFragment, tag); 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.setArguments(bundle);
tag = placementBlogFragment.getTag();
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment