aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/ui/logs/TrackableLogsViewCreator.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/ui/logs/TrackableLogsViewCreator.java')
-rw-r--r--main/src/cgeo/geocaching/ui/logs/TrackableLogsViewCreator.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/main/src/cgeo/geocaching/ui/logs/TrackableLogsViewCreator.java b/main/src/cgeo/geocaching/ui/logs/TrackableLogsViewCreator.java
index 300f510..ef8f5cc 100644
--- a/main/src/cgeo/geocaching/ui/logs/TrackableLogsViewCreator.java
+++ b/main/src/cgeo/geocaching/ui/logs/TrackableLogsViewCreator.java
@@ -15,14 +15,15 @@ import java.util.List;
public class TrackableLogsViewCreator extends LogsViewCreator {
- private final Trackable trackable;
+ private Trackable trackable;
+ private final TrackableActivity trackableActivity;
/**
- * @param trackableActivity
*/
- public TrackableLogsViewCreator(TrackableActivity trackableActivity, final Trackable trackable) {
+ public TrackableLogsViewCreator(final TrackableActivity trackableActivity) {
super(trackableActivity);
- this.trackable = trackable;
+ this.trackableActivity = trackableActivity;
+ trackable = trackableActivity.getTrackable();
}
@Override
@@ -32,6 +33,7 @@ public class TrackableLogsViewCreator extends LogsViewCreator {
@Override
protected List<LogEntry> getLogs() {
+ trackable = trackableActivity.getTrackable();
return trackable.getLogs();
}
@@ -41,19 +43,20 @@ public class TrackableLogsViewCreator extends LogsViewCreator {
}
@Override
- protected void fillCountOrLocation(LogViewHolder holder, final LogEntry log) {
- if (StringUtils.isBlank(log.cacheName)) {
- holder.countOrLocation.setVisibility(View.GONE);
- } else {
+ protected void fillCountOrLocation(final LogViewHolder holder, final LogEntry log) {
+ if (StringUtils.isNotBlank(log.cacheName)) {
holder.countOrLocation.setText(Html.fromHtml(log.cacheName));
+ holder.countOrLocation.setVisibility(View.VISIBLE);
final String cacheGuid = log.cacheGuid;
final String cacheName = log.cacheName;
holder.countOrLocation.setOnClickListener(new View.OnClickListener() {
@Override
- public void onClick(View arg0) {
+ public void onClick(final View arg0) {
CacheDetailActivity.startActivityGuid(activity, cacheGuid, Html.fromHtml(cacheName).toString());
}
});
+ } else {
+ holder.countOrLocation.setVisibility(View.GONE);
}
}