mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-05 20:03:52 +00:00
Merge branch 'design2015-mobile' of ssh://sapsailing.com/home/trac/git into design2015-mobile
# By Benjamin Barth # Via Benjamin Barth * 'design2015-mobile' of ssh://sapsailing.com/home/trac/git: Event overview mobile - Hide Impressions section if no media is available Event overview mobile - Fixed NPE if no boot class icnon could by found
This commit is contained in:
commit
306ac78070
2 files changed
+23
-13
No files matched your search
+11
-3
@@ -47,9 +47,7 @@ public class RegattaStatusRegatta extends Composite implements IsMobileSection {
|
||||
}
|
||||
|
||||
private void initRegattaHeader(RegattaMetadataDTO regatta, final PlaceNavigation<?> placeNavigation) {
|
||||
ImageResource image = regatta.getBoatClass() == null ? BoatClassImageResources.INSTANCE.genericBoatClass() :
|
||||
BoatClassImageResolver.getBoatClassIconResource(regatta.getBoatClass());
|
||||
headerUi.setImageUrl(image.getSafeUri().asString());
|
||||
headerUi.setImageUrl(getBootClassIcon(regatta.getBoatClass()).getSafeUri().asString());
|
||||
headerUi.setSectionTitle(regatta.getDisplayName());
|
||||
headerUi.setClickAction(new Command() {
|
||||
@Override
|
||||
@@ -58,5 +56,15 @@ public class RegattaStatusRegatta extends Composite implements IsMobileSection {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private ImageResource getBootClassIcon(String bootClass) {
|
||||
if (bootClass != null) {
|
||||
ImageResource image = BoatClassImageResolver.getBoatClassIconResource(bootClass);
|
||||
if (image != null) {
|
||||
return image;
|
||||
}
|
||||
}
|
||||
return BoatClassImageResources.INSTANCE.genericBoatClass();
|
||||
}
|
||||
|
||||
}
|
||||
+12
-10
@@ -71,17 +71,19 @@ public class EventActivity extends AbstractActivity implements Presenter {
|
||||
view.setSailorInfos(StringMessages.INSTANCE.sailorInfoLongText(), StringMessages.INSTANCE.sailorInfo(), sailorInfoUrl);
|
||||
}
|
||||
view.setQuickFinderValues(place.getCtx().getEventDTO().getRegattas());
|
||||
clientFactory.getHomeService().getMediaForEvent(currentEventUUId, new AsyncCallback<MediaDTO>() {
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
GWT.log("Failed to load media");
|
||||
}
|
||||
if (getCtx().getEventDTO().isHasMedia()) {
|
||||
clientFactory.getHomeService().getMediaForEvent(currentEventUUId, new AsyncCallback<MediaDTO>() {
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
GWT.log("Failed to load media");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(MediaDTO result) {
|
||||
view.setMediaForImpressions(result.getPhotos().size(), result.getVideos().size(), result.getPhotos());
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onSuccess(MediaDTO result) {
|
||||
view.setMediaForImpressions(result.getPhotos().size(), result.getVideos().size(), result.getPhotos());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user