Commit d184dc07 authored by Varun Patil's avatar Varun Patil

Prevent showing low res image onResume in EventFragment

parent 297fec0e
...@@ -75,7 +75,8 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg ...@@ -75,7 +75,8 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
ImageButton shareEventButton; ImageButton shareEventButton;
RecyclerView bodyRecyclerView; RecyclerView bodyRecyclerView;
String TAG = "EventFragment"; String TAG = "EventFragment";
int appBarOffset = 0; private int appBarOffset = 0;
private boolean creatingView = false;
// Hold a reference to the current animator, // Hold a reference to the current animator,
// so that it can be canceled mid-way. // so that it can be canceled mid-way.
...@@ -127,6 +128,9 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg ...@@ -127,6 +128,9 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
// Check if we are not returning after a pause
creatingView = true;
// Inflate the layout for this fragment // Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_event, container, false); return inflater.inflate(R.layout.fragment_event, container, false);
} }
...@@ -154,9 +158,10 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg ...@@ -154,9 +158,10 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
Toolbar toolbar = getActivity().findViewById(R.id.toolbar); Toolbar toolbar = getActivity().findViewById(R.id.toolbar);
toolbar.setTitle(event.getEventName()); toolbar.setTitle(event.getEventName());
if (bundle.getBoolean(Constants.NO_SHARED_ELEM, true)) { if (creatingView && bundle.getBoolean(Constants.NO_SHARED_ELEM, true)) {
this.transitionEnd(); this.transitionEnd();
} }
creatingView = false;
setupAppBarLayout(); setupAppBarLayout();
} }
...@@ -205,7 +210,7 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg ...@@ -205,7 +210,7 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
webEventButton = getActivity().findViewById(R.id.web_event_button); webEventButton = getActivity().findViewById(R.id.web_event_button);
shareEventButton = getActivity().findViewById(R.id.share_event_button); shareEventButton = getActivity().findViewById(R.id.share_event_button);
if (event.isEventBigImage()) { if (event.isEventBigImage() || !creatingView) {
Picasso.get().load(event.getEventImageURL()).into(eventPicture); Picasso.get().load(event.getEventImageURL()).into(eventPicture);
} else { } else {
Picasso.get().load(Utils.resizeImageUrl(event.getEventImageURL())).into(eventPicture); Picasso.get().load(Utils.resizeImageUrl(event.getEventImageURL())).into(eventPicture);
......
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