mirror of
https://github.com/NiciDieNase/chaosflix
synced 2024-11-27 06:30:29 +00:00
remove duplicate code and (hopefully) fix bug where actions were behind thumbnail
This commit is contained in:
parent
fe6477e3ea
commit
0bb2f2cb3f
1 changed files with 10 additions and 33 deletions
|
@ -157,6 +157,7 @@ public class EventsDetailsFragment extends DetailsFragment {
|
|||
new ItemViewClickedListener(EventsDetailsFragment.this));
|
||||
browseErrorFragment.dismiss();
|
||||
}
|
||||
// TODO add other streams
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -249,52 +250,28 @@ public class EventsDetailsFragment extends DetailsFragment {
|
|||
return new ArrayObjectAdapter(mPresenterSelector);
|
||||
}
|
||||
|
||||
private DetailsOverviewRow setupDetailsOverviewRow(Event event) {
|
||||
private DetailsOverviewRow setupDetailsOverviewRow(Object event) {
|
||||
final DetailsOverviewRow row = new DetailsOverviewRow(event);
|
||||
String thumbUrl;
|
||||
if(event instanceof Event){
|
||||
thumbUrl = ((Event) event).getThumbUrl();
|
||||
} else {
|
||||
thumbUrl = ((Room) event).getThumb();
|
||||
}
|
||||
Glide.with(getActivity())
|
||||
.load(event.getThumbUrl())
|
||||
.load(thumbUrl)
|
||||
.asBitmap()
|
||||
.fallback(DEFAULT_DRAWABLE)
|
||||
.error(DEFAULT_DRAWABLE)
|
||||
.into(new SimpleTarget<Bitmap>(DETAIL_THUMB_WIDTH,DETAIL_THUMB_HEIGHT) {
|
||||
@Override
|
||||
public void onResourceReady(Bitmap resource,
|
||||
GlideAnimation<? super Bitmap> glideAnimation) {
|
||||
row.setImageBitmap(getActivity(),resource);
|
||||
startEntranceTransition();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed(Exception e, Drawable errorDrawable) {
|
||||
super.onLoadFailed(e, errorDrawable);
|
||||
// super.onLoadFailed(e, errorDrawable);
|
||||
row.setImageDrawable(getResources().getDrawable(DEFAULT_DRAWABLE));
|
||||
startEntranceTransition();
|
||||
}
|
||||
});
|
||||
return row;
|
||||
}
|
||||
|
||||
private DetailsOverviewRow setupDetailsOverviewRow(Room room) {
|
||||
final DetailsOverviewRow row = new DetailsOverviewRow(room);
|
||||
Glide.with(getActivity())
|
||||
.load(room.getThumb())
|
||||
.asBitmap()
|
||||
.fallback(DEFAULT_DRAWABLE)
|
||||
.error(DEFAULT_DRAWABLE)
|
||||
.into(new SimpleTarget<Bitmap>(DETAIL_THUMB_WIDTH,DETAIL_THUMB_HEIGHT) {
|
||||
@Override
|
||||
public void onResourceReady(Bitmap resource,
|
||||
GlideAnimation<? super Bitmap> glideAnimation) {
|
||||
row.setImageBitmap(getActivity(),resource);
|
||||
startEntranceTransition();
|
||||
Log.d(TAG,"Start entrance transition");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed(Exception e, Drawable errorDrawable) {
|
||||
super.onLoadFailed(e, errorDrawable);
|
||||
row.setImageDrawable(getResources().getDrawable(DEFAULT_DRAWABLE));
|
||||
startEntranceTransition();
|
||||
}
|
||||
});
|
||||
return row;
|
||||
|
|
Loading…
Reference in a new issue