Commit e39f7145 authored by Varun Patil's avatar Varun Patil

Load minimal body on opening Body Fragment

parent b0a2f501
...@@ -92,7 +92,7 @@ public class BodyFragment extends Fragment { ...@@ -92,7 +92,7 @@ public class BodyFragment extends Fragment {
/* Initialize */ /* Initialize */
appDatabase = AppDatabase.getAppDatabase(getContext()); appDatabase = AppDatabase.getAppDatabase(getContext());
displayBody(min_body);
new getDbBody().execute(min_body.getBodyID()); new getDbBody().execute(min_body.getBodyID());
bodySwipeRefreshLayout=getActivity().findViewById(R.id.body_swipe_refresh_layout); bodySwipeRefreshLayout=getActivity().findViewById(R.id.body_swipe_refresh_layout);
bodySwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { bodySwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
...@@ -136,9 +136,15 @@ public class BodyFragment extends Fragment { ...@@ -136,9 +136,15 @@ public class BodyFragment extends Fragment {
/* Set body information */ /* Set body information */
bodyName.setText(body.getBodyName()); bodyName.setText(body.getBodyName());
Markwon.setMarkdown(bodyDescription, body.getBodyDescription());
Picasso.with(getContext()).load(body.getBodyImageURL()).into(eventPicture); Picasso.with(getContext()).load(body.getBodyImageURL()).into(eventPicture);
/* Return if it's a min body */
if (body.getBodyDescription() == null) {
return;
}
Markwon.setMarkdown(bodyDescription, body.getBodyDescription());
/* Check if user is already following /* Check if user is already following
* Initialize follow button */ * Initialize follow button */
followButton.setBackgroundColor(getResources().getColor(body.getBodyUserFollows() ? R.color.colorAccent : R.color.colorWhite)); followButton.setBackgroundColor(getResources().getColor(body.getBodyUserFollows() ? R.color.colorAccent : R.color.colorWhite));
......
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